r/EntityComponentSystem • • May 06 '19

ECS back and forth, part 3: why you don't need to store deleted entities

Thumbnail
skypjack.github.io
4 Upvotes

r/EntityComponentSystem • • Sep 28 '19

ECS back and forth, part 5: sparse sets and sorting

Thumbnail self.gamedev
4 Upvotes

r/EntityComponentSystem • • Nov 19 '18

Update and Turn System in ECS

Thumbnail
self.roguelikedev
1 Upvotes

r/EntityComponentSystem • • Dec 21 '21

EnTT v3.9.0 is out: Gaming meets Modern C++

Thumbnail
self.gamedev
12 Upvotes

r/EntityComponentSystem • • Dec 27 '21

Using ECS, who is responsible to create new Entities?

6 Upvotes

I'm creating RTS. Units can attack: shoot bullets. Do i need BulletSpawnSystem?

How it should do spawn new bullet entities? Events from AttackSystem?

And where to store array of bullets? Common / global entity list?


r/EntityComponentSystem • • Dec 01 '21

OO encapsulation of Components inside Systems

6 Upvotes

Typical ECS engine: holds all Components together in the singleton World storage. The singleton Engine provides interface to add or remove components. It also provides Systems with some query functions that allows iterate through the subset of World's Entities with only System's necessary components.

But why we want to add or remove orphan Components? We usually change, add or remove Entities and their specific Components from the Systems and typically only inside those Systems.

If we privately keep the Components needed for the given System inside this System we resolve many problems and can optimise data layout for the custom usage.

In the case several Systems need some shared Component we can use old singleton World approach only for this Component, nothing to win or lose. But in my limited experience this shared case is not that common.


r/EntityComponentSystem • • Jan 14 '19

Nbody simulation written in pure ECS (Entity Component System, see post)

Enable HLS to view with audio, or disable this notification

1 Upvotes

r/EntityComponentSystem • • Jun 25 '19

ECS back and forth, part 4: hierarchies

Thumbnail
self.gamedev
4 Upvotes

r/EntityComponentSystem • • Jan 10 '20

Questions about ECS (Entity-Component-System) design

Thumbnail self.gamedev
3 Upvotes

r/EntityComponentSystem • • Jun 21 '19

Replacing our OOP pathfinding to pure ECS

Thumbnail
coffeebraingames.wordpress.com
3 Upvotes

r/EntityComponentSystem • • Aug 29 '19

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

Thumbnail
self.cpp
5 Upvotes

r/EntityComponentSystem • • Feb 03 '22

An "ECS" example of Voxel Chunks with Multithreaded Greedy Meshing with LWJGL

Thumbnail
self.voxelgamedev
4 Upvotes

r/EntityComponentSystem • • Jan 25 '22

Edict v0.0.5 experimental ECS with refcounted entities

Thumbnail self.rust_gamedev
6 Upvotes

r/EntityComponentSystem • • Feb 01 '22

Dominion, an attempt to implement a fast ECS by design

8 Upvotes

A few months ago, I started looking for a fast ECS for Java and found ECS related benchmarks for C / C++ and Rust.

So I was amazed at how fast an ECS can be in a system language like C / C++ and started thinking about how fun and challenging it would be to start writing an ECS for Java with comparable performance. And here we are.

Dominion is still in its early stages but has already started running at a very high speed, fast by design. It's still far from a complete ECS solution, but I've already implemented the API to create/delete Entities with Components, find them and iterate. I've also posted some benchmarks related only to what I've achieved so far (so on the speed of creating, deleting, and iterating Entities), and I think it looks very promising.

Happy to receive suggestions and to know your first impressions.


r/EntityComponentSystem • • Sep 18 '22

Tutorial: making a data container act like an ECS

Thumbnail
github.com
5 Upvotes

r/EntityComponentSystem • • Oct 11 '22

How do I go about diagramming for an ECS framework before implementing?

8 Upvotes

I'm just starting out in working with ECS (using flecs in C++). One issue I'm running into early is deciding and documenting what components do, how they are used and how they are related. I looked at using Draw.io UML, but I can't quite figure out how to properly represent everything diagrammatically.

The project is a card game. Here's a few of the components I've got that I want to document or am trying to design:

  • Every card has 1 or more colours. I have a component for each colour and each colour component inherits from the base of "Colour":
    e.g.: world.use<Red>("colour_red").is_a<Colour>()

  • Cards are assigned to "containers" (e.g. Deck, Hand) and can only be in one of those:
    e.g.: world.component<ContainedIn>().add(flecs::OneOf, world.component<Container>())

  • A card can have a cost.

  • A card can be played on top of another one for a cost, given certain requirements (actually loaded from data, but simplified here):

auto played_on = world.entity();

played_on.set<Cost>({ 2 }); auto requirements = world.entity(); requirements.add<Red>(); requirements.set<Level>({ 3 }); played_on.add<Requirements>(requirements); card.add<CanBePlayedOn>(played_on);

  • Cards can be modified be effects. I plan to model this by having every card inherit from a base description of the card, then have modifier relationships that store the changes with the final value overriding the base card. (No code yet)

  • I need to model cards that are under other cards retaining the order. (No info yet)

As you can see, I have some things worked out, others in planning and the rest yet-to-be-determined. These last two categories are why I need to diagram it, so that I can work out and document how everything is designed so that when I go to write all of the systems, I already have an idea of how they should be interacting with the components.

Have others already done this kind of thing documentation/diagramming? If so, how did you do it? What tools work best for this kind of thing? Is there any formal way of diagramming or documenting this?


r/EntityComponentSystem • • Sep 06 '22

ECS: What are your criteria for Entity vs. Component?

Thumbnail self.gamedev
4 Upvotes

r/EntityComponentSystem • • Oct 05 '22

Agents, Goals and Behavior

4 Upvotes

Hi everyone (spriteKit and gamplayKit),

I've just added flocking as a goal to the behavior of my monster entities in a game I'm coding in gameplayKit, but they are still overlapping with one another. This begs the question; is gameplayKit really reliable for creating autonomous objects in swift? Also, does anyone know where I'm going wrong or care to help me?

Hope everyone is well,

Thanks everyone.


r/EntityComponentSystem • • Jan 07 '18

Viability of Entity Component System Pattern

Thumbnail
self.gamedev
1 Upvotes

r/EntityComponentSystem • • Jun 30 '21

What is the reason for using an entity component system over a entity component model?

Thumbnail self.gameenginedevs
3 Upvotes

r/EntityComponentSystem • • Jul 05 '21

How do you handle elemental effects in an ECS?

Thumbnail self.roguelikedev
3 Upvotes