3 ms·
Can someone with experience of entity component systems (ECS) please chime in? My understanding is that games are not written in the manner that the author say
by tome 6y ago
Can someone with experience of entity component systems (ECS) please chime in? My understanding is that games are not written in the manner that the author says is so easy, rather they are written as pure functions operating on a big table of world state. The world state happens to be mutable for efficiency, but that's an implementation detail. Then again I've never worked with ECS so perhaps this my misconception.
- Jare 6y agoECS changes the way you access and mutate the world, compared to classic data graph / reference tree, more classic pervasive singletons ("managers"), or even more classic straight global variables. But in ECS engines you still access a portion of global world state you're interested in, and you mutate some portion of it. The ability to declare what those portions are, when present, allows ECS engines to do stuff like parallel execution of systems, and it also prevents a host of data races, but imho there's nothing really functional / pure / immutable about it.
- imtringued 6y ago>pure functions operating on a big table of world state Who told you that? Sure you can simplify it as a function that is operating on a big table but there is no requirement for it to be pure. An attacking Entity A can mutate the HP values in entity B directly.