How jdtrepanier/kakistocracy works
Kakistocracy is a browser-based satirical term-survival simulation. The player starts a run, takes executive actions and navigates monthly resolution, reports, and eventual endings; city driving, room exploration, and tactical battles provide distinct gameplay branches. The graph emphasizes the app’s screen router, Zustand game state, simulation engine, and domain data. Several subsystem links rely on the SOURCE INDEX or README because their implementation excerpts were not provided; those links are dashed where the runtime relationship is not directly shown.
Main entry points: gameStore.ts Game state · App.tsx Screen router · CityScreen.tsx City screen · BattleView.tsx Battle display
Components 26
Game interface
- Screen router
src/App.tsx - Intro screen
src/ui/screens/IntroScreen.tsx - Game screen
src/ui/screens/GameScreen.tsx - City screen
src/ui/city/CityScreen.tsx - Month report
src/ui/screens/MonthEndReport.tsx - Ending screen
src/ui/screens/EndingScreen.tsx - Status HUD
src/ui/hud/Hud.tsx - Battle display
src/ui/battle/BattleView.tsx
Run orchestration
- Game state
src/store/gameStore.ts
Simulation engine
- Action resolution
src/engine/resolve.ts - Monthly economy
src/engine/economy.ts
World and encounters
- Tactical battle
src/engine/battle.ts - Grid movement
src/engine/movement.ts - Driving rules
src/engine/driving.ts - Pedestrian behavior
src/engine/pedestrians.ts
Game content
- City map
src/data/cityMap.ts - Executive actions
src/data/actions.ts - Balance data
src/data/balance.ts - Battle maps
src/data/battlegrounds.ts - Battle rosters
src/data/battleRosters.ts - Characters
src/data/characters.ts - Driving data
src/data/driving.ts - Translations
src/i18n/translate.ts - English strings
src/i18n/en.ts - French strings
src/i18n/fr.ts
Other components
- Player
Connections 31
- Player → Screen router: plays
README.md - Screen router → Intro screen: routes to
src/App.tsx - Screen router → Game screen: routes to
src/App.tsx - Screen router → City screen: routes to
src/App.tsx - Screen router → Month report: routes to
src/App.tsx - Screen router → Ending screen: routes to
src/App.tsx - Screen router → Game state: reads state
src/App.tsx - Screen router → Status HUD: renders
src/App.tsx - Intro screen → Game state: updates run
src/ui/screens/IntroScreen.tsx - Game screen → Game state: dispatches actions
- City screen → Game state: updates city play
src/ui/city/CityScreen.tsx - Game state → Action resolution: resolves actions
src/store/gameStore.ts - Game state → Tactical battle: advances battle
src/store/gameStore.ts - Game state → Monthly economy: ticks month
src/store/gameStore.ts - Game state → Executive actions: gets action
src/store/gameStore.ts - Game state → Balance data: gets balance
src/store/gameStore.ts - Game state → Battle maps: gets map
src/store/gameStore.ts - Game state → Battle rosters: gets roster
src/store/gameStore.ts - Action resolution → Balance data: uses balance
src/engine/resolve.ts - Monthly economy → Balance data: uses balance
src/engine/economy.ts - Tactical battle → Grid movement: checks tiles
src/engine/battle.ts - Battle display → Game state: reads battle state
src/ui/battle/BattleView.tsx - Battle display → Tactical battle: renders battle
src/ui/battle/BattleView.tsx - Battle display → Battle maps: renders map
src/ui/battle/BattleView.tsx - Battle display → Characters: renders units
src/ui/battle/BattleView.tsx - City screen → City map: loads map
src/ui/city/CityScreen.tsx - City screen → Driving rules: uses driving rules
src/ui/city/CityScreen.tsx - City screen → Pedestrian behavior: updates pedestrians
src/ui/city/CityScreen.tsx - City map → Driving data: uses map data
- Translations → English strings: selects language
src/i18n/translate.ts - Translations → French strings: selects language
src/i18n/translate.ts