brain
One agent per Commissioner, and the state machine that decides what it does with its night.
jasey.brain
One agent per Commissioner, and the state machine that decides what it does with its night.
M.create(rig, index, x, z) makes an agent over a jasey.model rig.
M.tick(agent, dt, world) advances it one frame and returns the single thing
that just happened — "notice", "hunt", "lost", "catch", "splash" — or
nil. It emits nothing itself: JaseyDirector owns every signal the rest of the
game hears, which is what lets the machine be driven from an execute call
with no game running.
The world it is handed is { px, py, pz, hidden, conspicuity, waterDepthAt?, groundAt? }. The agent carries its own x/z rather than reading the entity
back, because a transform write lands at frame end and a reader inside the same
tick would get where it was.
The five states
| state | what it is |
|---|---|
drift | it has business of its own out on the fen and you are not it |
converge | a lamp came on somewhere and it is walking to the light |
notice | it has stopped. It is looking at you. Under a second, and it is the whole tell a faceless thing can give |
hunt | it is coming, and it is faster than a walk |
search | it lost you at a place, and that place is where it goes |
Tuning
M.TUNE holds what belongs to the Commissioners alone — turn rates, the length
of the notice beat, stride and bob, how much the wig trails a turn, how far a
lost scent carries. Everything the whole game shares — speeds, ranges, counts,
how long they hold a scent — lives in fl.TUNE and is read from there.
M.teleport(agent, x, z) moves both the agent and its model; writing the
entity's transform alone moves the model and leaves the Commissioner behind.
Scoped to this part · feeds back into the world's score.