How ichih4yt3r/magesim-forever works
MageSim Forever is a browser-based World of Warcraft mage DPS simulator. Users configure a mage and encounter in the Vue frontend, run simulations through the WebAssembly backend, and inspect damage and timing results. The C++ runtime models the player, spells, buffs, targets, and timed events; bindings expose its simulation functionality to the frontend. The README documents the Vue/Vite and Emscripten/WebAssembly split. Frontend source was not sampled, so specific UI-to-worker and results-rendering connections are not asserted.
Main entry points: simulation.cpp Event simulation · player.cpp Mage player · bindings.h JavaScript bindings · main.cpp Native entry point
Components 20
Browser frontend
- Vue application
assets/js/App.vue - UI components
assets/js/components - Simulation UI logic
assets/js/simulation.js - Simulation worker
assets/js/sim_worker.js - Combat log integration
assets/js/wcl.js
WebAssembly interface
- WebAssembly module
public/magesim.js - JavaScript bindings
src/bindings.h
Simulation runtime
- Native entry point
src/main.cpp - Event simulation
src/simulation.cpp - Simulation state
src/state.cpp - Simulation results
src/common.h
Combat model
- Run configuration
src/config.h - Mage player
src/player.cpp - Combat units
src/unit.cpp - Spell definitions
src/spell.h - Buff system
src/buff.cpp - Encounter targets
src/target.cpp - Talents and glyphs
src/talents.h - Summoned companions
src/mirror_image.cpp
Other components
- Simulator user
Connections 26
- Simulator user → Vue application: configures and runs
readme.md - Vue application → WebAssembly module: uses compiled backend
readme.md - WebAssembly module → JavaScript bindings: exposes interface
- Native entry point → JavaScript bindings: includes bindings
src/main.cpp - Native entry point → Event simulation: uses simulation
src/main.cpp - Native entry point → Mage player: creates player
src/main.cpp - Native entry point → Run configuration: configures run
src/main.cpp - JavaScript bindings → Event simulation: references simulation
src/bindings.h - JavaScript bindings → Mage player: references player
src/bindings.h - JavaScript bindings → Run configuration: references configuration
src/bindings.h - Event simulation → Mage player: uses player
src/simulation.cpp - Event simulation → Simulation state: updates state
src/simulation.cpp - Event simulation → Spell definitions: processes spells
src/simulation.cpp - Event simulation → Buff system: processes buffs
src/simulation.cpp - Event simulation → Encounter targets: uses targets
src/simulation.cpp - Event simulation → Simulation results: returns results
src/simulation.cpp - Mage player → Combat units: extends unit behavior
- Mage player → Talents and glyphs: uses talents
src/player.cpp - Mage player → Summoned companions: creates summons
src/player.cpp - Combat units → Spell definitions: uses spell definitions
src/unit.cpp - Combat units → Buff system: manages buffs
- Simulation state → Encounter targets: stores targets
- Vue application → UI components: renders components
- Simulation UI logic → Simulation worker: dispatches simulation
- Simulation worker → WebAssembly module: runs backend
- Combat log integration → Simulation UI logic: imports combat data