Skip to main content

Module agents

Module agents 

Source
Expand description

The citizens’ CharacterComponent and CitizenAIComponent run together each simulation iteration. See docs/CITIZEN-AI.md.

Order per iteration: animations advance, every character runs its actions and moves, “sequence finished” messages run the AI again with zero time, then the AI updates.

The citizens’ scheduled components (CitizenComponent, CitizenAIComponent and the CharacterComponent’s notify) run for the citizens bucket 1 visited this iteration, with the time since each one’s last visit; so do the sites’ state machines, fires, blight, hunts, attendance, residences and piles in bucket 3 (town::Env::visits).

Deviation: these run after the bucket pass (system by system, each in visiting order) instead of interleaved with it entity by entity, so random draws can come in another order.

This file holds the agents’ state and set-up; the rest is split by topic: update (the iteration), thinking (the AI), lives, commands, paths and views.

Original: AnimationManager::Update; the entity manager’s bit-0x04 components; FUN_140114810 (sequence finished); FUN_1400c9560 (the buckets).

Structs§

Agents
The citizens’ agents: each citizen’s AI and character, and the state the iteration needs.
CitizenRulesAi
The CitizenDescription values the AI reads.
CitizenState
Citizen fields read/written by equipment activities and Citizen messages 1/6/7.

Functions§

entity_views
The parts of each placed entity the activities read.