Log inGet started
World

First Light: Vagant

Branchmain
Branchesmain
Commit2ac9266a40

README.md

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

statewhat it is
driftit has business of its own out on the fen and you are not it
convergea lamp came on somewhere and it is walking to the light
noticeit has stopped. It is looking at you. Under a second, and it is the whole tell a faceless thing can give
huntit is coming, and it is faster than a walk
searchit 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.