You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(This is a slightly adjusted version from my thread in the discord issues-forum, but since I have an assumption what causes the bug I think it's appropriate to post here too)
Rimworld version: 1.5.4297 Multiplayer mod version: TEST RELEASE v2 for RW 1.5.4104+ Settings: Single faction, Synced time, LAN (shouldn't matter though) Mods: a few enabled, but reproduceable without any mods
Description:
When encountering any caravan event that makes a dialog window on the world map to provide options (IncidentWorker_CaravanMeeting / IncidentWorker_CaravanDemand) the game doesn't pause in the background, even though it displays it as paused on the game UI bottom right.
What makes it worse is that there is no way to actually pause the game because it instantly jumps to the world map to that dialog window and the time controls become non-interactable, because the dialogue window is modal.
So the game is running in the background but you can't actually see what's happening until after choosing one of the options in the window. This makes it extremely stressful to read the text, choosing options or trading. It is especially bad when the game was at 2x or 3x speed when it happens, because the game just keeps running at that speed.
Another bug that's arises from this and that is actually soft-locking your game, is that when your caravan arrives while the event window is still open. Then the window becomes empty and cannot be clicked away. You then have to reload the last save.
Cause:
I've done some digging in the code and might have found the issue. I'm not pretending to know how the mod works in detail so sorry if this is completely wrong, but here's what I found:
All dialogs that force pause the game by default seem to create a persistent dialog and their own session where the time control is then handled through that session through the SessionManager. This applies for trading, caravan forming/splitting, rituals etc.
Caravan encounters (IncidentWorker_CaravanMeeting & IncidentWorker_CaravanDemand) don't do this, even though in vanilla Rimworld the dialogs that are created through these incidents in TryExecuteWorker() pause the game (forcePause = true).
In multiplayer the dialogs are merely synced with "Sync.RegisterSyncDialogNodeTree(typeof(IncidentWorker_CaravanMeeting)...);"
The forcePause that handles the pause in vanilla is by default disabled by the multiplayer mod through a patch on WindowStack.WindowsForcePause, meaning the game will not ACTUALLY pause, even though the UI still shows it.
Since the dialog is also modal (absorbInputAroundWindow = true), it is also impossible to actually really pause the game and it will just keep running in the background until the window is closed again.
Possible fixes:
I guess the simplest and lowest effort way to fix it would be that when a Dialog_NodeTree is synced with Sync.RegisterSyncDialogNodeTree(...), the patch that then applies should check if that Dialog_NodeTree has forcePause = true. If it does, simply actually really pause the game through however the mod handles time.
The clean approach would probably be to create a new session type for these encounters and handling syncing and time through the session, like trading sessions or ritual setup sessions are handled, but that's probably way more work.
The text was updated successfully, but these errors were encountered:
(This is a slightly adjusted version from my thread in the discord issues-forum, but since I have an assumption what causes the bug I think it's appropriate to post here too)
Rimworld version: 1.5.4297
Multiplayer mod version: TEST RELEASE v2 for RW 1.5.4104+
Settings: Single faction, Synced time, LAN (shouldn't matter though)
Mods: a few enabled, but reproduceable without any mods
Description:
When encountering any caravan event that makes a dialog window on the world map to provide options (IncidentWorker_CaravanMeeting / IncidentWorker_CaravanDemand) the game doesn't pause in the background, even though it displays it as paused on the game UI bottom right.
What makes it worse is that there is no way to actually pause the game because it instantly jumps to the world map to that dialog window and the time controls become non-interactable, because the dialogue window is modal.
So the game is running in the background but you can't actually see what's happening until after choosing one of the options in the window. This makes it extremely stressful to read the text, choosing options or trading. It is especially bad when the game was at 2x or 3x speed when it happens, because the game just keeps running at that speed.
Another bug that's arises from this and that is actually soft-locking your game, is that when your caravan arrives while the event window is still open. Then the window becomes empty and cannot be clicked away. You then have to reload the last save.
Cause:
I've done some digging in the code and might have found the issue. I'm not pretending to know how the mod works in detail so sorry if this is completely wrong, but here's what I found:
All dialogs that force pause the game by default seem to create a persistent dialog and their own session where the time control is then handled through that session through the SessionManager. This applies for trading, caravan forming/splitting, rituals etc.
Caravan encounters (IncidentWorker_CaravanMeeting & IncidentWorker_CaravanDemand) don't do this, even though in vanilla Rimworld the dialogs that are created through these incidents in TryExecuteWorker() pause the game (forcePause = true).
In multiplayer the dialogs are merely synced with "Sync.RegisterSyncDialogNodeTree(typeof(IncidentWorker_CaravanMeeting)...);"
The forcePause that handles the pause in vanilla is by default disabled by the multiplayer mod through a patch on WindowStack.WindowsForcePause, meaning the game will not ACTUALLY pause, even though the UI still shows it.
Since the dialog is also modal (absorbInputAroundWindow = true), it is also impossible to actually really pause the game and it will just keep running in the background until the window is closed again.
Possible fixes:
I guess the simplest and lowest effort way to fix it would be that when a Dialog_NodeTree is synced with Sync.RegisterSyncDialogNodeTree(...), the patch that then applies should check if that Dialog_NodeTree has forcePause = true. If it does, simply actually really pause the game through however the mod handles time.
The clean approach would probably be to create a new session type for these encounters and handling syncing and time through the session, like trading sessions or ritual setup sessions are handled, but that's probably way more work.
The text was updated successfully, but these errors were encountered: