Command
The commander. Everything the player does passes through here: the control scheme for all three device families, who is selected, where they are ordered, which ability is armed, where the camera stands, and the HUD that shows it.
Command
The commander. Everything the player does passes through here: the control scheme for all three device families, who is selected, where they are ordered, which ability is armed, where the camera stands, and the HUD that shows it.
Lives on the scene's mount_command, added by the scene entrypoint with no
fields. It reads game.shared and writes only to the bus — cmd.selection,
cmd.move, cmd.stance, cmd.ability, game.pause — so the battle itself
stays the sim's.
Three families, one set of outcomes:
- a pointer (mouse or finger) presses the field, which carries its own screen position, and that point becomes a pick, an order or a shot;
- a pad has no pointer, so it walks a ground reticle with the left stick and
presses
A, landing the same three outcomes at the reticle; - the HUD is the touch control surface — cards, stance strips, ability
buttons, ALL, ADD, RECENTRE and pause — so every control the input map marks
touch = falseis still reachable by a finger.
It also stands alone. With no sim publishing K.battle.regiments, the ten
regiments in the shared roster are shown at full strength and an order visibly
walks one across the line, so the controls, the camera and the HUD are
playable and provable before the battle exists. The moment the sim publishes
its records, those are the truth and this stops guessing.
Screens it registers: kessrel.field (layer 4, the click surface the canyon
answers through) and kessrel.hud (layer 30, everything a player reads), both
shown only while the phase is battle or ending.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2game/command/Command — the commander himself. Everything the player does passes through here: the control scheme for all three device families, who is selected, where they are ordered, which ability is armed, where the camera stands, and the HUD that shows all of it. The battle itself belongs to the sim; this component only ever says what the commander wants, on the bus, and draws what came back. Three families, one set of outcomes: * a pointer (mouse or finger) presses the field, which carries its own screen position, and that point becomes a pick, an order or a shot; * a pad has no pointer, so it walks a ground reticle with the left stick and presses A, which lands the same three outcomes at the reticle; * the HUD is the touch control surface — cards, stance strips, ability buttons, ALL, ADD, RECENTRE and pause — so every control the input map marks `touch = false` is reachable by a finger on the glass. It also stands alone. With no sim bound yet, the ten regiments in `game.shared` REGIMENTS are shown at full strength and an order visibly walks one across the line, so the controls, the camera and the HUD can be played and proved before the battle exists. The moment the sim publishes `K.battle.regiments`, those records are the truth and this stops guessing.
clamp(v: number, lo: number, hi: number) → number
| arg | type | description |
|---|---|---|
| v | number | |
| lo | number | |
| hi | number |
buildStandIn( ) → void
The regiments, from the sim when it is running and from the roster when it is not. The stand-in is this component's own table; the sim's records are never written to.
usingStandIn( ) → boolean
regiments( ) → void
regimentById(id: number) → any
| arg | type | description |
|---|---|---|
| id | number |
selectionList( ) → void
Selection
publishSelection( ) → void
isAdding( ) → boolean
pick(id: number, additive: boolean) → void
| arg | type | description |
|---|---|---|
| id | number | |
| additive | boolean |
selectAll( ) → void
cycle(delta: number) → void
| arg | type | description |
|---|---|---|
| delta | number |
groundFromScreen(sx: number, sy: number) → void
Pointing at the canyon floor
| arg | type | description |
|---|---|---|
| sx | number | |
| sy | number |
groundFromUi(ux: number, uy: number) → void
A UI callback reports its position in the UI's own logical space, which is not always the viewport's pixel space, so the ratio is measured rather than assumed before the point is unprojected.
| arg | type | description |
|---|---|---|
| ux | number | |
| uy | number |
pointerGround( ) → void
Where the pointer is standing on the canyon floor, and whether it is over a piece of the HUD instead. Both answers come from the pointer itself rather than from a widget's press, so an order lands wherever the commander is looking even when the glass above the canyon has taken the click.
regimentAt(x: number, z: number) → any
| arg | type | description |
|---|---|---|
| x | number | |
| z | number |
cooldownLeft(id: string) → number
Abilities
| arg | type | description |
|---|---|---|
| id | string |
armAbility(id: string) → void
| arg | type | description |
|---|---|---|
| id | string |
disarm( ) → boolean
actAt(x: number, z: number) → string
| arg | type | description |
|---|---|---|
| x | number | |
| z | number |
cycleStance( ) → void
togglePause( ) → void
recentre( ) → void
cameraHandle( ) → any
The camera. This component only ever writes the CommanderCam's fields; the behaviour owns the pose and the lens.
driveCamera(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
hudState( ) → void
The HUD
hudVisible( ) → boolean
refreshScreens(force: boolean) → void
| arg | type | description |
|---|---|---|
| force | boolean |
refreshMarkers(dt: number) → void
Markers
| arg | type | description |
|---|---|---|
| dt | number |
marchStandIn(dt: number) → void
The stand-in march, so an order is visible before the sim exists.
| arg | type | description |
|---|---|---|
| dt | number |
bind( ) → void
Input
onButton(name: string, fn: () → void
| arg | type | description |
|---|---|---|
| name | string | |
| fn | ( |
tick(dt: number) → void
Lifecycle
| arg | type | description |
|---|---|---|
| dt | number |
awake( ) → void
update(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
editorUpdate(dt: number) → void
Play with the clock held still keeps the glass live, so the pause card's own controls, and this HUD's pause pip, answer while everything else waits.
| arg | type | description |
|---|---|---|
| dt | number |
canvasLocal(v: any) → void
Where a UI press happened, in the screen's own space. A canvas reports the point INSIDE itself, and the field canvas sits inset over the clear middle of the frame, so its own rect is added back; every other widget reports the pointer already in screen space. Both spellings are read. A canvas reports the press INSIDE itself, and it reports it in either of two shapes: a { x, y } record, or the pair as one "x,y" string. Both are read, because the shape that arrives decides whether the commander can give an order at all, and a handler that understands only one of them is a canyon that answers no click.
| arg | type | description |
|---|---|---|
| v | any |
pressPoint(data: any) → void
| arg | type | description |
|---|---|---|
| data | any |
onCallback(id: string, data: any) → void
| arg | type | description |
|---|---|---|
| id | string | |
| data | any |
observe( ) → void
What the commander is holding right now, for anything reading this world from outside: a test, a debug panel, or the next agent working on it. It reports and changes nothing.
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.