Entity-Component-System (ECS) with a focus on ease-of-use, runtime extensibility and compile-time type safety and clarity.

Overview

Kengine

The Koala engine is a type-safe and self-documenting implementation of an Entity-Component-System (ECS), with a focus on runtime extensibility and compile-time type safety and clarity.

The latest version is available on the develop branch.

koala

Table of contents

Example

An example of source code is shown at the bottom of this page.

Installation

The engine uses Git submodules, and should therefore be cloned recursively with

git clone https://github.com/phisko/kengine --recursive

Alternatively, the entire source code can be found in ZIP form in the latest release.

C++ version

The engine requires a C++17 compiler.

Members

Classes

  • Entity: can be used to represent anything (generally an in-game entity). Is simply a container of Components
  • Entities: lets users create, remove, access and iterate over entities.

Note that there is no Component class. Any type can be used as a Component, and dynamically attached/detached to Entities.

Similarly, there is no System class to hold game logic. Systems are simply Entities with an Execute component. This lets users introspect Systems or add behavior to them (such as profiling) just like they would with any other Entity.

API

init

void init(size_t threads = 0) noexcept;

Initializes the engine and creates a ThreadPool with the given number of worker threads.

entities

Entities entities;

Global Entities object that allows for creation, removal, access and iteration over entities.

threadPool

putils::ThreadPool & threadPool() noexcept;

Returns the engine's ThreadPool to allow for controlled asynchronous tasks.

isRunning, stopRunning

bool isRunning() noexcept;
void stopRunning() noexcept;

Lets code query and control whether the engine should keep running or not.

terminate

void terminate() noexcept;

Cleans up the engine. All OnTerminate function Components will be called, the ThreadPool's workers will be joined and the internal state will be deleted.

This function should typically only be called right before exiting main.

getState

void * getState() noexcept;

Returns a pointer to the engine's internal state. This state is required when initializing a plugin (as it is not shared across DLL boundaries).

initPlugin

void initPlugin(void * state) noexcept;

Initializes the current plugin with the provided internal state pointer.

cleanupArchetypes

void cleanupArchetypes() noexcept;

Removes any unused Archetypes to speed up future iteration over Entities. This is called at the end of each frame by the mainLoop helper.

Reflection

Many parts of the engine (such as the scripting systems or the OpenGL system) make use of putils' reflection API. Most of the components in the following samples are thus defined as reflectible.

Components

Any type can be used as a Component. This essentially means that you can use the engine solely as a generic container, letting you attach anything to anything.

However, the engine comes with a (fairly large) number of pre-built components that can be used to bootstrap a game, or simply as examples that you can base your own implementations upon.

These components fit into three categories:

  • Data components
  • Function components
  • Meta components

Data components

These are typical, data-holding components, such as a TransformComponent or a NameComponent. They provide information about an Entity.

Data components can sometimes hold functions: the InputComponent lets an Entity hold callbacks to be called whenever an input event occurs. The CollisionComponent lets an Entity be notified when it collides with another.

Function components

These are simply holders for functors that can be attached as Components to Entities. This mechanic can be used:

  • to attach behaviors to entities (for instance, the Execute function gets called by the main loop each frame)
  • to register callbacks for system-wide events (for instance, the OnEntityCreated function gets called whenever a new Entity is created)
  • to provide new functionality that is implemented in a specific system (for instance, the QueryPosition function can only be implemented in a physics system)

Function components are types that inherit from BaseFunction, giving it the function signature as a template parameter.

To call a function component, one can use its operator() or its call function.

// have an Entity e
e += functions::Execute{ // Attach a function
    [](float deltaTime) { std::cout << "Yay!\n"; }
};
const auto & execute = e.get<functions::Execute>(); // Get the function
execute(0.f); // Call it with its parameters
execute.call(42.f); // Alternatively

Meta components

