This game engine is a personal project I'm working on to learn more about game development and C++. It is currently designed to run 2D games and aims to provide a simple yet powerful framework for building interactive applications.
This project requires cmake, GLEW, clang and llvm to be installed on your system for proper functionality.
- macOS:
brew install cmake glew llvm
echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile
export PATH="/usr/local/opt/llvm/bin:$PATH"- Linux:
sudo apt-get update
sudo apt-get install build-essential libgl1-mesa-dev libglew-dev clang llvm
sudo snap install cmake --classic- Windows: Manual installation required, follow the links above to do so.
git clone --recursive https://github.com/AntoineBastide47/GameEngine.git
git submodule update --init --recursiveBuild the command-line interface (CLI) to manage the engine and projects:
cd ./tools/CLI
cmake -B build
cmake --build build
cd ../..Run the CLI with:
./engine-cliBuild the engine tools to make sure all it's features work correctly:
./engine-cli --build-tools./engine-cli --buildTip: Add the argument true after the build command to also build the release mode library for production builds.
./engine-cli --build-engineTip: Add the argument true after the build command to also build the release mode library for production builds.
./engine-cli --build-editorTip: Add the argument true after the build command to also build the release mode executable for production builds.
./engine-cli --build-sdk- Build the engine with all configurations:
./engine-cli --build true- Compress the
SDK/folder:
zip -r EngineSDK.zip SDK- Rename the zip file if desired, then distribute it.
cd ./tools/CLI && cmake -B build && cmake --build build && cd ../..
./engine-cli --build-tools --build true --build-sdkFor a list of available commands:
./engine-clior
./engine-cli --helpMake sure the whole engine is built, then open the SDK folder in the terminal and run:
./engine-cli --create-project- Navigate to your game folder:
cd your/game/folder/location- Build and run the game
./engine-cli --build-project debug --runTip: Replace debug with release for production builds.
To profile your project:
- Build and run with profiling enabled:
./engine-cli --build-project profile --run- After the run completes, a file named
profilerwill be generated in the root directory of your project. - Manually open Chrome and navigate to
chrome://tracingby typing it in the address bar. - Drag and drop the
profilerfile onto the tracing window to view the profiling results.
GameEngine/
├─ Editor/ # Editor GUI application
│ └─ (include|src)/ # Editor source code (headers|source) respectively
├─ Engine/ # Engine source code and CMake config
│ ├─ Assests/ # Empty but required for CMRC to work
│ └─ (include|src)/ # Engine source code (headers|source) respectively
│ ├─ Engine/ # All engine code non-specific to 2D
│ ├─ Engine2D/ # All engine code specific to 2D
│ └─ Shaders/ # Engine defined shaders (only in the include directory)
├─ SDK/ # Generated SDK for engine distribution
├─ Templates/ # Project templates
│ └─ 2D/ # Template to create a brand new 2D game
├─ tools/ # CLI and internal development tools
│ ├─ CLI/ # engine-cli source code
│ └─ HeaderForge/ # header-forge source code
├─ vendor/ # Third-party libraries
├─ CMakeLists.txt # Top-level build configuration
├─ engine-cli # CLI tool to manage the engine and projects
└─ header-forge # Tool for header parsing to generate reflection code
- Rendering Engine: Efficient rendering of sprites and textures.
- Entity Management: Handles entities and their components.
- Input Handling: Supports keyboard, mouse, and gamepad input.
- Physics Engine: Provides rigid body dynamics and collision responses.
- CPU based Particle System: Configurable particle emitters with control over lifetime, velocity, and color transitions.
- Simple Profiler: Captures timestamped CPU events and exports them to a trace file compatible with Chrome’s chrome://tracing viewer for performance analysis.
- 2D Camera System: orthographic camera and follow-camera modes with zoom, pan, rotation and shake support.
- Animator: Data-driven 2D animation system supporting transitions, conditions, triggers, and parameterized state machines.
- JSON Library: JSON library mirroring python/javascript json usages and a very fast DOM parser
- Scene Management: Create runtime scenes, Save scenes to json files and Load scenes from json files
Note
For planned updates and upcoming features, see the Trello Board
Check out simple example games using the engine here: Test Games
Warning
The game code is subject to be completely rewritten as the engine develops.
Versions are currently formatted as follows: [major].[feature].[patch].[beta] (e.g., 1.2.3)
- Major Version: Significant updates or breaking changes.
- Feature Count: Incremented with each new fully implemented feature or when enough smaller patches were made.
- Patch Version: Minor updates, bug fixes or small additions.
- Beta Version: Preliminary releases that may be unstable. Read the commit description before using.
Versioning Examples
0.1.0:Game loop and texture rendering.0.1.1:Keyboard Input System.0.2.0:Input System.0.4.0.1:ReadMe update1.0.0:First release of the engine.
- Title: Brief description (e.g., "Version 0.5.2").
- Description: Overview of changes made.
For detailed commit history, see the Changelog.md.
Releases will begin with version 1.0.0 and will be available for Windows, macOS, and Linux.
Feel free to fork and modify the engine. After making changes:
- Rebuild the engine.
- Rebuild and run your game to link the updated engine.
Important
- Naming conventions are not standardized yet; expect changes.
- APIs may change significantly as the engine evolves.
- The build pipeline may be updated, so check the changelog for major changes.
Warning
The engine is not backwards compatible to avoid increased binary size and potential performance issues.
Warning
The engine is primarily developed on macOS. Linux and Windows support may be limited until version 1.0.0 is released.
Contributions are welcome. As this is a personal learning project, contributions may not be merged immediately. Fork the repository and experiment freely.
- C++ Mastery: Improve modern C++ skills.
- Game Development: Learn the fundamentals of game engine design.
- Software Architecture: Apply design patterns and architectural principles.
- Project Management: Gain experience in planning, versioning, and documentation.
This project is licensed under the Apache License Version 2.0.
The following references include a collection of articles and videos that have served as the foundation for building my engine (the list will evolve over time):
- OpenGL, Particle System: Learn OpenGL
- Physics Engine: Two-Bit Coding - Let's Make a Physics Engine
- Profiler: The Cherno - Game Engine
Important
These resources are guides. They provide insights but may not result in an identical engine implementation.