Настроение: | amused |
Alternatives to ECS
Some people evade ECS by using hierarchical state machines (HSMs), which makes processing complex objects somewhat manageable:
https://statecharts.dev/state-machine-state-explosion.html
https://statecharts.dev/what-is-a-statechart.html
A compound state can be split up into completely separate (“orthogonal”) regions. Each region specifies its own state machine. When a state machine enters such a state, it also enters all of the regions of the state at the same time.
They still convolve barely related concepts (i.e. "change" and "validity" in that example), so HSMs fall apart for larger projects (larger than a Pong game).
I think something as simple and basic as a Tetris game or a chat server core will be a challenge to represent with HSMs.
Like sawing a tree with a pocked knife.
Of course all these paradigms can be combined together. Nothing stops you from using ECS with HSM.
In fact, I implemented the entirety of classic OOP using ECS.
Since I've transitioned existing code;
And I want object aspects to be tangible and have associated methods.