"Write my own game engine (wmoge)" is a modern high-performance 3d graphics game engine with Vulkan and OpenGL backends. The idea of the project is to implement a self-sufficient, small, but featured engine and a number of 2d and 3d games using it. Primary focus is the core architecture of the engine, reliability, clean and performant code. Currently, the work is focused on a minor refactoring, new runtime scene representation, building a high-level rendering system, refactoring audio, scripting systems, and bringing physics support. The engine is a personal learning/hobby project for educational purposes only.
- Project C/C++ and Python documentation: egororachyov.github.io/wmoge
- Current progress and task page: github.com/EgorOrachyov/wmoge/issues.
- Contributing guide: github.com/EgorOrachyov/wmoge/blob/main/CONTRIBUTING.md
- Source code: github.com/EgorOrachyov/wmoge
- π₯οΈ Platform-agnostic, with support for common operating systems such as Windows, Linux and macOS.
- π¨ Moder C++17 based engine with clear architecture.
- π¨ Full runtime reflection system (RTTI) with class, method and property information.
- ποΈ Task manager and task graph support for concurrent execution.
- ποΈ Custom async (future & promise) implementation with join, notify and continuation.
- ποΈ Extendet set of containers, with buffered vector, flat maps, sets, etc.
- β Command line and hook system to build custom tools.
- β Simple stack-based config system.
- β Dependency injection and IoC container system for global managers.
- π₯ Higl-level render dendency graph (RDG) for scheduling GPU rendering and compute work.
- π₯ Modern graphics (gfx) device interface for GPU driver communication.
- π₯ Explicit command list and resource bariers management in gfx api.
- π₯ Vulkan-based gfx device backend.
- π₯ (future) OpenGL-based gfx device backend.
- π₯ (future) DX12-based gfx device backend.
- π¨ Custom shader files syntax support to write any shaders with rich features.
- π¨ Automated fast runtime shaders reflection generatiom.
- π¨ Automated shaders layout creation, compilation and reloading.
- π¨ Built-in GLSL shader compiler for online compilation.
- π¨ Hot-reloading of shaders at runtime.
- π¨ Compiled shaders runtime and offline cahce to speed-up loading.
- π¨ Gpu pipelines runtime and offline cache to speed-up rendering.
- π¦ Async resource-loading system with runtime cache.
- π¦ Unified resources handling, meta-information, support for external formats through custom loaders.
- π¦ Yaml and binary serialization support.
- π¦ LZ4 compression and decompression for fast assets loading.
- π¦ Gpu texture compression into BCn (1-7) format for faster loading, rendering and lower memory usage.
π °οΈ Custom math library with 2d and 3d-space primitives.π °οΈ (future) SIMD utilities for fast vectorized math.- 𧱠Ecs-based scene model with fast, parallel and memory-friendly update.
- π§ (in progress) OpenAL audio renderer for playing game sounds.
- π (in progress) Modern Lua scripting backend for game logic programming.
- π Built-in CPU performance and tasking profiling with support for custom labels and metadata.
- π Built-in GPU performance profiler for separate GPU queues / command lists.
- π CPU & GPU trace collection with support to google trace exporting.
- π Debug GPU labels objects and events for RenderDoc captures.
- π In-game dev console with support for console commands and console variables.
- Windows 10 (tested on Windows 10).
- Linux-based OS (tested on Ubuntu 20.04).
- macOS (tested on 10.14 Mojave).
- assimp for geometry, material and scene assets importing into engine.
- audio file for simple audio loading from wav files.
- base64 for base64 encoding/decoding in text serialization.
- compressonator texture compression library.
- cxxopts for command-line options processing.
- dynalo for cross platform dynamic loading of shared libraries.
- filewatch for OS file system events tracking.
- freetype for true-type fonts loading and rendering.
- glfw for cross-platform window and input management.
- glslang for runtime glsl to spir-v shaders compilation.
- lua project C source with cmake script for scripting.
- lua bridge to simplify lua and C++ bindings.
- lz4 for fast compression and decompression at runtime.
- magic enum for static enum reflection.
- openal soft as a software audio renderer.
- rapidyaml for fast yaml files parsing and serialization.
- robin hood hashing for fast & memory efficient hashtable.
- sha256 for sha256 hashes computation.
- stbimage image utilities for images loading, writing and resizing.
- svector compact SVO optimized vector for C++17 or higher.
- tinyxml2 for utf-8 xml files processing.
- vma vulkan library for memory allocation.
- volk meta loader for vulkan API.
- whereami for executable location extracting.
- yamc for faster mutual-exclusion and MT synchronization.
- zlib for files compression (required for assimp and freetype).
- Refactoring the Mesh Drawing Pipeline for Unreal Engine 4.22
- Mesh Drawing Pipeline | Unreal Engine 4.27 Documentation
- Creating a Custom Mesh Component in UE4
- Master Class: The CRYENGINE Rendering Pipeline
- Master Class: In-Depth Guide to Working with Particle Effects in CRYENGINE
- Master Class: How to assign Game Inputs through Actionmapping in CRYENGINE
- Master Class: Comprehensive Guide to Working with Audio in CRYENGINE
- Master Class: Art Asset Pipeline, PBR Texture Mapping in CRYENGINE
- ECS Scripting of Alan Wake 2
- HypeHype Mobile Rendering Architecture
- Creating a Tools Pipeline for Horizon: Zero Dawn
- The Future of Scene Description on 'God of War'
- The Indirect Lighting Pipeline of 'God of War'
- A Context-Aware Character Dialog System in The Last of Us
- Parallelizing the Naughty Dog Engine Using Fibers
- Deferred Lighting in Uncharted 4
- GPU Driven Effects of The Last of Us Part II by Artem Kovalovs || SIGGRAPH 2020
- Volumetric Fog of The Last of Us Part II by Artem Kovalovs || SIGGRAPH 2020
- Game Engine Architecture, Third Edition
- Learn OpenGL
- Vulkan Tutorial
- Common:
- Git (to get source code)
- CMake (the latest version)
- Ninja (as build files generator)
- Python 3.7+
- Windows 10:
- Microsoft Visual C++ Compiler (MSVC) with C++ 17 support
- x64 Native Tools Command Prompt for VS
- Ubuntu 20.04:
- GNU C++ Compiler with C++ 17 support
- MaΡOS Catalina 10.15:
- Clang Compiler with C++ 17 support
The following code snippet downloads project source code repository, and enters project root folder. Must be executed from the folder where you want to locate project.
$ git clone https://github.com/EgorOrachyov/wmoge.git
$ cd wmoge
Attention! On Windows platform building commands must be executed in
x64 Native Tools Command Prompt for VS
.
The following code snippet runs build.py
script, which allows configuring cmake and running of actual build with
selected options. You can specify build directory, build type, number of system threads for build.
Must be executed from project root folder.
$ python ./build.py --build-dir=build --build-type=Release --nt=4
On macOS, you can optionally specify target binaries architecture to build. Pass option --arch
with x86_64
or arm64
respectively. By default, build falls back to CMAKE_SYSTEM_PROCESSOR
specified architecture.
See example bellow, replace <arch>
with desired architecture for your build. Must be executed from project root
folder.
$ python ./build.py --build-dir=build --build-type=Release --nt=4 --arch=<arch>
In order to run a template project demo, execute following command to start demo game executable. The
optional root_remap
argument tells engine where its root directory with all config files and resources is located. In
our case the template directory will be used as a root.
$ build/template/template.exe --root_remap="template/"
If you want to fix code or tutorial text issue, add new functionality, or even new tutorial step, feel free to contribute to the project following contributing guide and code of conduct.
This is a personal learning project. It does not claim to be the ultimate guide to building real AAA game engines. However, it can be useful for those who, like me at the time, want to learn something more than the basics and do something on their own. This project accumulates ideas and knowledge from several books and can be a good starting point for learning!
If you have any questions, feel free to contact me at egororachyov@gmail.com
. If you have any ideas, questions, how to
make or improve something, please, do not hesitate to open new issue or pull-request inside this project. I will try to
respond as soon as possible to them.
- Egor Orachyov (Github: @EgorOrachyov)
@online{wmoge,
author = {Orachyov, Egor},
title = {Wmoge: High-performance 2d and 3d game engine with Vulkan and OpenGL backends},
year = 2023,
url = {https://github.com/EgorOrachyov/wmoge},
note = {Version 1.0.0}
}
Entry | Description |
---|---|
π .github |
CI/CD scripts and GitHub related files |
π docs |
Additional project documents and resources |
π deps |
Third-party project dependencies, stored as is |
π engine |
Engine sources code, shaders, config, plugins sources |
π template |
Template project which can be used as a base for a game |
π games |
Example games created with engine |
π CMakeLists.txt |
CMake configuration, add as sub directory to your project |
π build.py |
Script to build project sources and examples |
MIT License
Copyright (c) 2023 Egor Orachyov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.