How athindram/summoners-sim works
Summoner’s Sim is a desktop physics simulator for champion battles. The main loop loads champion definitions, creates Darius and Garen, advances movement, collisions, combat, regeneration, and abilities on a fixed timestep, then draws the fighters, ability effects, stats, and result. Pressing R resets the fight. The graph separates champion data and abilities from simulation and rendering. The excerpts show the main orchestration and champion registration; some implementation details of ability dispatch, combat, and physics were not shown, so those internal call relationships are omitted.
Main entry points: main.cpp Battle Loop · champion_defs.cpp Champion Registry · darius.h Darius Passive · combat.cpp Combat Rules
Components 10
Application
- Battle Loop
src/main.cpp
Champion Model
- Champion Registry
src/champion_defs.cpp - Fighter State
src/champion.h - Ability Framework
src/ability.cpp - Darius Passive
src/champions/darius.h - Garen Passive
src/champions/garen.h
Battle Simulation
- Movement Physics
src/physics.cpp - Combat Rules
src/combat.cpp
Presentation
- Stats Panels
src/ui.cpp
Other components
- Player
Connections 10
- Player → Battle Loop: starts or resets
src/main.cpp - Battle Loop → Champion Registry: loads fighters
src/main.cpp - Battle Loop → Fighter State: creates and draws
src/main.cpp - Champion Registry → Darius Passive: registers passive
src/champion_defs.cpp - Champion Registry → Garen Passive: registers passive
src/champion_defs.cpp - Battle Loop → Movement Physics: advances collisions
src/main.cpp - Battle Loop → Combat Rules: ticks combat
src/main.cpp - Battle Loop → Ability Framework: ticks and draws
src/main.cpp - Battle Loop → Stats Panels: draws stats
src/main.cpp - Darius Passive → Combat Rules: deals bleed damage
src/champions/darius.h