2 ms·
> > Tangent: determinism and replay > > You need to make sure entities are always updated in the same order. This means deterministic O(1) datastructures like
by meheleventyone 2y ago
> > Tangent: determinism and replay
> > You need to make sure entities are always updated in the same order. This means deterministic O(1) datastructures like pools are your friend.
> That's not actually required. But I guess Go makes this the least painful avenue forward?
The formulation isn't complete but they're correct for what they're getting at. It should be:
"You need to make sure entities are always updated in the same order iff the order matters to the end result."
For example if you move entity A before entity B and collision check on move to make sure it's valid if A and B would intersect after moving without collision checking you will end up with different positions of A and B depending on which goes first.
Your choices then are to make sure entity update order is deterministic or rework the problem so it doesn't have the ordering dependency. The latter can be quite hard to do and the conditions where there is an ordering dependency can be subtle and unintuitive making it hard to cover all cases.