EnemyDirector
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this component provides and who consumes it, then delete both comment lines. -->
EnemyDirector
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this component provides and who consumes it, then delete both comment lines. -->TODO: describe this component.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2EnemyDirector.component — the enemy force. Sits on `Mount_Enemy` under the scene's `Systems` entity. It owns the squad: it builds each soldier, gives each one a mind, ticks both, routes what the player's rounds hit back into damage, and routes what the squad's rounds hit back into the player's health. It renders nothing and decides nothing about how a soldier looks or how he thinks — `game.enemy.soldier` owns the body and `game.enemy.ai` owns the mind. What lives here is the seam between them and the rest of the game: the spawn points, the waves, the hit zones, and the two events that matter (`HIT` on a soldier, `PLAYER_DAMAGED` on the player). EVERY SOLDIER KNOWS ONLY WHAT HE SAW OR HEARD. The AI is handed the player's position but is free to use it only through `canSee`, which traces — so a soldier behind a wall does not react to a player he cannot see. That property is worth protecting: it is the single thing that separates this from a shooting gallery.
groundAt(x: ?, z: ?) → void
| arg | type | description |
|---|---|---|
| x | ? | |
| z | ? |
buildRoute(lane: ?) → void
Building one soldier
| arg | type | description |
|---|---|---|
| lane | ? |
spawnSoldier(laneIndex: ?, nearPlayer: ?) → void
| arg | type | description |
|---|---|---|
| laneIndex | ? | |
| nearPlayer | ? |
despawnEntry(entry: ?, index: ?) → void
| arg | type | description |
|---|---|---|
| entry | ? | |
| index | ? |
onImpact(impact: ?) → void
Damage the player did A round the player fired struck a soldier. The zone comes from WHICH ENTITY the trace hit — a head is a different entity arriving, not a height compared against a threshold — and the damage is the same formula the weapon uses for everything else.
| arg | type | description |
|---|---|---|
| impact | ? |
onShot(shot: ?) → void
Noise the squad hears
| arg | type | description |
|---|---|---|
| shot | ? |
onFootstep(fs: ?) → void
| arg | type | description |
|---|---|---|
| fs | ? |
playerZoneFor(entityId: ?) → void
Damage the squad does The player's own body parts, by name, so a round that strikes the head is scored as a head hit and a round into the plate carrier is not.
| arg | type | description |
|---|---|---|
| entityId | ? |
soldierShot(entry: ?) → void
One round left a soldier's muzzle. It is traced for real, with the accuracy the AI earned, against the same world the player's rounds are traced in — so a wall between the two of them stops it, and a soldier who shoots through his own cover cannot happen.
| arg | type | description |
|---|---|---|
| entry | ? |
ctxFor(dt: ?) → void
Per frame
| arg | type | description |
|---|---|---|
| dt | ? |
onSpotted(a: ?, pos: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| pos | ? |
suppressed(a: ?) → void
| arg | type | description |
|---|---|---|
| a | ? |
onShot(a: ?) → void
| arg | type | description |
|---|---|---|
| a | ? |
tick(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
awake( ) → void
Lifecycle
update(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
editorUpdate(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
status( ) → void
What the squad knows, for whoever wants to report it.
squad( ) → void
One row per soldier: where he is, what he is doing, and whether he can see the player right now. This is the surface a claim about the AI is checked against — "he reacted" is not something a capture can show.
onDestroy( ) → void
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.