Mylly Game Engine is a lightweight and minimalistic game engine written entirely in C.
At its current state, Mylly is a 3D rendering framework with a collection of utilities for game development (e.g. AI and 3D audio). Currently Mylly does not handle physics, nor is there a plan to add an extensive physics component into the engine in the near future (other than perhaps some raytracing or similar utilities).
Mylly engine is developed a few core principles in mind:
- Lightweight and quick to compile
- Consistent and clean C API
- Compatibility with low-end machines
Several ideas for the future include:
- Taking advantage of high-end hardware with a Vulkan renderer (OpenGL would become a minimal legacy renderer)
Deferred lighting- More advanced scene graph (utilizing quad/octrees, BSPs etc.) allowing renderer optimizations
- Better memory allocators (for persistent and per-frame data)
- Shadows, shadow mapping
- Advanced post-processing effects (Bloom, HDR, SSAO)
- Physically based rendering (PBR)
- Hardware accelerated particles (PBR) and image based lighting (IBL)
- Physics engine integration (e.g. Box2D for 2D, Bullet for 3D physics)
The project is structured as follows:
mylly
├── engine
├── external
└── test
- engine contains the code of the engine library. More detailed information about the structure of the engine itself can be found in the folder itself.
- external contains the 3rd party libraries used in the development of the engine (with the exception of OpenGL). See Dependencies below.
- test contains the unit testing suite for the engine.
The development of the engine is not tied to any IDE or compiler, and CMake is used to manage the build process. See the example game repository for an example build process and project hierarchy.
Performance is an important factor, because even a good game is not fun if it lags too much. For profiling valgrind is a very useful tool. Use the command below to start the profiler:
valgrind --tool=callgrind ./build/bin/mylly.bin
Run the game for a brief while and exit it. This creates a log file callgrind.out.XXX
which can then be opened with kcachegrind and analyzed:
kcachegrind callgrind.out.XXX
A unit test framework (MinUnit) is set up for testing the core components of the engine and for ensuring there aren't any unforeseen consequences from future changes. The testing suite is set up in ./test/.
The testing suite is currently very underutilized, and will hopefully be in more active use in the future.
The engine uses OpenGL for rendering by default, so OpenGL development libraries and headers are required for development. In addition several 3rd party libraries are required by the engine. These are added to the repository as submodules.
- cglm is a C99 compatible 3D graphics math library
- JSMN is a minimalistic JSON parser
- MinUnit is a minimal unit testing framework
- dr_libs is a collection of single-file libraries for audio file decoding
Dependencies installed separately:
- OpenGL
- libpng for loading PNG encoded textures
- libjpeg for loading JPEG compressed textures
- FreeType for rendering fonts
- OpenAL Soft for audio rendering