Engine architecture¶
Layers¶
- Core:
Application,Registry,VirtualResolution, rendering, logging, errors. - ECS: entities, components, systems, resources.
- Plugins: bundles of components, systems, and resources behind one
Init(). - Assets:
AssetManager, bundler, project paths. - Scripting:
ScriptComponent,ScriptSystem, Lua API. - Networking: replication and multiplayer plugins on top of ENet.
- Serialization: scene and prefab files (separate module).
Where to add code¶
- New data: a component struct in
Engine/include/Components. - New behaviour: a system in
Engine/include/SystemsandEngine/src/Systems. - New feature: a plugin in
Engine/include/PluginsandEngine/src/Plugins. - New Lua binding: a module under
Engine/include/Scripting/LuaAPI.
Register components and systems in a plugin rather than in main(). Keep main() to
plugin instantiation and entity spawning.
Ordering constraints¶
HierarchyPluginbeforePositionPlugin.ReplicationPluginbeforeMultiplayerPlugin.- Systems register in dependency order; registration order is update order.