MinecraftTAS / TASmod

Minecraft Tool-Assisted Speedrun (TAS) Tools with input playback
https://discord.gg/jGhNxpd
GNU General Public License v3.0
30 stars 5 forks source link

KTRNG desyncing in loading screen #132

Closed ScribbleTAS closed 1 year ago

ScribbleTAS commented 2 years ago

Had a problem in the past where TASmod desyncs during the loading screen... Should implement #130 and #131 to test and to debug

ScribbleTAS commented 1 year ago

Round 2 of this nasty bug... This is related to #123 which makes this a lot worse than it should...

My brialliant idea was to just pause the recording/playback, whenever the player is not added to the chunk... This turned out to be bad for KillTheRNG, because while recording is paused, killtherng is ticking...

ScribbleTAS commented 1 year ago

This won't be the last time but for now it works...

The changes I've made to get this working:

1. Pausing the server when a player is connecting #153

Without that, the server ticks a few times during the loading screen, advancing Server KTRNG and desyncing it with the client

2. Stop advancing the server seed when the container state is PAUSED

This will make sure both client and server don't advance anything when the client is paused

3. Consistently pause the recording/playback when the world is done loading

Before, whether the recording/playback pauses depended whether the player was added to the chunk (This causes the player to be unable to move). Now, the recording consistently pauses on world load, making everything more stable

I haven't looked at multiplayer yet, which is a whole other can of worms... maybe #153 isn't necessary after all for that but for singleplayer it works