Engine design document
This is a rough sketch of the final engine. Treat this as some type of "this is how a 1.0 will look".
Entries marked with β are mostly or fully complete (are used widely throughout the engine and plugins), and π means this area needs quite a bit of work before it's usable or it's simply not implemented.
Overall architectureβ
- Elegy.Common - utility library β
- Elegy.Framework - engine core, handles engine configuration etc. β
- Engine modules
- Elegy.GameSDK - the game SDK π
- Elegy.ECS - reactive entity component system library π
- Elegy.Scripting - dynamic C# scripting library π
- Elegy.RenderBackend - Veldrid/Vulkan utilities β
Engine modulesβ
- Elegy.AssetSystem β
- Quake 3-style materials β
- Data-driven shaders β
- Model asset loading (plugin-based) β
- Texture asset loading (plugin-based) β
- Level loading (plugin-based) β
- Elegy.AudioSystem (plugin-based)
- Sound sources, listener
- Sound FX
- Geometric acoustics
- Elegy.ConsoleSystem π
- Logging β
- Console frontends β
- External developer console π
- CVars π
- Console commands β
- Elegy.FileSystem β
- Mounting game/mod paths β
- Mounting addon paths π
- Elegy.Input β
- Keyboard, mouse input β
- Gamepad & joysticks π
- Elegy.NetworkSystem
- Utility layer on top of ENet or RiptideNetworking
- Elegy.PlatformSystem β
- Windowing (injected) β
- Time π
- Fundamental engine configuration, e.g. headless mode β
- Elegy.PluginSystem β+π
- Flexible plugin system β
- Plugin dependencies π
- Plugin reloading π
- Plugin versioning π
- Elegy.RenderSystem π
- Renderable objects (entities, batches, volumes, lights...) β
- Views & rendering into windows β
- Debug rendering π
- Render styles (plugin-based) β+π
Legend:
- plugin-based: implemented in a plugin, engine just provides API
- injected: implemented externally (e.g. in a launcher), engine just sees API
Elegy.GameSDK subsystemsβ
- AI
- Goal-oriented action planning
- Use Recast/DotRecast
- Animation
- Animation playback and management
- Animation blending
- Animation channels
- Inverse kinematics
- Client π
- Client controllers (handle input and interaction with the game world) β
- Keybind system
- View bobbing and viewport management
- Entity system β
- Reactive ECS β
- Source-style IO β
- Scripting π
- Game sessions β
- Menu state, loading state, playing state, paused state etc. β
- Linking a client into the game β
- Gamemodes
- Campaign, deathmatch, team deathmatch, co-op etc.
- Netcode π
- Mainly intended for LAN co-op
- Quake-style client-server with prediction and rollback π
- Singleplayer bridge β
- Particles
- Physics
- Rigid bodies
- Constraints
- Save-load system
- UI
- ImGui for quick'n'easy stuff
- Custom game UI system for everything else
Optional modules:
- Vehicle system
- Vegetation system
- Virtual reality through OpenXR
Workflow and featuresβ
Overall:β
- Quake-style workflow.
- Thereβs an engine executable in the root folder, accompanied by game folders and a base folder.
- The base folder contains base engine assets, e.g. a βmissing modelβ model, a βmissing textureβ texture and whatnot.
- Each game/mod folder contains a configuration file that describes it as well as its plugins and dependencies.
Mapping:β
- Youβd use an external level editor like TrenchBroom, J.A.C.K. or NetRadiant-custom.
- Youβd also use a map compiler, either as part of your level editorβs compile config, or through a console command.
Modelling:β
- Youβd use a model editor like Blender.
- Export GLTF for basic props, import via custom tool for extra attributes for complex models.
Texturing, sound design and other trivial asset types:β
- Quite simply place your PNGs/WAVs/FLACs into a textures/sounds folder, itβs just there.
UI:β
- Declarative C# UI files sitting in a directory.
Scripting:β
- Naked C# scripts, S&box-style.
- Level scripts
- UI scripts
- NPC scripts?
- Weapon scripts?
- Vehicle scripts?