Hot Reload
make dev enables live code reloading for all files in game_logic/. Edit any .cs file, save, and the changes take effect immediately — no restart required.
How It Works
The engine splits C# into three assemblies:
A FileSystemWatcher monitors game_logic/ for .cs changes. On save:
- All
.csfiles ingame_logic/are auto-discovered and recompiled into a newGameLogic.dll - The new assembly is loaded via reflection
- The world is fully reset — all entities are despawned (with native renderer cleanup), component stores and systems are cleared, and all 8 light slots are cleared
Game.Setup(world)is re-invoked from the new assembly, rebuilding the entire scene
This means any game logic change takes effect immediately:
- New or removed entities in
Game.cs - Changed light types or positions
- Updated constants in
GameConstants.cs - Modified system logic in
systems/*.cs - Re-ordered system registration
Usage
Then edit any file in game_logic/ and save. The console will show:
Limitations
- Only
game_logic/files are hot-reloadable. Engine changes inmanaged/require a restart. - Old assemblies leak memory (Mono cannot unload assemblies). Restart after many reloads.
- Static fields in
systems/*.csandGameConstants.csvalues reset on each reload. make runandmake appare unaffected — they compile everything into a singleViewer.exewith no hot reload code.