How fellipegoncalvesleite/society-engine works
Society Engine is a deterministic simulation of mobile early human societies; the React interface is an inspection and control surface. A user configures or loads a world, the runner advances it in steps, and each day moves from world ecology through band perception and knowledge to decisions, physical action, demography, and recorded history. The graph preserves the README’s principal domain stages and major capabilities, including expeditions, fission, and seasonal ecology. Some connections are documented in the README or import index; unsampled implementation details are not inferred.
Main entry points: advance.ts Daily advance · bandDecision.ts Daily decisions · simRunner.ts Simulation runner · App.tsx Simulation controls
Components 19
World and ecology
- World generation
src/sim/world/generate.ts - Hydrology
src/sim/world/hydrography.ts - Seasonal ecology
Band behavior
- Perception
src/sim/agents/tileObservation.ts - Band knowledge
src/sim/agents/resourceKnowledge.ts - Daily decisions
src/sim/rules/bandDecision.ts - Movement and mobility
src/sim/agents/bandMobility.ts - Foraging expeditions
src/sim/agents/expedition.ts - Band fission
src/sim/agents/bandLifecycle.ts - Demography
src/sim/agents/demography.ts - Events and history
src/sim/agents/bandHistory.ts
Simulation runtime
- Worker bridge
src/worker/simWorker.ts - Simulation runner
src/sim/runner/simRunner.ts - Daily advance
src/sim/tick/advance.ts - Simulation snapshot
src/sim/runner/simRunner.ts
Inspection interface
- Simulation controls
src/ui/App.tsx - UI state
src/store.ts - Map renderer
src/render/canvasRenderer.ts
Other components
- User
Connections 21
- User → Simulation controls: configures
README.md - Simulation controls → Worker bridge: starts run
- Simulation controls → UI state: updates view
src/ui/App.tsx - Worker bridge → Simulation runner: runs
src/worker/simWorker.ts - Simulation runner → World generation: builds world
src/sim/runner/simRunner.ts - World generation → Hydrology: uses hydrology
src/sim/world/generate.ts - Simulation runner → Daily advance: advances steps
src/sim/runner/simRunner.ts - Daily advance → Seasonal ecology: advances ecology
- Daily advance → Perception: updates perception
- Perception → Band knowledge: updates knowledge
- Band knowledge → Daily decisions: informs decisions
README.md - Daily decisions → Movement and mobility: chooses actions
- Daily decisions → Foraging expeditions: chooses actions
- Daily advance → Demography: applies demography
src/sim/tick/advance.ts - Daily advance → Events and history: records history
src/sim/tick/advance.ts - Daily advance → Simulation snapshot: produces snapshot
src/sim/runner/simRunner.ts - Simulation snapshot → UI state: refreshes state
src/store.ts - UI state → Map renderer: supplies view
src/store.ts - Map renderer → User: shows world
README.md - Foraging expeditions → Seasonal ecology: uses resources
- Demography → Band fission: includes fission
README.md