These provide a type-specific implementation of a generic function for a given Component type. They are attached to "type entities", i.e. Entities used to represent a Component type. These entities can be obtained by calling the getTypeEntity<T>() function from typeHelper.

At their core, meta components are function components: they also inherit from BaseFunction and are used the same way.

As an example, the Has meta component, attached to the type entity for T, takes an Entity as parameter and returns whether it has a T component.

auto type = getTypeEntity<TransformComponent>(); // Get the type entity
type += NameComponent{ "TransformComponent" }; // You'll typically want to provide the type name as information
type += meta::Has{ // Provide the implementation for `Has`
    [](const Entity & e) { return e.has<TransformComponent>(); }
};

auto e = entities.create([](Entity & e) { // Create an entity with a TransformComponent
    e += TransformComponent{};
});

// For each entity with a NameComponent and a Has meta component
for (const auto & [type, name, has] : entities.with<NameComponent, meta::Has>())
    if (has(e)) // if `e` has the component represented by `type`
        std::cout << e.id << " has a " << name.name << '\n';

Samples

These are pre-built, extensible and pluggable elements that can be used to bootstrap a project or as inspiration for your own implementations.

Components

Data components

General purpose gamedev
Behaviors
  • LuaComponent: defines the lua scripts to be run by the LuaSystem for an Entity
  • LuaTableComponent: holds a sol::table that lua scripts can use to hold any information related to an Entity
  • PythonComponent: defines the Python scripts to be run by the PythonSystem for an Entity
  • CollisionComponent: defines a function to be called when an Entity collides with another
Debug tools
Graphics
3D Graphics
  • HighlightComponent: indicates that an Entity should be highlighted
  • LightComponent: lets Entities be used as in-game light sources (directional lights, point lights or spot lights)
  • GodRaysComponent: indicates that a "light entity" should generate volumetric lighting (also known as "Almighty God Rays")
  • ShaderComponent: lets Entities be used to introduce new OpenGL shaders
  • PolyVoxComponent: lets Entities be used to generate voxel-based models, drawn by the PolyVoxSystem
  • SkyBoxComponent: lets Entities be used to draw a skybox
  • SpriteComponent: indicates that an Entity's GraphicsComponent describes a 2D or 3D sprite
  • TextComponent: indicates that an Entity's GraphicsComponent describes a 2D or 3D text element
Skeletal animation
Physics

Function components

Meta components

In all following descriptions, the "parent" Component refers to the Component type represented by the type entity which has the meta component.

  • AttachTo: attaches the parent Component to an Entity
  • Attributes: recursively lists the parent Component's attributes
  • Copy: copies the parent Component from one Entity to another
  • Count: counts the number of Entities with the parent Component
  • DetachFrom: detaches the parent Component from an Entity
  • DisplayImGui: displays the parent Component attached to an Entity in ImGui with read-only attributes
  • EditImGui: displays the parent Component attached to an Entity in ImGui and lets users edit attributes
  • ForEachEntity: iterates on all entities with the parent Component
  • ForEachEntityWithout: iterates on all entities without the parent Component
  • Get: returns a pointer to the parent Component attached to an Entity
  • Has: returns whether an Entity has the parent Component
  • LoadFromJSON: initializes the parent Component attached to an Entity from a putils::json object
  • MatchString: returns whether the parent Component attached to an Entity matches a given string
  • SaveToJSON: serializes the parent Component into a JSON object
  • Size: contains the size of the parent Component

Systems

Behaviors

  • LuaSystem: executes lua scripts attached to Entities
  • PythonSystem: executes Python scripts attached to Entities
  • CollisionSystem: forwards collision notifications to Entities
  • OnClickSystem: forwards click notifications to Entities
  • InputSystem: forwards input events buffered by graphics systems to Entities

Debug tools

Logging

2D Graphics

  • SFMLSystem: displays entities in an SFML render window

