Ivy is a C++ 2D Game Engine primarily focused on developing Roguelike games.
Currently Windows x64 is the only supported platform.
Features:
- Custom Entity-Component-System (ECS)
- Event System
- Scripting System
- OBB Collision Detection
- OpenGL Rendering
- Procedural Environment Generation
- Immediat Mode GUI.
- Clone the repository using
git clone --recursive https://github.com/ErvinCs/ivy-game-engine
to fetch all the required submodules. - Run
git submodule update --recursive --remote
to update the submodules to their required versions - Run the
ProjectGenerator.bat
batch file to generate a Visual Studio 2017 project. - Set
IvyApplication
as the startup project.
Project files for Visual Studio 2017 are generated using Premake5. If you wish to use a different IDE make sure to check these files and update them accordingly.
(Note: The AngelScript module has a number of readily available project files at IvyEngine\vendor\angelscript\projects
).
An Application on top of the engine is required to define a class that derives from Ivy::Application
and a class that derives from Ivy::SortingLayer
. An additional function that returns the newly created Ivy::Application
instance is also required.
An example application is provided in the IvyApplicationExample
project.
Note that having spaces in the project name of the IvyApplication might trigger error MSB3073.
IVY_CORE_[LEVEL]
macros while application operations are logged using IVY_[LEVEL]
macros. The logger settings are available in IvyEngine/Core/Logger.h
.
Input Handling & Window Manipulation for Windows are performed through the GLFW3 library. The source code is available in the Windows package.
The engine implements Contexts, Index Buffers, Vertex Buffers, Vertex Arrays, Shaders & Textures.
Commands are issued to the Renderer through the use of RenderCommands. The engine also provides a single Orthographic Camera which can be manipulated by the CameraSystem accessed through the GUI.
Additional functionality is added to the renderer by the Stb and GLM libraries.
Systems:
- CameraSystem
- ScriptSystem
- RenderSystem
- CollisionSystem
- CollidableGizmoSystem
Components:
- Collidable (Oriented Bounding Box)
- Renderable
- ScriptComponent
- Tag
- Transform
Components are aggregated in packed-arrays to maximize cache performance.
Additional Components and Systems can be added by the user as long as they derive from the Component and System class respectively. We provide the UserComponent
as an example for user-defined components.
Note that in order to be able to import/export newly defined components the appropriate functions have to be implemented and registered with the JSONManager
.
(We recommend taking a look at the json-nlojmann library for more information).
The GUI is implemented using Dear ImGui. It provides easy access to creating, deleting and modifying entities and components.
IvyApplication/scripts
.
Currently the types the script engine is registered with are the following:
- Vec2
- Transform
- Renderable
- Collidable
- ScriptableObject
The ScriptComponent mentioned above merely encapsluates a ScriptableObject such that it can be managed by the ECS.
To create a new script it suffices to create a new .as
file and place it in the scripts folder. Script classes should #include 'common.as'
and provide a constructor. The onUpdate
and onMessage
methods can be implement to specify behavior.
Note: The LevelGenerator class is responsible for actually instantiating the game objects and should be implemented per project.
- Sound System
- Animation System
- Multi-threading support
- More Gizmos
- More Collidable Types
- Support for multiple components of the same type per Entity
- Layered Rendering
- Multiple Graphics API Support