World ticks can get ahead of map ticks/map ticks can get out of sync with each other (without async mode)
SokyranTheDragon opened this issue · comments
My assumption is that this is due to an exception being thrown while calling MapPreTicks
, as ticks are incremented after that. Relevant code:
Since we tick the world, as well as each map separately from each other, we can end up with situations where some maps didn't manage to properly tick. This results in them "falling behind" in time compared to others.
This was tested with harmony, core, DLCs, and mp. (both from the workshop)
Fresh save, async time disabled, pause on letter set to "any threat", Cassandra classic on adventure story.
Rimworld version: 1.4.3542
There seems to be some issues with the pause on letter feature, specifically:
-
Minor threats like mad animals correctly pause the map (colony), but do not pause the world, so both world time and ticks shown by the inspector tool keep increasing as if the game was not paused, this causes map time to fall behind world time;
-
Major threats like raids correctly pause the map, and pause the world time, but the speed UI on the world doesn't get updated, and ticks shown by the inspector keep increasing.
You have a way better idea than me if this has any practical impact, as technically this does not cause map and world time to fall out of sync.
On the other hand, if the raid is generated by dev tool instead of the storyteller, the pause on letter feature works as intended.
Pause on join and on desync work as intended.
Adding a second colony does not change the behaviour, and the pause on letter works as intended on both colonies, regardless of where the threat is generated.
Thanks for the info, it was enough for me to be able to find what's going on. No fix yet, will work on it soon, unless someone else grabs it in the meantime. However, to explain the situation:
- Pause on code gets called:
- This happens while (I assume) the map is still holding the state of TimeSnapshot:
- Once the map is done with whatever it was doing, it restores the TimeSnapshot to whatever stat it was previously. Since it was holding the state how it was before the time was paused, it sets the tick manager speed to what it was previously:
- The world comp returns the TickManager speed, instead of the internal value for its desiredTimeSpeed (like AsyncTimeComp does):