We could convert this whole thread to an announcement thread for your library and then let the first screen shot create the screen shot thread?
Yes, the authorâs margin call-out is key:
Some component systems take this even further. Instead of a GameObject
that contains its components, the game entity is just an ID, a number. Then, you maintain separate collections of components where each one knows the ID of the entity its attached to.
These entity component systems take decoupling components to the extreme and let you add new components to an entity without the entity even knowing. The Data Locality chapter has more details.
Essentially, he makes a classic error of grabbing one feature of what an entity component system is and deciding itâs the âsame thingâ. It throws away a lot of the goodness for some short term design convenience. And itâs very unfortunate. I wish I had time to go through the material in more detail to point out the numerous pitfalls.
The original idea for an ECS came from a design constraint where it was necessary to stream read-only memory in small chunks that produce new output data also streamed. Components were immutable because they were packed contiguously into entity blocks in RAM and the system would stream over them⌠it would then produce new packs of components into the output.
I like to think of that as the RAM equivalent of iterating over the results of an SQL query and writing data to another table. The SQL results have only the fields that are necessary and we write out only what we need. (Edit: if itâs not clear, I can provide an example of what I mean.)
In this way we can handle millions of ârowsâ without ever holding them all in RAM⌠which was a constraint of the streaming memory architecture where you had only a relatively small view of the stream at any given time.
From this design constraint, the other benefits sprung forth⌠many of which become impossible/infeasible if components are mutable. (Zay-ES allows mutable components but then the component-writer has to take a bunch of other things into account. I do this with the BodyPosition component which then gets several extra classes of support code just to be mutable.)
So if a game patterns author wants to treat entities like a fancy hashmap so systems can be a little bit decoupled, thatâs fine⌠but when calling it an ECS, I look at it with side-eyes. He skimmed the surface feature cream off and left the cappuccino in the cup.