Hey guys,
I haven't talked here for a while. I am in current development of WebGL game using AshJS port. Currently we are making our own "Ash" from the scratch, but using many guidelines established by Ash Framework itself. It will be open source eventually.
As subject already said, currently I am thinking about rather big design decision. I know that Ash creates new nodes on the fly when new entity is created or components changed. I am wondering if that's actually that good idea. In practice when using AshJS, we had found issues when some system made change some changes and nodes were created right away. Some systems that were working later suddenly had new nodes that weren't there just few steps back. It looks like very inconsistent state and it's somewhat hard to debug. And I am not even mentioning signals like nodeAdded or nodeRemoved that just synchronously interrupted everything and went for other batch of changes. These are major cause of many mistakes.
One sort of solution is to make sure that systems are ordered correctly. Frankly that kinda sucks. It creates one big layer of system dependency that is hard to maintain over time because it's really easy to forget that this particular system had to be run before this one. Of course I am not talking about changing values in components here. That's kinda essence of the whole thing and should happen as suspected. It creates small system dependency too, but not that major probably.
So I am thinking about solution that pretty much buffers added/updated/removed entities and they are processed at the end of current update cycle. When next update cycle starts there is some assurance that the state is consistent as the whole and it will no change somewhere in the middle.
Can you please tell me your opinions on this? Aren't there some possible caveats that could cause more trouble in the end?
Thanks!