How lochheadr92-creator/living-world works
Living World is a browser-based isometric civilisation simulator: the user watches a deterministic settlement evolve rather than directly controlling each person. The main workflow creates a world, advances its fixed-timestep simulation, and presents the resulting state through rendering and inspection UI. Simulation stages include local knowledge, action selection and execution, resource accounting, production, and social life. The README documents these capabilities; unsampled implementation details are represented at subsystem level, and optional inhabitant control is kept separate.
Main entry points: game.ts Game clock · options_work.ts Work planning · decision.ts Action choice · activities.ts Activities
Components 23
Application
- Game clock
src/app/game.ts - Save and restore
src/app/save.ts
World simulation
- World setup
src/sim/worldgen.ts - World state
src/sim/world.ts - Local perception
src/sim/perception.ts - Beliefs
src/sim/knowledge.ts - Action choice
src/sim/decision.ts - Activities
src/sim/activities.ts - Social life
src/sim/social.ts - People
src/sim/people.ts
Settlement economy
- Work planning
src/sim/options_work.ts - Workplaces
src/sim/facilities.ts - Building lifecycle
src/sim/buildings.ts - Recipes
src/sim/recipes.ts - Resource ledger
src/sim/economy.ts - Tools and carts
src/sim/tools.ts
Presentation
- Isometric renderer
src/render/renderer.ts - Sprites
src/render/sprites.ts - Viewer interface
src/ui/index.ts - Inspector
src/ui/entity.ts
Optional agent
- Agent runner
src/agent/run.ts - Agent observation
src/agent/observe.ts
Other components
- Viewer
Connections 25
- Viewer → Game clock: watches
README.md - Game clock → World setup: creates world
src/app/game.ts - Game clock → World state: advances ticks
src/app/game.ts - World state → Local perception: updates awareness
- Local perception → Beliefs: records beliefs
src/sim/knowledge.ts - Beliefs → Action choice: informs choices
README.md - Action choice → Activities: chooses action
README.md - Activities → World state: changes state
README.md - Action choice → Work planning: plans work
src/sim/options_work.ts - Work planning → Workplaces: plans batches
- Workplaces → Recipes: uses recipes
src/sim/facilities.ts - Workplaces → Resource ledger: moves resources
src/sim/facilities.ts - Building lifecycle → Resource ledger: accounts materials
src/sim/buildings.ts - Work planning → Building lifecycle: plans construction
src/sim/options_work.ts - Work planning → Tools and carts: uses equipment
src/sim/production.ts - Activities → Social life: supports interactions
src/sim/social.ts - Social life → People: updates relations
src/sim/social.ts - Game clock → Isometric renderer: provides view state
src/app/game.ts - Isometric renderer → Sprites: draws sprites
- Viewer → Viewer interface: inspects world
README.md - Viewer interface → Inspector: opens details
src/ui/index.ts - Game clock → Save and restore: saves state
src/app/save.ts - Agent runner → Agent observation: reads person state
src/agent/run.ts - Viewer → Agent runner: optionally drives
README.md - Agent observation → Beliefs: reads beliefs
src/agent/observe.ts