Skip to content

Instantly share code, notes, and snippets.

@PoignardAzur
Created October 18, 2019 12:54
Show Gist options
  • Save PoignardAzur/10a099c8359195074cf57b2e5f054dbd to your computer and use it in GitHub Desktop.
Save PoignardAzur/10a099c8359195074cf57b2e5f054dbd to your computer and use it in GitHub Desktop.
Notes on ECS architecture

See Pocket

The main semantic interest (beside performance benefits) is the ability to write

if (entity.hasComponent!Foobar)
  entity.component!(Foobar).doThing(...);

Also, apply a system only to entities with the relevant components (example?)

Every system has two tiers of coupling: the components it uses, and other systems using the same components.

That architecture is most useful when the data stored by a component has an unambiguous interpretation, and systems mutating a same component are aware of each other.

A difficulty of ECS architectures is cases where the developer wants to establish a non-trivial object graph (example?)

(for performance concerns, see Slot Map data structure)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment