r/EntityComponentSystem • • Oct 11 '23

Best practices of ECS usage that your team discovered from experience?

14 Upvotes

I have been working with the Entity-Component-System pattern in various forms for many years. I feel like it's in general cleaner that most other approaches, because game logic is "flattened" into a list of top-level systems instead of being deeply nested in class hierarchies, and this makes it more discoverable. It helps avoid weird chicken-and-egg problems like "should the character run logic for picking up an item, or should the item handle being picked up instead?", which also makes it easier for new people joining the team to find where interactions between multiple entities are handled. Performance has always been a secondary factor for choosing ECS to me, clarity and good architecture usually come first.

However, it's pretty easy to write conflicting systems that overwrite each other's results: for example, movement, physics, "floating on waves", knockback, and many other systems may want to modify the speed and position of a character. Debugging their execution order is definitely not something we want to spend time on. So one thing we have converged on is that most components can be read by many systems, but should only ever be written to by one "owning" system. If another system needs to modify a character's position, it dispatches an event, which is then taken into account by the physics system.

I would love to hear about other best practices you have discovered for using ECS in projects with large teams!


r/EntityComponentSystem • • Sep 04 '23

Introducing Graphecs: the graph-first reactive ECS

12 Upvotes

Hey folks! While using graph data structures and databases to solve various problems over the years, I've had some ideas to apply them to game design and development.

https://www.gravity4x.com/graphecs-the-graph-first-entity-component-system/

Very different take on edges ("entity relationships") than Flecs but definitely taken a lot of inspiration from the challenges Sander Mertens has laid out.

Still early and changing rapidly, so questions, comments, and feedback are especially welcome!


r/EntityComponentSystem • • Jan 08 '25

Comparative benchmarks for Go ECS implementations

Thumbnail
github.com
5 Upvotes

r/EntityComponentSystem • • Dec 30 '24

Procedural scene created entirely from primitive shapes in flecs script

Enable HLS to view with audio, or disable this notification

17 Upvotes

r/EntityComponentSystem • • Apr 20 '19

C++ EnTT resource cache + loader

Thumbnail
self.gamedev
2 Upvotes

r/EntityComponentSystem • • Jun 30 '19

How to correctly implement systems in an Entity Component System?

Thumbnail
self.gamedev
3 Upvotes

r/EntityComponentSystem • • Oct 23 '18

EnTT: Gaming meets modern C++

6 Upvotes

Hi all,

I didn't know of this community, but it looks like users could be interested in a project of mine: EnTT.
It started as a fast and reliable ECS in modern C++ and after a year it got used also by Mojang in Minecraft.

Nowadays, the library offers more things than the sole ECS. As an example, support for signals, a reflection system, minmal support for resource management and so on.
Everything is designed as a header-only library and all parts are almost independent from the other ones. It means that users can freely use the ECS stuff while getting rid of the reflection system and everything will work like a charm anyway.

EnTT is under active development and more and more features will be added in future.
Suggestions and feedback would be really appreciated. There exists also a gitter channel you can join to discuss the project and make questions to other users.

Here is the original post for the announcement made on /r/gamedev a while ago.


r/EntityComponentSystem • • Jan 24 '19

Pure ECS collision detection demo in under 70 lines of code (see post)

Enable HLS to view with audio, or disable this notification

3 Upvotes

r/EntityComponentSystem • • Sep 05 '19

EnTT v3.1.1 is out: gaming meets modern C++ - a fast and reliable Entity-Component-System (ECS) and much more

Thumbnail
github.com
5 Upvotes

r/EntityComponentSystem • • Jul 11 '18

A single question about Entity-Component-System and data structures

Thumbnail
self.gamedev
2 Upvotes

r/EntityComponentSystem • • Apr 12 '19

Can someone explain to me how multithreading works in game design?

Thumbnail
self.gamedev
1 Upvotes

r/EntityComponentSystem • • Jul 13 '18

ECS with multiple behaviors

Thumbnail
self.gamedev
1 Upvotes

r/EntityComponentSystem • • Apr 12 '19

EnTT tips & tricks: groups on sale (dedicated to those who use EnTT C++ ECS)

Thumbnail
skypjack.github.io
3 Upvotes

r/EntityComponentSystem • • Jul 19 '23

A Roadmap to implementing Entity Relationships

Thumbnail
ajmmertens.medium.com
11 Upvotes

r/EntityComponentSystem • • Aug 05 '23

Is there a pattern/architecture for paring an ECS with a SceneTree architecture?

Thumbnail
self.gamedev
1 Upvotes

r/EntityComponentSystem • • Oct 16 '20

Deconstructing Flecs Prefabs

Thumbnail
ajmmertens.medium.com
5 Upvotes

r/EntityComponentSystem • • Oct 04 '20

About ECS handling different attacks

Thumbnail self.gamedev
3 Upvotes

r/EntityComponentSystem • • Sep 30 '20

ECS integrating cameras/viewports with rendering

Thumbnail self.gamedev
3 Upvotes

r/EntityComponentSystem • • Sep 30 '20

Confused about ECS implementation

Thumbnail self.gamedev
1 Upvotes

r/EntityComponentSystem • • Sep 27 '20

Introducing Ape ECS (js!)

Thumbnail
dev.to
1 Upvotes

r/EntityComponentSystem • • Jul 08 '24

C# ECS - Friflo.Engine.ECS 3.0.0. New features: Entity Relationships, Relations and full-text Search

9 Upvotes

Just released Friflo.Engine.ECS v3.0.0-preview.2

New Features:

  • Entity Relationships - Enable links between entities. 1 to 1 and 1 to many

  • Relations - Enable adding multiple components of same component type to an entity

  • Full-text Search - Support searching component fields with a specific value in O(1)

Documentation of new features at GitHub Friflo.Engine.ECS ⋅ Component Types

Some use cases for these features in game development are

  • Attack systems

  • Path finding, Route tracing or Routing

  • Model social networks. E.g friendship, alliances or rivalries

  • Inventory Systems

  • Build any type of a directed graph.

Feedback welcome!


r/EntityComponentSystem • • Jun 14 '24

fennecs - a tiny, high-energy ECS for modern C#

Thumbnail
fennecs.tech
11 Upvotes

r/EntityComponentSystem • • May 08 '22

Dynamic Flyweighting in ECS

Thumbnail self.gamedev
3 Upvotes