mishagp / PauseInMultiplayer

A Stardew Valley mod that pauses time in multiplayer sessions when appropriate. 1.6 compatible!
13 stars 5 forks source link

Local multiplayer mode pauses time permanently #4

Open mishagp opened 7 months ago

mishagp commented 7 months ago

Reported on Nexus Mods:

The local multiplayer mode pauses time permanently while this mod is active. We noticed it after playing for the first time after we had a cutscene. I’d experiment more but my sister already’s moved onto something else, sorry!

mishagp commented 6 months ago

Tried to reproduce this myself but was unable to initially. https://github.com/mishagp/PauseInMultiplayer/assets/6118330/c6cbf542-0e2a-4bc2-bb0f-f259414b47ca

Judging from bug reports on the mod's previous Nexus page it seems like this is definitely something folks are experiencing, but not sure what specifically seems to be triggering this state.

CleanShot 2024-04-16 at 20 49 58@2x

I'd welcome more investigation into a reproduction and/or fix!

Xemrox commented 2 months ago

heya using 2 controllers I was easily able to reproduce the error in a local coop session. here are some of my observations so far:

xhhdestiny commented 2 months ago

don't work in local split screen mode.

Xemrox commented 2 months ago

Here we go. It bothered me a LOT. Enaugh to have a look at the source code and to debug it. From what I've seen its pretty easy to reproduce and it solely happens if you play split-screen-coop. What happens in detail? bool votePause = false; https://github.com/mishagp/PauseInMultiplayer/blob/b5e2001de2f2e284fb6508b44e887dd0eb1f1cf0/PauseInMultiplayer/PauseInMultiplayer.cs#L40C9-L40C32 This state is shared between all local instances. So either guarding against double write access (local / split-partner) or removing it entirely and replacing this state with something that is bound to the Game1.player.UniqueMultiplayerID should fix it. FYI, I am in the midst of rewriting the main functionality already. @mishagp if you like I can drop it here as a large PR but it'll be a large change throughout the code.