Skip to content

Simple multi-core ECS system. Design to leverage a 21 century way of designing software. Speed, size, GPU, CPU all matters. Useful for games and any other type of realtime app.

License

Notifications You must be signed in to change notification settings

LIONant-depot/MECSV2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MECS (Version: 2.0-Alpha)

Visual Studio 2019

Feedback Contributions welcome License

(MECS) Mulicore Events Component and Systems

Simple yet powerful Entity Component System (ECS) system in C++ 17. It leverages many of the C++ features to provide a simple to use API to the end user yet deliver near optimum code. It is also designed so the user does not need to know very much about multi-core and when the user makes a mistake MECS should be able to detected. It also allows advance users to take advantage of complex multi-core features easily and cleanly.

The project is meant to serve as a reference/bench mark for other ECS system out there. The code should be able to be inserted in game engines and applications without a problem.

Any feedback is more than welcome. Please follow us and help support the project.

Twitter chat

Features

The main concept of MECS is to leverage all the features of the hardware to the maximum, and to provide a unify system for both CPU and GPU.

Legal

  • MIT license. Not need to worry is all yours.

Architecture

  • Lockless architecture. Utilizes all the hardware threads, and remains completely safe for the end user.
  • Virtual memory support. Provide super fast memory manipulations and minimizes wasted memory.
  • Archetypes support. Groups entities into flat arrays to provide near zero cache misses.
  • Single CPP/H. It is not a library is a module. Just include a single cpp/h into your project directly.
  • [WIP 🚧] GPU support. You can create systems that run entirely in the GPU, yet is able to play nice with the CPU systems.
  • System Events/Delegates. Simple generic way to extended systems, and lighting fast with hot cache efficiency.
  • Archetype Events/Delegates. Add functionality on key events from Archetypes, adding, updating, move-in, etc.
  • C++ 17 meta-programming. Makes the compiler work hard so that the run time doesn't + keeps API simple.
  • GUID for entities. Helps identify entities across different levels, scripts, versions, etc.
  • Game Graph. Simple multi-core graph allows user to define order dependencies easily and flexibly.
  • Universe/Worlds. Simple way to organize your project flexibly. Can run multiple worlds at the same time.
  • [WIP 🚧] Data worlds. for blasting fast streaming of worlds. Think Playstation 5.
  • Step by step execution. So that it is easy to integrate with editor, or continuous execution for speed.
  • Procedure + Data Oriented APIs. Procedure API for speed and simplicity + Data Oriented APIs for editors.

Component Types

  • Linear. Simple and easy to use components with plenty of debug features.
  • Quantum. Support direct multi-core access components, for advance users.
  • Double Buffer. To allow simultaneous Read/Write operation for linear and quantum components.
  • Share. Factors out components which are share across multiple entities.
  • Tags. Helps user group entities easily.
  • Singleton. Allows to build supporting systems, complex components, and still plays nice with MECS.
  • [WIP 🚧] Reference. references to other entities in a safe, simple and elegant way. Great for assets/resources.

Pipeline / Documentation

  • Unit-test. to make sure everything is working.
  • Command Line examples. Minimizes dependencies and keeps the project simple to follow.
  • Visual Examples. Shows how MECS can be used with a multi-core graphics APIs.
  • Follows Unity3D. Name of concepts follows unity3D when possible.
  • Blog. https://rationalworlds.github.io/LIONant/

Code Example

    struct position : mecs::component::data {
        xcore::vector2 m_Value;
    };

    struct velocity : mecs::component::data {
        xcore::vector2 m_Value;
    };

    struct move_system : mecs::system::instance {
        using instance::instance;
        void operator()( position& Position, const velocity& Velocity ) const {
            Position.m_Value += Velocity.m_Value * getTime().m_DeltaTime;
        }
    };

Build Instructions

Go to the builds directory and run (double click) updateDependencies.bat This will allow you to use all the functionality of the module. Make sure you wait until is completed, it will tell you when that is the case. If you want to run the graphical examples also run updateGraphicsDependencies.bat. Ones completed you can just load the solutions in visual studio.

To add to your project simply insert in your build mecs.h and mecs.cpp

Dependencies

Similar Projects

About

Simple multi-core ECS system. Design to leverage a 21 century way of designing software. Speed, size, GPU, CPU all matters. Useful for games and any other type of realtime app.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages