Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Savestate fixes #214

Merged
merged 44 commits into from
Dec 13, 2024
Merged

Conversation

ScribbleTAS
Copy link
Member

@ScribbleTAS ScribbleTAS commented Jul 13, 2024

General fix PR for Savestates and more...

Highlights

World swapping

Instead of only swapping out the chunks when loading a savestate, the entire world list is now swapped out. This fixes a multitude of issues I had with savestates, for example some redstone components not working correctly, scoreboards not getting applied and even more things that might not be as obvious... Over all the savestates should be a lot more robust this time around.

Savestates across dimensions

This was the main focus of this PR, then I sidetracked and found a lot more issues, delaying everything. #116 always gave me some trouble, but now savestates should load across dimensions on the first try!

Changes

  • [Gui] Readded keystrokes to the gui
  • [FileCommands] Added more precision to desyncMonitor
  • [Gui] Changed DesyncMonitor values from relative to absolute
  • Added hash to dev-build filename and ingame hud
  • Removed "savestates are broken" warnings from the chat
  • [Savestates] Switched to Paths instead of Files
  • [Savestates|Config] Reworked Config and other files
  • [Savestates] Switched from storing motion in the playerdata to storing motion in World/tasmod/clientMotion.json
  • [Gui] Removed "TASmod is still in development! Major issues may arise!" message in gui screens

Fixes

Rework

I am by no means done with the savestate code... While working on this, I took a break and worked on LoTAS-Light implementing and testing the new savestate indexing system I proposed in MinecraftTAS/LoTAS#111 and I quite like the new system... Going back to this made me realise how necessessary a rewrite of the savestate code is and with the new insights in the savestating I gained, I am much more optimistic about porting savestates over to new versions. But all of this can wait for now...

@ScribbleTAS
Copy link
Member Author

ScribbleTAS commented Jul 17, 2024

Writing this down so I don't forget:

  • The savestate applies the camera angle correctly, but the next tick resets it to the view before the savestate...
    -> set the camera values after a savestate...

The camera angle was omitted, when the previous tick or subtick was the same.
However, this creates huge problems with savestates.
Now, full ticks will always contain the camera angle, while subticks may be ommitted

- Added scheduling to savestate client packet handler
…estate

This happens when you load a savestate during playback.
To fix this, a new parameter was introduced to the serialiser called `processExtensions`.
Setting this to true will prevent loading metadata and filecommands
and only get the TickContainers out of the TASfile.
- Swapped yaw and pitch in InfoHud
- Trying to fix errors with the future task queue during loadstate
- Trying to fix a crash with a tickList being out of sync
@ScribbleTAS
Copy link
Member Author

ScribbleTAS commented Jul 27, 2024

More weirdness where savestates come from...

  • The server seems to store yaw and pitch the wrong way around?
  • The world is not loaded instantly after a savestate was loaded,
    causing the player to hang in the air for a moment which desyncs the savestate

- Fixes pressure plates and other timed components not unpressing after a loadstate
- [MCTCommon] Fix eventlistener not checking for interfaces in the super class
This happens when loading a savestate across dimensions
The solution was to redo the dimension loading class
without adding the player to the chunk map.
The game will be stuck on "Loading terrain" however,
so an extra packet has to be sent to clear the loading screen
This can happen after loading a savestate, effectively stranding you in the nether...
Solution is to clear the "portal cache" after loading a savestate
- Should fix a lot of issues that I may had to patch manually in the past
@ScribbleTAS ScribbleTAS marked this pull request as ready for review December 13, 2024 15:02
@ScribbleTAS ScribbleTAS merged commit 96c1cbd into MinecraftTAS:develop Dec 13, 2024
2 checks passed
@ScribbleTAS ScribbleTAS deleted the fix/savestates branch December 13, 2024 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Savestates Issue is related to savestates
Projects
Archived in project
2 participants