Furball-Engine / Furball

A Game Engine designed in C# using a custom made Renderer called Furball.Vixie, uses a similiar design to the Engine peppy made while developing osu!stable

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Technically Not An ECS

SorenSaket opened this issue · comments

Furball.Engine.Engine.ECS is not a traditional ECS. Entity Component System systems are often confused with Entity Component systems. This "ECS" seems to be a hybrid approach. It isn't implemented in such a way that you could define it as a ECS nor does it gain the advantages.

With a properly implemented ECS you can gain the following advantages:

Architectural advantages:

  • Fully decoupled systems allow for less bug prone and more data oriented functions.
    • Systems usually query a world to get the entities to perform operations on. They do not have to worry about the specific entity composition.

Speed advantages:

  • Since systems are working with an array of entities, vectorization is possible.
  • Memory is packed in such a way to minimise cache misses.

To gain these advantages you have to both conceptually and practically separate Entities, Components and Systems.
These are the main problems preventing it from gaining these advantages:

  • Entity is a class that holds its own state in the form of components. Therefore there is no data locality between components on different entities.
    • Furthermore the components themselves are classes and have reference type fields within them.
  • Since systems are also stored on the entities they cannot operate on multiple at a time.

Possible solutions:

  • Move towards a more simplistic (and in this case faster) Entity Component system instead.
  • Reimplement as a real "Entity Component System system" with strict attention to memory layout.

Possible futher reading material:
Wiki ECS
Sander Mertens Medium Blog
Algorithmica on Performance Engineering

We know and we don't need 50 people telling us 'ehh aktshually its not an ECS!!!'

Sorry for the inconvenience

Removed ECS entirely as it doesn't fit with the overall workflow of the engine