3D Graphics

  • OpenGLSystem: displays entities in an OpenGL render window
  • OpenGLSpritesSystem: loads sprites and provides shaders to render them
  • AssimpSystem: loads 3D models using the assimp library, animates them and provides shaders to render them
  • PolyVoxSystem: generates 3D models based on PolyVoxComponents and provides shaders to render them
  • MagicaVoxelSystem: loads 3D models in the MagicaVoxel ".vox" format, which can then be drawn by the PolyVoxSystem's shader
  • GLFWSystem: creates GLFW windows and handles their input

Physics

General

These systems must be enabled by setting the corresponding CMake variable to true in your CMakeLists.txt. Alternatively, you can set KENGINE_ALL_SYSTEMS to build them all.

System Variable
AssimpSystem KENGINE_ASSIMP
BulletSystem KENGINE_BULLET
CollisionSytem KENGINE_COLLISION
ImGuiAdjustableSystem KENGINE_IMGUI_ADJUSTABLE
ImGuiEngineStatsSystem KENGINE_IMGUI_ENGINE_STATS
ImGuiEntityEditorSystem KENGINE_IMGUI_ENTITY_EDITOR
ImGuiEntitySelectorSystem KENGINE_IMGUI_ENTITY_SELECTOR
ImGuiPromptSystem KENGINE_IMGUI_PROMPT
ImGuiToolSystem KENGINE_IMGUI_TOOL
InputSystem KENGINE_INPUT
KinematicSystem KENGINE_KINEMATIC
LuaSystem KENGINE_LUA
LogImGuiSystem KENGINE_LOG_IMGUI
LogStdoutSystem KENGINE_LOG_STDOUT
LogVisualStudioSystem KENGINE_LOG_VISUAL_STUDIO
OnClickSystem KENGINE_ONCLICK
OpenGLSystem KENGINE_OPENGL
OpenGLSpritesSystem KENGINE_OPENGL_SPRITES
PolyVoxSystem KENGINE_POLYVOX
MagicaVoxelSystem KENGINE_POLYVOX
ModelCreatorSystem KENGINE_MODEL_CREATOR
PythonSystem KENGINE_PYTHON
RecastSystem KENGINE_RECAST

It is possible to test for the existence of these systems during compilation thanks to C++ define macros. These have the same name as the CMake variables, e.g.:

#ifdef KENGINE_LUA
// The LuaSystem exists, and we can safely use the lua library
#endif

Some of these systems make use of Conan for dependency management. The necessary packages will be automatically downloaded when you run CMake, but Conan must be installed separately by running:

pip install conan

Helpers

These are helper functions to factorize typical manipulations of Components.

Meta component helpers

These provide helper functions to register standard implementations for the respective meta Components.

Example

Below is a commented main function that creates an entity and attaches some components to it, as well as a lua script. This should let you get an idea of what is possible using the kengine's support for reflection and runtime extensibility, as well as the compile-time clarity and type-safety that were the two motivations behind the project.

main.cpp

#include <iostream>

#include "go_to_bin_dir.hpp"

#include "kengine.hpp"

#include "systems/lua/LuaSystem.hpp"

#include "data/GraphicsComponent.hpp"
#include "data/TransformComponent.hpp"
#include "functions/Execute.hpp"

#include "helpers/mainLoop.hpp"
#include "helpers/luaHelper.hpp"

// Simple system that outputs the transform and lua components of each entity that has them
//- Forward declaration
static float execute(float deltaTime);
//-
auto DebugSystem() {
    return [&](kengine::Entity & e) {
        // Attach an Execute component that will be called each frame
        e += kengine::functions::Execute{ execute };
    };
}

