DYEngine is a WIP 2D game engine (with the possibility of 3D rendering).
DYEngine is divided into 2 sub-project modules:
- DYEngine: The core of the game engine. It includes everything you need to make a code-only game.
- DYEditor: It provides the ECS object model using entt & an editor on top of that for editting scenes & entities. It comes with a code generation tool for generating type information of user-defined components & systems for editor type registry. The module is still in an very early stage.
Right now I am using CLion to configure & build the project. Therefore, building with CLion is the fastest and the most stable way to build the project.
In order to support multiple compilers, I had to include two versions of SDL2: MinGW & MSVC versions, which I downloaded from SDL2 repository.
I did some reorganizations to the SDL2 folders so whether you use MinGW or MSVC (both cl.exe and clang-cl.exe) to compile, the build system will still be able to find the correct version of library to link.
Most of the following tools come with CLion as bundles
- IDE: CLion (CMake 3.17+)
- Tested Compilers:
- GNU 11.2.0 (MinGW)
- MSVC 19.34.31937.0
- Clang 15.0.1 (MSVC compatible)
Once you have all of the above installed, you can build and run the Sandbox configuration in CLion directly.
How to CMake Good - 0c - Using Visual Studio
- Use the root CMakeList.txt to generate a visual studio solution in the build folder.
- cmake -G "Visual Studio 17 2022" -B "build"
- Open the generated visual studio solution file.
- Set
Sandbox_Editor
(orSandbox
) as the Startup Project. - Build.
- Copy the correct SDL2 dll from DYEngine/extern/SDL2 folder into the executable folder based on your target architecture. For instance if you are building for x64, then you copy the dll file in
DYEngine\extern\SDL2\MSVC\lib\x64
. - Run the executable and you will see the Sandbox app running properly.
Build with CMake, Ninja (as the generator), and Visual C++ (cl.exe as the compiler) OR Clang with MSVC-like command-line (clang-cl.exe as the compiler)
How to CMake Good - 0d - Visual C++ without Visual Studio
Similar to the Visual Studio, but you don't have to open the solution file in the Visual Studio. Everything can be done in the terminal.
- Start the Visual Studio Developer Command Prompt in the terminal by running the vcvarsall.bat that's included the Visual Studio build tools.
# The path could be different depending on where you install Visual Studio # Specify the target architecture as the first argument (x64 in our case). - "C:\<path-to-visual-studio>\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
- Use the root CMakeList.txt to generate a visual studio solution in the build folder using Ninja as the generator and cl.exe as the c/cpp compiler:
You can also use clang-cl as the compiler:
- cmake -G Ninja -B "build" -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl
- cmake -G Ninja -B "build" -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl
- Build the project with the following command:
- cd build - ninja Sandbox_Editor # or Sandbox
- Run the executable and you will see the Sandbox app running properly.
How to CMake Good - 0d - Visual C++ without Visual Studio
Similar to the Visual Studio method, but you don't have to open the solution file in the Visual Studio. Everything can be done in the terminal.
- Start the Visual Studio Developer Command Prompt in the terminal by running the vcvarsall.bat that's included the Visual Studio build tools.
# The path could be different depending on where you install Visual Studio # Specify the target architecture as the first argument (x64 in our case). - "C:\<path-to-visual-studio>\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
- Use the root CMakeList.txt to generate a visual studio solution in the build folder with the following command:
- cmake -G "Visual Studio 17 2022" -B "build"
- Build the project with the following command:
- cmake --build "build" --target Sandbox_Editor # or Sandbox
- Copy the correct SDL2 dll from DYEngine/extern/SDL2 folder into the executable folder based on your target architecture. For instance if you are building for x64, then you copy the dll file in
DYEngine\extern\SDL2\MSVC\lib\x64
. - Run the executable and you will see the Sandbox app running properly.
- SDL2 (2.26.5)
- glad
- glm
- stb_image
- Dear ImGui
- ImGuizmo
- raudio
- EnTT: use as the main object model in DYEngine. I might implement my own ECS framework if time allows it.
- tomlplusplus: most of the custom text-based files in DYEditor will be stored as toml (i.e. scene/level files, asset meta files).
- fmt: for easier and more efficient source code generation process. Will replace it with c++ std::format library once it's widely supported by different compilers.
- OpenAL-Soft: Alternative for 3D audio. Need more research.
The project is still in a very early stage, but I am constantly working on it.
Here are some videos that might help you get the "feel" of DYEngine:
DYEngine & Editor Feature Highlights 2023
This video includes some of the features of DYEngine & DYEditor.
Main Battle Turtle
I made the game with two of my friends (Anton Sagel & Trey Ramm) during 2023 CGL Turtle Game Jam.
It's a really good opportunity to test out the game engine.
DYE Tech Demo
I've also made a small tech demo game collection with DYEngine, which you could check it out here - DYE-Tech-Demo.
Warning: the code was made within 1 week (I was crunching on it for the goal of showcasing it at our end-of-semester showcase party), so it is very dirty/unorganized.
It wouldn't have been possible to implement this project without the help of the internet!
Here are some resources that I use to make it happen! The list is non-exhaustive of course:
- Hazel engine: https://github.com/TheCherno/Hazel
- Halley engine: https://github.com/amzeratul/halley
- ...and a lot more to be added.