Zurück zum Ranking

SanderMertens/flecs

Cflecs.dev

A fast entity component system (ECS) for C & C++

ecsc99cpp11cpp14cpp17data-orienteddata-oriented-designentity-component-systementity-frameworkflecsgame-developmentgame-engine
Sterne-Wachstum
Sterne
8.5k
Forks
608
Wochenwachstum
Issues
28
5k
Dez. 2018Juni 2021Jan. 2024Juli 2026
README

flecs

Version MIT Documentation actions Discord Chat

Flecs is a fast and lightweight Entity Component System that lets you build games and simulations with millions of entities (join the Discord!). Here are some of the framework's highlights:

Flecs Explorer

To support the project, give it a star 🌟 !

What is an Entity Component System?

ECS is a way of organizing code and data that lets you build games that are larger, more complex and are easier to extend. Something is called an ECS when it:

  • Has entities that uniquely identify objects in a game
  • Has components which are datatypes that can be added to entities
  • Has systems which are functions that run for all entities matching a component query

For more information, check the ECS FAQ!

Show me the code!

C99 example:

typedef struct {
  float x, y;
} Position, Velocity;

void Move(ecs_iter_t *it) {
  Position *p = ecs_field(it, Position, 0);
  Velocity *v = ecs_field(it, Velocity, 1);

  for (int i = 0; i < it->count; i++) {
    p[i].x += v[i].x;
    p[i].y += v[i].y;
  }
}

int main(int argc, char *argv[]) {
  ecs_world_t *ecs = ecs_init();

  ECS_COMPONENT(ecs, Position);
  ECS_COMPONENT(ecs, Velocity);

  ECS_SYSTEM(ecs, Move, EcsOnUpdate, Position, Velocity);

  ecs_entity_t e = ecs_insert(ecs,
    ecs_value(Position, {10, 20}),
    ecs_value(Velocity, {1, 2}));

  while (ecs_progress(ecs, 0)) { }
}

Same example in C++:

struct Position {
  float x, y;
};

struct Velocity {
  float x, y;
};

int main(int argc, char *argv[]) {
  flecs::world ecs;

  ecs.system<Position, const Velocity>()
    .each([](Position& p, const Velocity& v) {
      p.x += v.x;
      p.y += v.y;
    });

  auto e = ecs.entity()
    .insert([](Position& p, Velocity& v) {
      p = {10, 20};
      v = {1, 2};
    });

  while (ecs.progress()) { }
}

Projects using Flecs

If you have a project you'd like to share, let me know on Discord!

Tempest Rising

Tempest Rising

Territory Control 2

image

Resistance is Brutal

image

Appulse

image

Rescue Ops: Wildfire

image

Age of Respair

image

FEAST

image

Gloam Vault

image

Antimatcher

image

Writ of Battle

image

Extermination Shock

image

The Forge

image

ECS survivors

image

Tome Tumble Tournament

image

Sol Survivor

image

After Sun

image

Flecs Hub

Flecs Hub is a collection of repositories that show how Flecs can be used to build game systems like input handling, hierarchical transforms and rendering.

Module Description
flecs.components.cglm Component registration for cglm (math) types
flecs.components.input Components that describe keyboard and mouse input
flecs.components.transform Components that describe position, rotation and scale
flecs.components.physics Components that describe physics and movement
flecs.components.geometry Components that describe geometry
flecs.components.graphics Components used for computer graphics
flecs.components.gui Components used to describe GUI components
flecs.systems.transform Hierarchical transforms for scene graphs
flecs.systems.physics Systems for moving objects and collision detection
flecs.systems.sokol Sokol-based renderer
flecs.game Generic game systems, like a camera controller

Language bindings

The following language bindings have been developed with Flecs! Note that these are projects built and maintained by helpful community members, and may not always be up to date with the latest commit from master!

Ähnliche Repositories
hashicorp/consul

Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.

GoGo ModulesOtherconsulservice-mesh
consul.io
30k4.6k
aframevr/aframe

:a: Web framework for building virtual reality experiences.

JavaScriptnpmMIT Licensevrwebvr
aframe.io
17.6k4.4k
floci-io/floci

Light, fluffy, and always free - The AWS Local Emulator alternative

JavaMavenMIT Licenseawsaws-emulation
floci.io/floci/
17k1.7k
donnemartin/awesome-aws

A curated list of awesome Amazon Web Services (AWS) libraries, open source repos, guides, blogs, and other resources. Featuring the Fiery Meter of AWSome.

PythonPyPIOtherawscloud
14.1k1.9k
skypjack/entt

Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more

C++MIT Licenseheader-onlymodern-cpp
github.com/skypjack/entt/wiki
12.9k1.1k
Unity-Technologies/EntityComponentSystemSamples

C#Otherburstmulticore-processors
8.2k1.7k
sschmid/Entitas

Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity

C#MIT Licensec-sharpunity
7.7k1.1k
weaveworks/scope

Monitoring, visualisation & management for Docker & Kubernetes

GoGo ModulesApache License 2.0visualizationmonitoring
weave.works/oss/scope/
5.9k723
aws/containers-roadmap

This is the public roadmap for AWS container services (ECS, ECR, Fargate, and EKS).

ShellOtherroadmapaws
aws.amazon.com/about-aws/whats-new/containers/
5.4k336
killop/anything_about_game

A wonderful list of Game Development resources.

Apache License 2.0unitycsharp
4k516
microservices-demo/microservices-demo

Deployment scripts & config for Sock Shop

PythonPyPIApache License 2.0microservicemicroservices-demo
microservices-demo.github.io
3.8k3k
valence-rs/valence

A Rust framework for building Minecraft servers.

Rustcrates.ioMIT Licensegamedevminecraft
valence.rs
3.3k165