How khalidabdi1/factory works
Factory Yard is a browser-based, live isometric town simulation. The user opens the map, watches goods and people move through the town and its surrounding regions, and can select objects to inspect live details or reveal vehicle routes. The runtime builds the scene, runs simulation systems, and presents them through a WebGL view inside a small React plate. The README documents additional domain systems whose source was not sampled; those are represented at their exact directories, while arrows reflect only shown imports or documented behavior.
Main entry points: core.ts Simulation core · index.ts Runtime bootstrap · view.ts Interactive view · cars.ts Road traffic
Components 27
Presentation
- App page
app/page.tsx - Map plate
components/YardFigure.tsx - Runtime bootstrap
yard/index.ts - Interactive view
yard/view.ts
Simulation
- Simulation core
yard/sim/core.ts - Road traffic
yard/sim/cars.ts - Road rules
yard/sim/roads.ts - People and walking
yard/sim/people.ts - Person movement
yard/sim/person.ts - Town logistics
yard/sim - Sahel systems
yard/sim - East and Millbrook
yard/sim - Special operations
yard/sim
World and models
- Town layout
yard/layout.ts - Terrain
yard/land.ts - Town environment
yard/world/town.ts - Ground and roads
yard/world/ground.ts - Regional environments
yard/world - Vehicles and people models
yard/models - Factory models
yard/models/works.ts
Rendering kernel
- Shared scene state
yard/shared.ts - Isometric projection
yard/kernel/iso.ts - Part geometry
yard/kernel/part.ts - Paths and routes
yard/kernel/path.ts - Math and randomness
yard/kernel/math.ts - Visual theme
yard/theme.ts
Other components
- Visitor
Connections 44
- Visitor → App page: opens
- App page → Map plate: renders
app/page.tsx - Map plate → Runtime bootstrap: loads engine
components/YardFigure.tsx - Runtime bootstrap → Interactive view: starts view
yard/index.ts - Runtime bootstrap → Shared scene state: configures
yard/index.ts - Runtime bootstrap → Town layout: uses
yard/index.ts - Runtime bootstrap → Town environment: builds scene
yard/index.ts - Runtime bootstrap → Regional environments: builds regions
yard/index.ts - Runtime bootstrap → Simulation core: starts simulation
yard/index.ts - Runtime bootstrap → Vehicles and people models: loads models
yard/index.ts - Runtime bootstrap → Visual theme: loads theme
yard/index.ts - Interactive view → Shared scene state: reads shared state
yard/view.ts - Interactive view → Simulation core: reads simulation
yard/view.ts - Interactive view → Road traffic: reads vehicle state
yard/view.ts - Interactive view → People and walking: reads people state
yard/view.ts - Interactive view → Person movement: reads entities
yard/view.ts - Interactive view → Visual theme: uses theme
yard/view.ts - Simulation core → Shared scene state: adds entities
yard/sim/core.ts - Simulation core → Person movement: uses movement
yard/sim/core.ts - Road traffic → Simulation core: uses simulation state
yard/sim/cars.ts - Road traffic → Road rules: checks traffic
yard/sim/cars.ts - Road traffic → People and walking: creates customers
yard/sim/cars.ts - Person movement → Simulation core: uses entity state
yard/sim/person.ts - Person movement → Road rules: checks crossings
yard/sim/person.ts - People and walking → Road traffic: coordinates traffic
yard/sim/people.ts - People and walking → Person movement: uses walkers
yard/sim/people.ts - Town environment → Ground and roads: uses terrain features
yard/world/town.ts - Town environment → Vehicles and people models: uses vehicle models
yard/world/town.ts - Ground and roads → Town layout: uses coordinates
yard/world/ground.ts - Town layout → Terrain: reads elevation
yard/layout.ts - Town layout → Shared scene state: uses shared scene
yard/layout.ts - Terrain → Paths and routes: uses path geometry
yard/land.ts - Part geometry → Isometric projection: projects geometry
yard/kernel/part.ts - Part geometry → Visual theme: uses materials
yard/kernel/part.ts - Simulation core → Paths and routes: uses routes
yard/sim/core.ts - Road traffic → Paths and routes: follows paths
yard/sim/cars.ts - Road traffic → Terrain: reads terrain heights
yard/sim/cars.ts - Vehicles and people models → Part geometry: builds parts
yard/models/starship.ts - Factory models → Part geometry: builds factory parts
yard/models/works.ts - Town logistics → Simulation core: uses shared simulation
yard/sim/police.ts - Sahel systems → Simulation core: uses shared simulation
yard/sim/police.ts - East and Millbrook → Simulation core: uses shared simulation
yard/sim/police.ts - Special operations → Simulation core: uses shared simulation
yard/sim/police.ts - Visitor → Interactive view: selects and inspects