Auroriax / PuzzleScriptPlus

Puzzlescript Plus: Open Source HTML5 Puzzle Game Engine (with lots of extra functionality)
https://auroriax.github.io/PuzzleScript/
34 stars 4 forks source link

On a very big level, undoing 3 times results in resetting the metadata. #119

Open athin2008 opened 1 year ago

athin2008 commented 1 year ago

Describe the bug On a very big level, undoing 3 times results in resetting the metadata. The issue was also mentioned here.

Reproduction Steps

  1. Create a single level with a size of 100x100 and runtime_metadata_twiddling on.
  2. Put a button where the player can change the smoothscreen e.g. LATE [Player Button] -> [Player Button] smoothscreen 3x3 1x1.
  3. Player goes to the button, walks around a bit, and then undo 3 times.

What did you expect would happen? The smoothscreen should still be 3x3 unless the undo passed the button.

OS & Browser version, desktop/mobile Windows 11, Firefox

Screenshots, example projects, other relevant issues, etc.

It has the following error:

RUNTIME METADATA TWIDDLING: Reloaded level state that did not have saved metadata. Likely this state was recovered from a CHECKPOINT. Using the default metadata instead.

This issue also appeared when we were working with a checkpoint and restarting a level.

Reproduction Steps 2

  1. Create a single level with a size of 100x100 and runtime_metadata_twiddling on.
  2. Put a button where the player can change the smoothscreen e.g. LATE [Player Button] -> [Player Button] checkpoint smoothscreen 3x3 1x1.
  3. Player goes to the button, walk for just 1 unit, and then restart the level (press R).
Monakrom commented 11 months ago

similarly, on very big levels, smoothscreen is not updated upon undo, which means that the player is eventually undoing stuff they can't see. Besides being just something that isn't supposed to happen, it also makes experimentation and undoing large swaths of stuff in these big levels a pain in the ass.

it's more nuanced than just big = bad (Skipping Stones To Lonely Homes, in my testing, works just fine with smoothscreen. Enigmash does not.) but I admittedly can't figure it out beyond the fact that it's probably an individual level thing and not anything to do with a game as a whole.

david-pfx commented 11 months ago

I don't get it. Smoothscreen is just a setting applied during rendering. The undo storage should be exactly the same as any other level and/or metadata. Why does the size of the level matter, and why is it not updated? [I'm happy to look into it, but more info would help.]