// This could be defined as a lambda in DebugSystem but is moved out here for readability
static float execute(float deltaTime) {
    for (const auto & [e, transform, lua] : kengine::entities.with<kengine::TransformComponent, kengine::LuaComponent>()) {
        std::cout << "Entity " << e.id << '\n';
        std::cout << "\tTransform: "
            << transform.boundingBox.position.x << ' '
            << transform.boundingBox.position.y << ' '
            << transform.boundingBox.position.z << '\n';

        std::cout << "\tScripts:" << '\n';
        for (const auto & script : lua.scripts)
            std::cout << "\t\t[" << script << "]\n";

        std::cout << '\n';
    }
}

int main(int, char **av) {
    // Go to the executable's directory to be next to resources and scripts
    putils::goToBinDir(av[0]);

    kengine::init(); // Optionally, pass a number of threads as parameter

    kengine::entities += DebugSystem();
    kengine::entities += kengine::LuaSystem();

    // Create an Entity and attach Components to it
    kengine::entities += [](kengine::Entity e) {
        e += kengine::TransformComponent({ 42.f, 0.f, 42.f }); // Parameter is a Point3f for position
        e += kengine::LuaComponent({ "scripts/unit.lua" }); // Parameter is a vector of scripts
    };

	// Register types to be used in lua
    kengine::luaHelper::registerTypes<
        kengine::TransformComponent, putils::Point3f, putils::Rect3f,
        kengine::LuaComponent
    >();

    // Start game
    kengine::MainLoop::run();

    return 0;
}

scripts/unit.lua

-- Simply modify component

local transform = self:getTransformComponent()
local pos = transform.boundingBox.position
pos.x = pos.x + 1
You might also like...
An open source C++ entity system.

anax ARCHIVED: as I haven't maintained this library for at least a couple of years. I don't have the time or interest to work on this. Please use anot

Modern C++ 20 compile time OpenAPI parser and code generator implementation

OpenApi++ : openapipp This is a proof of concept, currently under active work to become the best OpenAPI implementation for C++. It allows compile tim

DimensionalAnalysis - A compact C++ header-only library providing compile-time dimensional analysis and unit awareness

Dimwits ...or DIMensional analysis With unITS is a C++14 library for compile-time dimensional analysis and unit awareness. Minimal Example #include i

Ctpg - Compile Time Parser Generator

Ctpg - Compile Time Parser Generator is a C++ single header library which takes a language description as a C++ code and turns it into a LR1 table parser with a deterministic finite automaton lexical analyzer, all in compile time.

Pipet - c++ library for building lightweight processing pipeline at compile-time for string obfuscation, aes ciphering or whatever you want

Pipet Pipet is a lightweight c++17 headers-only library than can be used to build simple processing pipelines at compile time. Features Compile-time p

Compile-time C Compiler implemented as C++14 constant expressions

constexpr-8cc: Compile-time C Compiler constexpr-8cc is a compile-time C compiler implemented as C++14 constant expressions. This enables you to compi

Set of tests to benchmark the compile time of c++ constructs

CompileTimer Set of tests to benchmark the compile time of c++ constructs This project is an attempt to understand what c++ construct take how much ti

