How jirajiran/theddos_game works
This repository is a browser-based real-time combat game with an integrated map editor. The main player workflow enters through the application shell, loads a play map and session, then accepts input while the simulation updates combat and world state and the view renders the result. The graph preserves the documented editor, data-driven definitions, AI, inventory, vehicles, audio, and interface branches. Source excerpts are partial; links between unsampled subsystems are omitted unless the SOURCE INDEX or excerpts establish them.
Main entry points: sim.js Simulation loop · app.js Application shell · applyEditorMap.js Apply editor map · fire.js Projectile combat
Components 31
App and sessions
- Application shell
js/app.js - Browser entry
js/main.js - Session loading
js/session - Play session
js/app/playSession.js - Player input
js/player/input.js
World and editor
- Map editor
js/editor/main.js - Map documents
js/editor/mapDoc.js - Map view
js/editor/mapView.js - Apply editor map
js/world/applyEditorMap.js - World state
js/world/world.js - Occupancy grid
js/world/occupancy.js - Entity pools
js/world/pools.js
Simulation and combat
- Inventory
js/player/inventory.js - Simulation loop
js/sim.js - Unit behavior
js/sim/unit.js - Projectile combat
js/sim/fire.js - Vehicle state
js/sim/vehicle.js - Combat mechanics
js/combat
Definitions and AI
- Definition registry
js/defs/registry.js - Game pack
js/defs/gamePack.js - Shared config
js/config.js - AI behavior
js/ai - Sense index
js/ai/senseIndex.js - AI blackboard
js/ai/blackboard.js - Local group steering
js/ai/local_group_manager.js
UI and presentation
- Game interface
js/ui - Rendering
js/view/render.js - Unit visuals
js/view/unitVisual.js - Audio
js/audio/sfx.js
Other components
- Player
- Asset requests
Connections 38
- Browser entry → Application shell: starts
js/main.js - Application shell → Session loading: loads session
js/app.js - Application shell → Player input: creates input
js/app.js - Application shell → Play session: creates play
js/app.js - Player → Player input: provides input
- Player input → Simulation loop: drives actions
- Play session → Simulation loop: runs match
js/app/playSession.js - Play session → Inventory: uses inventory
js/app/playSession.js - Map editor → Map documents: edits maps
js/editor/main.js - Map editor → Map view: updates view
js/editor/main.js - Map editor → Session loading: starts test play
js/editor/main.js - Session loading → Apply editor map: loads map
- Apply editor map → World state: builds world
js/world/applyEditorMap.js - Apply editor map → Occupancy grid: sets occupancy
js/world/applyEditorMap.js - Apply editor map → Entity pools: sets pools
js/world/applyEditorMap.js - Simulation loop → Unit behavior: updates units
js/sim.js - Simulation loop → Projectile combat: updates combat
js/sim.js - Simulation loop → World state: updates world
js/sim.js - Simulation loop → Sense index: uses index
js/sim.js - Unit behavior → AI behavior: uses behavior
js/sim/unit.js - Unit behavior → Local group steering: delegates steering
js/sim/unit.js - Local group steering → AI blackboard: writes goals
js/ai/local_group_manager.js - Local group steering → Sense index: checks hostility
js/ai/local_group_manager.js - Projectile combat → Entity pools: deactivates shots
js/sim/fire.js - Projectile combat → Combat mechanics: uses mechanics
js/sim/fire.js - Projectile combat → Audio: plays effects
js/sim/fire.js - Vehicle state → Occupancy grid: reads cells
js/sim/vehicle.js - Vehicle state → Simulation loop: delegates movement
js/sim/vehicle.js - Shared config → Definition registry: looks up data
js/config.js - Game pack → Definition registry: reads rules
js/defs/gamePack.js - Game pack → Sense index: supplies teams
js/ai/senseIndex.js - Inventory → Shared config: resolves items
js/player/inventory.js - Inventory → Combat mechanics: checks shields
js/player/inventory.js - Game interface → Unit visuals: uses visuals
js/ui/play/panels.js - Unit visuals → Inventory: reads equipment
js/view/unitVisual.js - Unit visuals → Asset requests: loads art
- Audio → Asset requests: fetches audio
js/audio/sfx.js - Simulation loop → Rendering: renders state