Architecture#
Source codetext
- ECS: entities are IDs, components are plain data, and systems iterate over the components they need.
- Fixed timestep: simulation runs at a fixed rate with an accumulator, separate from rendering, so physics behaves the same at any frame rate.
- Collision: AABB overlap tests with resolution along the axis of least penetration.
- Event bus: subsystems publish and subscribe to messages instead of calling each other directly.
- Lua scripting: gameplay behaviour lives in Lua scripts bound to entities, so it can change without recompiling the engine.
Challenges
- Designing the C ↔ Lua binding layer
- Memory ownership across subsystems in C
The hardest part so far was developing the how Lua interacts with the engine. As of right now, I’ve designed the engine with pre-defined functions that allow you to make changes to the scene.
My vision for the future is to provide enough pre-defined functions that users will be able to make their own functions that do even more than what I provide.
Build: CMake + vcpkg (SDL2, Lua), targeting Windows / MSVC.