Comments
  • fail to clone recursive

    fail to clone recursive

    Please check the module path to putils.

    I get Permission denied error, if I try to clone kengine recursive,

    $ git clone --recurse-submodules https://github.com/phisko/kengine.git
    Cloning into 'kengine'...
    remote: Enumerating objects: 46, done.
    remote: Counting objects: 100% (46/46), done.
    remote: Compressing objects: 100% (43/43), done.
    remote: Total 4620 (delta 9), reused 18 (delta 2), pack-reused 4574
    Receiving objects: 100% (4620/4620), 12.64 MiB | 2.96 MiB/s, done.
    Resolving deltas: 100% (2515/2515), done.
    Submodule 'putils' ([email protected]:phisko/putils) registered for path 'putils'
    Cloning into 'D:/src/kengine/putils'...
    [email protected]: Permission denied (publickey).
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    fatal: clone of '[email protected]:phisko/putils' into submodule path 'D:/src/kengine/putils' failed
    Failed to clone 'putils'. Retry scheduled
    Cloning into 'D:/src/kengine/putils'...
    [email protected]: Permission denied (publickey).
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    fatal: clone of '[email protected]:phisko/putils' into submodule path 'D:/src/kengine/putils' failed
    Failed to clone 'putils' a second time, aborting
    
    

    Regards. Sven

    opened by SvenJo 6
  • Compile error when compiling with clang/gcc

    Compile error when compiling with clang/gcc

    third_party/kengine/EntityManager.hpp:3:10: fatal error: 'execution' file not found
    #include <execution>
             ^~~~~~~~~~~
    1 error generated.
    

    The latest versions of both libc++ and libstdc++ do not include this header yet, so kengine cannot be compiled with GCC or Clang at the moment.

    opened by ceeac 2
  • Example lua script error

    Example lua script error

    When running the bundled example/main.cpp I get the following error spammed in the terminal:

    [LuaSystem] Error in 'scripts/test.lua': lua: error: scripts/test.lua:2: attempt to call a nil value (field 'new')

    I am using Lua 5.3 on Arch linux.

    opened by JanSimek 2
