All Projects → pvigier → Ecs

pvigier / Ecs

Licence: mit
A simple and easy to use entity-component-system C++ library

Programming Languages

cpp
1120 projects

Projects that are alternatives of or similar to Ecs

Etengine
Realtime 3D Game-Engine with a focus on space sim. Written in C++ 14
Stars: ✭ 408 (+1940%)
Mutual labels:  ecs, game-development, entity-component-system
Kengine
Entity-Component-System (ECS) with a focus on ease-of-use, runtime extensibility and compile-time type safety and clarity.
Stars: ✭ 417 (+1985%)
Mutual labels:  ecs, game-development, entity-component-system
Flecs
A fast entity component system (ECS) for C & C++
Stars: ✭ 2,201 (+10905%)
Mutual labels:  ecs, game-development, entity-component-system
Gdk For Unity
SpatialOS GDK for Unity
Stars: ✭ 296 (+1380%)
Mutual labels:  ecs, game-development, entity-component-system
Ecs
LeoECS is a fast Entity Component System (ECS) Framework powered by C# with optional integration to Unity
Stars: ✭ 578 (+2790%)
Mutual labels:  ecs, game-development, entity-component-system
Gdk For Unity Fps Starter Project
SpatialOS GDK for Unity FPS Starter Project
Stars: ✭ 119 (+495%)
Mutual labels:  ecs, game-development, entity-component-system
Shipyard
Entity Component System focused on usability and speed.
Stars: ✭ 247 (+1135%)
Mutual labels:  ecs, game-development, entity-component-system
Rust Game Development Frameworks
List of curated frameworks by the **Game Development in Rust** community.
Stars: ✭ 81 (+305%)
Mutual labels:  ecs, game-development, entity-component-system
Entt
Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more
Stars: ✭ 6,017 (+29985%)
Mutual labels:  ecs, game-development, entity-component-system
Entitas Csharp
Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
Stars: ✭ 5,393 (+26865%)
Mutual labels:  ecs, game-development, entity-component-system
Defaultecs
Entity Component System framework aiming for syntax and usage simplicity with maximum performance for game development.
Stars: ✭ 286 (+1330%)
Mutual labels:  ecs, game-development, entity-component-system
Octopuskit
2D ECS game engine in 100% Swift + SwiftUI for iOS, macOS, tvOS
Stars: ✭ 246 (+1130%)
Mutual labels:  ecs, game-development, entity-component-system
Edyn
Edyn is a real-time physics engine organized as an ECS.
Stars: ✭ 113 (+465%)
Mutual labels:  ecs, game-development, entity-component-system
Godex
Godex is a Godot Engine ECS library.
Stars: ✭ 307 (+1435%)
Mutual labels:  ecs, game-development, entity-component-system
Entitas Sync Framework
Networking framework for Entitas ECS. Targeted at turnbased games or other slow-paced genres.
Stars: ✭ 98 (+390%)
Mutual labels:  ecs, game-development, entity-component-system
Ape Ecs
Entity-Component-System library for JavaScript.
Stars: ✭ 137 (+585%)
Mutual labels:  ecs, game-development, entity-component-system
Endless Runner Entitas Ecs
Runner template for Unity
Stars: ✭ 41 (+105%)
Mutual labels:  ecs, game-development, entity-component-system
Uecs
Ubpa Entity-Component-System (U ECS) in Unity3D-style
Stars: ✭ 174 (+770%)
Mutual labels:  ecs, game-development, entity-component-system
Entitas Cpp
Entitas++ is a fast Entity Component System (ECS) C++11 port of Entitas C#
Stars: ✭ 229 (+1045%)
Mutual labels:  ecs, game-development, entity-component-system
Svelto.ecs
Svelto ECS C# Lightweight Data Oriented Entity Component System Framework
Stars: ✭ 605 (+2925%)
Mutual labels:  ecs, game-development, entity-component-system

ecs

Build Status codecov

ecs is the entity-component-system library I have created for my game Vagabond.

ecs aims to be:

  • easy to use
  • fast
  • lightweight
  • header only
  • implemented with modern C++ features (C++17)

Example

Firstly, you should define some components:

struct Position : public Component<Position>
{
    float x;
    float y;
};

struct Velocity : public Component<Velocity>
{
    float x;
    float y;
};

A component of type T must inherit Component<T>.

Now, let us create an entity manager:

auto manager = EntityManager();

Next, let us create an entity with both components:

auto entity = manager.createEntity();
manager.addComponent<Position>(entity);
manager.addComponent<Velocity>(entity);

Finally, we can use getEntitySet to query all entities that have both components and update their positions:

auto dt = 1.0f / 60.0f;
for (auto [entity, components] : manager.getEntitySet<Position, Velocity>())
{
    auto [position, velocity] = components;
    // Update the position
    position.x += velocity.x * dt;
    position.y += velocity.y * dt;
}

It is that easy!

If you want more examples, look at the examples folder.

Documentation

I have written several articles on my blog describing the design of the library. They are available here.

Otherwise, just look at the EntityManager.h file, it is simple to understand.

License

Distributed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].