Dusk
3 minute read
Documentation in progress
Dusk is a WIP 3D Game engine.
It is a personal project I started back in May 2021 with the intention of learning more about how a game engine functions under the hood, as well as C++ & 3D rendering.
I stopped working on Dusk regularly in July 2023 to focus on other projects.
This serves as a one-page documentation, breaking down Dusk’s systems - how and why I implemented them.
Overview
TODO
Project Structure
Dusk is divided into 3 main modules, the engine, the editor and the runtime.
They are located at the root level of the project, and the dependencies inside the dependencies folder.
The engine is compiled as a static lib, which is linked to the editor and runtime executables. The dependencies are all static libs, some required by the engine (in essence, required by both the editor and runtime) or just the editor/runtime.
Every dependency is a submodule maintained separately. The majority of them are forks, with my build system scripts and some changes on top to tailor them to my engine. The ones that are header-only are just a regular submodule of the original repository.
The dependencies are as follows:
Engine: (required by both editor and runtime):
- glfw - Windowing, Input & Events
- glew - OpenGL bindings
- glm - Math
- spdlog - Logging
- entt - Entity Component System
- yaml-cpp - YAML parser
- stduuid - UUID generation
- rttr - Reflection
- lua - Lua language for scripting
- sol2 - Lua C API bindings
- zstd - Compressing
Editor:
- DuskEngine
- ImGui - GUI
- ImGuizmo - ImGui guizmo widget
- stb - Image importer
- cgltf - gltf importer
Runtime:
- DuskEngine
- ImGui - GUI (Depending on target)
Because the editor has all its dependencies statically linked and its assets embeded in the source code, it is distributed as a single binary, which was something I wanted to achieve for simplicty’s purpose. No complicated install process, just get the binary and run it.
The runtime is also distributed as a single binary with all game assets (textures, scripts, models) by its side. I am currently in the process of condensing all of these into a single binary blob for even easier distribution of a game.
Build System
Dusk uses premake as its build system.
Premake can generate project files for multiple toolsets, namely MSVC and gcc. It’s scripts are written in lua.
At the root of the project sits a premake file which includes all modules and defines some global configurations (targets, output dir, intermediates dir, etc).
Each module of the project has its own premake script with details pertaining to type of binary, pch, include directories, linking, preprocessor, pre- & post-build commands, platform specific configurations, among others.
To generate project files, run premake
at the root level with the respective command for your toolset.
E.g. premake vs2022
or premake gmake2
. Then just compile and run.
Systems
Rendering
TODO
Editor
TODO
Asset Management
TODO
Asset Importing
TODO
Scripting
TODO
Other
TODO
Resources
Collection of some of the resources I used.
Youtube
- The Cherno
- Game Engine Series
- OpenGL Series
- Dev Logs
- and so many more…
- Jamie King - OpenGL
Blogs
Repositories
Books
Discord
Screenshots
TODO