Releases(v6.0)
  • v6.0(Nov 30, 2021)

    This release comes with a ZIP file containing the entire source code, including its submodules. This makes it easier for people not used to working with Git submodules to download the entire source code.

    There have been many additions and changes to the API, so writing a changelog for this would boil down to re-writing the entire documentation. Feel free to take a look at the new commits since v5.0 if you really need to check for individual changes.

    Source code(tar.gz)
    Source code(zip)
    kengine.zip(6.19 MB)
  • v5.0(Jan 15, 2020)

    This release comes with a ZIP file containing the entire source code, including its putils submodule. This makes it easier for people not used to working with Git submodules to download the entire source code.

    Changelog

    Major changes

    "System Entity' model

    • Systems are now represented by Entities with "function Components"
    • Datapackets have been replaced by "function Components"
    • This lets systems be queried and extended by users (by adding new "function Components" or any other type of components, e.g. for profiling)

    "Type Entities"

    • Replaced ComponentFunctions with "meta Components", attached to type Entities

    Features

    Architecture

    Helpers

    Tools

    OpenGL

    • Render to texture
    • Cascaded shadow maps

    Minor changes

    Behaviors

    • OpenGL sprites and text are now drawn upright
    • ComponentJSONLoader now works with arrays
    • Optimized MagicaVoxelSystem loading through binary serialization
    • Light shaders are now responsible for clearing their shadow maps
    • Optimized OpenGL "entity in pixel" queries

    ImGui tools

    Components

    Misc

    • Replaced putils_for_each_type macro with a function

    Optimizations

    Fixes

    • Fixed ImGuiAdjustableSystem not loading colors properly
    • Fixed crash in OpenGLSystem when requesting the Entity::ID for pixel in y == 0
    • Fixed camera orientation in OpenGLSystem
    Source code(tar.gz)
    Source code(zip)
    kengine.zip(6.28 MB)
  • v4.2(Sep 17, 2019)

    For the first time, this release comes with a ZIP file containing the entire source code, including its putils submodule. This will make it easier for people not used to working with Git submodules to download the entire source code.

    Changelog

    Features

    • Added "component function" system, which lets users register function template specializations for specific components (such as a serializer, JSON parser, string matcher...)
    • Added an ImGuiEditor "component function" that displays a Component as a tree structure in ImGui
    • Added a LoadFromJSON "component function" that loads a Component from a JSON object
    • Added a MatchString "component function" that returns whether a Component (when serialized) contains a specific string
    • Added an ImGuiEntityEditorSystem that displays an ImGui editor for any Entity with a SelectedComponent
    • Added an ImGuiEntitySelectorSystem that displays an ImGui window letting users search for Entities and add a SelectedComponent to them
    • Added a Bullet Physics system and a QueryPosition datapacket
    • Added OnClickComponent and OnClickSystem

    Major changes

    • Moved to a "model entity" architecture for OpenGL rendering systems, where Entities with a ModelComponent hold flyweight-style information for all GraphicsComponents pointing to a same resource

    Minor changes

    • Added GodRaysComponent
    • Added roll to TransformComponent and CameraComponent
    • Added color and alpha to GraphicsComponent::Layer
    • Removed GraphicsComponent::Layer as it was mostly unused and only complicated code

    Optimizations

    • Made BaseModule::receive non-virtual
    • Made the engine thread-safe

    Fixes

    • Various fixes in OpenGL rendering systems, both about functionality and architecture

    Note

    The master, develop and v4.2 commit histories have been emptied to reduce the repository size. This is due to my (very unfortunately) poor use of Git. While trying to make the repository easier to use, I switched from submodules to subtrees. This made it easier to clone the repository, but much harder for me to work with it. The commit history quickly became polluted and the repository size basically exploded.

    I found no better solution than to clear the history, which shouldn't have too many downsides, apart from people who forked the engine and would have liked to submit a merge request (but I haven't had any of those in ages).

    I will be much more careful with my use of Git from now on, and will try to keep the repository size sane.

    Source code(tar.gz)
    Source code(zip)
    kengine.zip(39.04 MB)
  • v4.1(May 21, 2019)

    This version adds an extensible OpenGL deferred rendering system. Default shaders are provided, but these are absolutely not state of the art, as graphics programming is not my specialty. They include (poor quality) shadow maps and (pretty decent) volumetric lighting/god rays.

    OpenGLSystem preview

    Systems have also been added to load 3D models, be they standard (.obj/.fbx/etc. loaded with the assimp library) or in MagicaVoxel's .vox format. The AssImpSystem also supports skeletal animation, although it has not been optimized at this point.

    Performance has also been enhanced by the avoidance of runtime memory allocation, using putils::string, putils::vector and putils::function instead of their standard counterparts.

    Features:

    • Added serialization
    • Made it possible to add/update entities during iteration
    • Added OpenGLSystem
    • Added PolyVoxSystem (used to generate meshes from voxel volumes)
    • Added MagicaVoxelSystem (used to load .vox model files)
    • Added AssImpSystem (used to load any other model file and skeletal animations)
    • Added SelectedComponent and HighlightComponent
    • Added ImGuiEntityEditorSystem and ImGuiEntitySelectorSystem

    Major changes:

    • The SfSystem is no longer built as a plugin and is automatically linked if the option to build it is enabled

    Minor changes:

    • kengine is no longer simply a CMake "interface library" but a full fledged static/shared library depending on your platform
    • The ImGuiAdjustableManager has become a System
    • Added pitch to GraphicsComponent
    • Component IDs are now printed, which may help with debugging an Entity's mask

    Optimizations:

    • Used putils::string, putils::vector and putils::function instead of their standard counterparts. These have the advantage of never performing memory allocation.
    • Compilation times have been reduced thanks to being a "normal" library

    Fixes:

    • Stopped using execution policies as they are not available on gcc
    • Fixed BehaviorComponent and BehaviorSystem which had not been updated to new API
    • Various fixes in scripting systems

    What's coming next

    The first thing I want to sort out is proper handling of object sizes in the OpenGLSystem. This was fairly simple with SFML as images were all loaded with the same default size. OpenGL introduces the fact that models may be created with different sizes, meaning that getting them to render properly and have their TransformComponent's size reflect reality implies playing around with the GraphicsComponent and TransformComponent sizes. This is not optimal.

    I'm hoping to come up with a satisfactory solution for this soon enough and make a small release when that time comes. After that, I plan to implement a few toy projects with the engine in its current state to see what may be missing. One obvious thing is a menu system (and generally 2D rendering in OpenGL), so that may not be too far down the line.

    Source code(tar.gz)
    Source code(zip)
  • v4.0(Nov 30, 2018)

    This new version features a greatly optimized memory architecture, better cache-efficiency, and a more advanced API.

    This release changes the API for the kengine in various places. Refactoring code to work with this release should be rather straightforward, but some features have been temporarily removed:

    • Entities no longer have names. If you really need to associate strings to your Entities you can create a NameComponent or something similar
    • Entities can no longer be serialized to ostream. I am currently working to re-implement this feature.
    • Because of the previous point, it is no longer possible to save and load the game state. I am currently working to re-implement this feature, in a manner that will be better optimized than the original (binary saving instead of JSON serialization)

    Features:

    • Made it possible to get a collection of entities matching several component types
    • Added AdjustableComponent and ImGuiAdjustableManager
    • Added DebugGraphicsComponent
    • Added GUIComponent
    • Used an actual ThreadPool in EntityManager (i.e. in `Mediator)

    Major changes:

    • Renamed GameObject to Entity
    • Entities no longer have names
    • Entities are now created using a simple function, instead of a type/type name and a name
    • Removed Component class. Any type can now be used as a component
    • Changed Entity::XXXComponent function names to Entity::XXX (e.g. getComponent became get)
    • Removed support for directories in ScriptSystem to stop iterating over FS every frame
    • Removed any use of Ogre as it was very experimental

    Minor changes:

    • I changed my name 🙂 URL is now phisko/kengine
    • Changed Z axis in SfSystem (up is now up)
    • Used a real JSON library

    Optimizations:

    • Made Entity a simple ID and bitmask, instead of storing a map of components
    • Stopped dynamically allocating each entity and component, instead used pools of components
    • Stored entities by "archetypes" to optimize iteration

    Fixes:

    • Suppressed an inheritance warning in MSVC (I know my inheriting class is using its parent's function, that's the point)
    Source code(tar.gz)
    Source code(zip)
  • v3.0(Apr 9, 2018)

    Features:

    • Added speed and pause/resume functionality
    • Added save/load feature
    • Added EntityManager::disableEntity suite
    • Added PySystem
    • Added Box2DSystem
    • Added ImGui support
    • Added CollisionSystem
    • Added ScriptSystem middle-class to simplify supporting more scripting languages
    • Made it possible to overwrite entities
    • SfSystem now detects appearance changes
    • SfSystem now supports rotation
    • Added GraphicsComponent::yaw
    • Added size field to GraphicsComponent to override TransformComponent on the graphical side of things
    • Added fields to GUIComponent to make placing GUI elements simple
    • Made it possible to repeat elements (such as a background) with GraphicsComponent::repeated

    Major changes:

    • Removed Input datapackets and replaced them with InputComponent, makes more sense and is easier to use

    Minor changes:

    • The common directory is now in the include path ("common/systems/LuaSystem.hpp" can be replaced by "systems/LuaSystem.hpp")
    • System.hpp now forward declares EntityManager for convenience
    • Optimizations in SfSystem
    • ExtensibleFactory now registers GameObject by default
    • Improved exception messages in EntityManager
    • Changes to script function names (removeEntity/removeEntityByName)
    • Removed all uses of QuadTree (in PhysicsSystem and PathfinderSystem)

    Fixes:

    • Removed unnecessary and forgotten call to cout in LuaSystem
    • PhysicsSystem now skips collisions when PhysicsComponent::solid is set to false
    • Added missing include in hash.hpp
    • Improved key buffering in SfSystem
    • Made LuaSystem not destroy its sol::state in order to avoid memory corruption as I do not control the order of system destruction
    • Removed unnecessary call to detachComponent in SfSystem::removeGameObject
    • EntityManager now buffers entity removal to avoid iterator corruption
    Source code(tar.gz)
    Source code(zip)
  • v2.2.2(Jan 17, 2018)

    Fixes:

    • LuaSystem clears its buffer at the end of each frame instead of the start (meaning events that were triggered before the start of the frame now get properly processed)
    • LuaSystem catches exceptions thrown by buffered commands to ensure proper execution of other commands

    Optimizations:

    • Optimized includes in SfSystem
    Source code(tar.gz)
    Source code(zip)
  • v2.2.1(Jan 16, 2018)

    Fixes:

    • PhysicsSystem now properly removes deleted GameObjects from its quadtree (fixing memory corruption issues)
    • LuaSystem now buffers entity creations and removals until end of frame (fixing memory corruption issues)

    Addition:

    • LuaCollisionSystem: provides access to Collision datapackets from scripts. Serves as an example of how to provide access to any type of datapacket
    Source code(tar.gz)
    Source code(zip)
  • v2.1.0(Dec 25, 2017)

    Features:

    • The SfSystem now supports rendering through multiple cameras and controlling the rendered area through CameraComponents

    Refactorings:

    • MetaComponent renamed to GraphicsComponent as it is its only use
    Source code(tar.gz)
    Source code(zip)
  • v2.0.1(Dec 24, 2017)

    Major changes:

    • RegisterGameObject and RemoveGameObject are now datapackets, instead of members of the ISystem interface.

    Minor changes:

    • Added pmeta_get_class_name and other utility macros to make creating Reflectible classes much easier.

    Fixes:

    • SfSystem had a major drawing issue which is now fixed
    Source code(tar.gz)
    Source code(zip)
  • v1.0(Nov 25, 2017)

Owner
Nicolas Phister
Engine Programmer at DONTNOD Entertainment. Former C++ and OOP teacher at Epitech.
Nicolas Phister
Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more

EnTT is a header-only, tiny and easy to use library for game programming and much more written in modern C++. Among others, it's used in Minecraft by

Michele Caini 7.4k Nov 29, 2022
EntityX - A fast, type-safe C++ Entity-Component system

EntityX - A fast, type-safe C++ Entity Component System NOTE: The current stable release 1.0.0 breaks backward compatibility with < 1.0.0. See the cha

Alec Thomas 2k Nov 26, 2022
apecs: A Petite Entity Component System

apecs: A Petite Entity Component System A header-only, very small entity component system with no external dependencies.

Matt Cummins 17 Jun 1, 2022
C++ single-header entity component system library

ECS This is a simple C++ header-only type-safe entity component system library. It makes heavy use of C++11 constructs, so make sure you have an up to

Sam Bloomberg 415 Nov 24, 2022
C++ entity-component system

CORGI Version 1.0.2 {#corgi_readme} CORGI is a C++ entity-component system library developed primarily for games that focus on simplicity and flexibil

Google 250 Nov 6, 2022
Thoughts about entity-component-system

About Warning: This is not a complete production-ready library for entity-component-system. This is only my thoughts about how the modern entity-compo

Sergey Makeev 178 Nov 18, 2022
Type safe - Zero overhead utilities for preventing bugs at compile time

type_safe type_safe provides zero overhead abstractions that use the C++ type system to prevent bugs. Zero overhead abstractions here and in following

Jonathan Müller 1.2k Nov 27, 2022
STM32Cube is an STMicroelectronics original initiative to ease the developers life by reducing efforts, time and cost.

STM32Cube covers the overall STM32 products portfolio. It includes a comprehensive embedded software platform (this repo), delivered for each series (such as the STM32CubeU5 for the STM32U5 series).

STMicroelectronics 59 Nov 24, 2022
Open Source Cheat for Apex Legends, designed for ease of use. Made to understand reversing of Apex Legends and respawn's modified source engine as well as their Easy Anti Cheat Implementation.

Apex-Legends-SDK Open Source Cheat for Apex Legends, designed for ease of use. Made to understand reversing of Apex Legends and respawn's modified sou

null 107 Nov 20, 2022