Saving/loading with F1/F2 may result in broken tapes

Found a bug in R'n'D? Report it here!

Moderators: Flumminator, Zomis

Post Reply
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Saving/loading with F1/F2 may result in broken tapes

Post by Holger »

This thread covers the long lasting problems with tape recordings that sometimes result in broken tapes (which do not solve the level when replayed) when using F1/F2 for saving/loading a half-played game.

The interesting part here is that saving and loading half-played games using only the tape recorder buttons work just fine, and no problems with broken tapes are known using this approach so far. (That means, using the "eject" button to save a tape and using "play" (with or without "pause before end") to replay to a certain point, then pressing "pause" ("pause before end" automatically enters "pause" state), then pressing "record" to continue the game.)
BryanFRitt
Posts: 219
Joined: Mon Nov 13, 2017 4:16 pm

Re: Saving/loading with F1/F2 may result in broken tapes

Post by BryanFRitt »

The tape issues are the main one's that bugged me. e.g. I played the the Zelda game, and the timer had wrapped around twice, but when I went back to play the game(after exiting R'n'D), it had me dying around the 1st 94 minute mark. 100+ minutes of the game gone. From start to that point by Warp Forwarding was like half a dozen minutes or so. [distracted rough time estimate, didn't time it, maybe way off]
Life is partially trying to strike a balance between generating new things/ideas, and making sure they are good/organized. These extremes can be said to between gibberish mess and nothing said/done.
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Saving/loading with F1/F2 may result in broken tapes

Post by Holger »

The tape issues are the main one's that bugged me. e.g. I played the the Zelda game, and the timer had wrapped around twice, but when I went back to play the game(after exiting R'n'D), it had me dying around the 1st 94 minute mark. 100+ minutes of the game gone.
I truly feel very sorry for this, and I apologize for this extremely bad experience due to this very old and very nasty bug that I still wasn't able to fix! :-( :-(

I by myself lost comparable tape time when playing and trying to solve Zelda and Zelda II using the F1/F2 snapshot saving/loading functionality (as the tape-replaying takes so much time for these two custom-element-heavy levels)! Finally, I was only able to solve these two levels by using the bare tape recorder (without using F1/F2), resulting in many full-replay interruptions that each took several minutes. :-(

I just spend another hour of debugging and (mainly) test-playing a well-prepared (at least I thought so) test level with lots and lots of debugging output, but wasn't able to bring snapshot saving/reloading out of sync. I will definitely spend much more debugging and test-playing work into this bug, as I really want to fix it, but unfortunately I cannot promise anything. :-(

Where you (and anybody else) could help me here: Which are the most simple levels where you encountered this bug? Zelda / Zelda II are just too heavyweight for debugging, but I know that this problem also occurs on "standard" R'n'D levels (that do not feature lots of complex custom elements).

I also would like to know if this problem is limited to certain engines, or if it occurs with all game engines (R'n'D, Supaplex, EM/EMC)?

Really would like to finally track this one down and wipe it out! :-|
BryanFRitt
Posts: 219
Joined: Mon Nov 13, 2017 4:16 pm

Re: Saving/loading with F1/F2 may result in broken tapes

Post by BryanFRitt »

Holger wrote: Thu Feb 01, 2018 7:18 pm Where you (and anybody else) could help me here: Which are the most simple levels where you encountered this bug? Zelda / Zelda II are just too heavyweight for debugging, but I know that this problem also occurs on "standard" R'n'D levels (that do not feature lots of complex custom elements).

I also would like to know if this problem is limited to certain engines, or if it occurs with all game engines (R'n'D, Supaplex, EM/EMC)?

Really would like to finally track this one down and wipe it out! :-|
I've mainly been playing the Supaplex based ones, so I know it definitely happens with them. Looks like I have my 'EMC' set to 'AGA'. I don't know what 'AGA', 'ECS', and 'EMC' stand for or do. I remember playing with the settings when I first tried out R'n'D. Normally, if I can't figure out what a setting does, I'd leave a settings at it's default, but for this I didn't remember the default and just left it somewhere.

Looking at happens during a mess up, it looks as if the main character is doing moves from a different play segment, which of course usually end in death for where it's at. I noticed that after starting up R'n'D in trying to play back a saved game, if I stop it in the middle of it playbacking the tape, then exit the level, but not the game, the furthest the playback will go is the point where I stopped it originally, not where the tape actually goes to.

I can go through my old games and look for ones with a messed up tape, then post them. This bug should probably have it's own (sticky?) thread.
Life is partially trying to strike a balance between generating new things/ideas, and making sure they are good/organized. These extremes can be said to between gibberish mess and nothing said/done.
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Saving/loading with F1/F2 may result in broken tapes

Post by Holger »

I've split/moved this topic from the previous "Supaplex levels" thread, as it deserves its very own thread.
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: Saving/loading with F1/F2 may result in broken tapes

Post by filbo »

I have been convinced for years that when you finally find this, it is going to be an off-by-one error somewhere in the tick accounting. (Whatever the right term is.)

Somewhere, while splicing together the tape actions and the change-over to live, there is going to be a single 'tick' (shortest time, sub-move) either missing or added to the duration of the user's input or the playback from the tape. This is often harmless, as actions happen only at a certain point in the multi-tick move cycle, and also many playbacks would survive having many actual player actions delayed or moved forward a whole move cycle. But once in a while this puts a player action on move cycle too early or late and it actually matters relative to nearby game activity, and you die.

Oh, this could also manifest as different movement distances. If player presses and holds 'move left' for 20 ticks, and action is sampled every 8 ticks, then this is either a 2-square or 3-square move, depending where the sampling falls. Slide the sampling clock over by 1 tick and 1/8 of such long moves will be altered in length. (I think I'm remembering correctly that the fundamental heartbeat is 8 ticks per move? Well, whatever it is.)
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Saving/loading with F1/F2 may result in broken tapes

Post by Holger »

Ryan, I've split your post to a new thread, as this is a different bug (in fact, it's two separate bugs caused by small changes in version 3.3.1.0 and 4.0.1.0).
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Saving/loading with F1/F2 may result in broken tapes

Post by Holger »

I have been convinced for years that when you finally find this, it is going to be an off-by-one error somewhere in the tick accounting. (Whatever the right term is.)
Yes, I'm 99% sure you're right. The strange thing is that I wasn't able to detect any results of such a "bad splicing together", resulting in the frame counter going out of sync. I've added printing the frame counter when moving, and then did a lot of F1/F2 on a test level with a good amount of random elements (rocks to be pushed, randomly moving yam-yams etc.). Then I watched the frame counter for the last movement (to the exit, after solving).

When replaying, I never had a broken tape so far, with the frame counter of the last movement still being the same when recording. Nevertheless, I'm sure that the frame counter will be out of sync if I should ever encounter the problem of a broken tape resulting from heavy use of F1/F2. :-o

So if anybody knows a level (besides Zelda / Zelda II) where this happens more often than with others (to use it for testing, without spending days on test-playing), *please* let me know. :-|
BryanFRitt
Posts: 219
Joined: Mon Nov 13, 2017 4:16 pm

Re: Saving/loading with F1/F2 may result in broken tapes

Post by BryanFRitt »

I found around 33 Supaplex bad tape saves, 1 Emerald Mine bad tape saves, and 1 Zelda bad tape saves.
Most of these at some point the character starts acting like it's playing somewhere else, then dies.

Grouping
* Level, Approximate time on clock before death -> Time on clock after death

Emerald Mine
* 007, 1m21s-> 3m23s
Classic Original Supaplex
* 091 starts to round 4m, 5m30s->5m50s
* 108 5m -> 17m25s
Supaplex 01
* 011 4m20s-> 6m22s
Supaplex 03
* 003, 5m09s->7m20s
* 021 not showing finished, no death, <-- messed up one without death/finish
Supaplex 04
* 089, 3m->3m46s
Supaplex 95
* 012, death, 2m->3m54s
* 022, death, 2m50s->3m33s
* 056, ended at 4m55s ? messed up
* 066, 1m14s -> 5m12s
* 075, messed up one, no death
* 084, death 1m08s -> 2m09s
Supaplex 096
* 027, messed up one, ended up trapped
* 040, no death, but it's a messed up one
* 046, 2m04s->9m19s
* 053, death, look at timer messed up 5m45s -> 6m56s
* 058, just died, ~3m40s->9m08s
* 060, looks messing up around the 2m mark? no death
* 063, 3m40s ish messing up
* 064, death at like 1m50s -> 10m50s
* 067, 14m30s -> 17m34s
* 075, death 5m16s > 10m20s
* 083, 4m40s starts acting crazy then dies 4m53s->7m51s
* 098, 11m50s -> 12m55s
* 103, 2m50s->8m04s
* 108, 4m -> 12m57s
Supaplex 97
* 002, 1m -> 2m13s
* 007, 1m59s -> 4m11s
Supaplex 98
* 012, 2m-> 3m30s
Supaplex 99
* 022, 45s -> 4m33s
* 031, 2m08s -> 7m50s
* 051, 1m -> 5m00s
* 079, messes up around 3ms20s... 4ms35s->8m07s
Attachments
BadTapes.tar.gz
(49.99 KiB) Downloaded 248 times
Life is partially trying to strike a balance between generating new things/ideas, and making sure they are good/organized. These extremes can be said to between gibberish mess and nothing said/done.
BryanFRitt
Posts: 219
Joined: Mon Nov 13, 2017 4:16 pm

Re: Saving/loading with F1/F2 may result in broken tapes

Post by BryanFRitt »

[[literal humour on]]
Saving/loading with F1/F2 may result in broken tapes
I changed these shortcut keys, but I think I may still have these problems.
[[literal humour off]]

Note: I haven't really tested this out to see if this actually fixes the problem.
Life is partially trying to strike a balance between generating new things/ideas, and making sure they are good/organized. These extremes can be said to between gibberish mess and nothing said/done.
User avatar
RAP
Posts: 317
Joined: Sat Jun 19, 2004 6:44 pm

Re: Saving/loading with F1/F2 may result in broken tapes

Post by RAP »

Just watched all the tapes from BD2K3 by Alan Bond (this levelset for download: https://www.artsoft.org/RELEASES/rocksn ... -1.0.0.zip ) in version 4.0.1.1 for more idea gathering. Out of all of them, only one was a bad tape, which is level 10, "War!". Wondering if it is a slight gameplay change rather a tape recording change.
BryanFRitt
Posts: 219
Joined: Mon Nov 13, 2017 4:16 pm

Re: Saving/loading with F1/F2 may result in broken tapes

Post by BryanFRitt »

I wonder if 'pausing' the game has something to do with the broken tapes. Like quickly doing something like pause/unpause/pause/save/unpause/pause/save messing up the tape.
Life is partially trying to strike a balance between generating new things/ideas, and making sure they are good/organized. These extremes can be said to between gibberish mess and nothing said/done.
BryanFRitt
Posts: 219
Joined: Mon Nov 13, 2017 4:16 pm

Re: Saving/loading with F1/F2 may result in broken tapes

Post by BryanFRitt »

Murphy in transition state not saved on or recalled from tape?
Pause in the middle of moving Murphy to new a position, save tape state, exit level, reload tape, Murphy will be paused at the new position instead of paused in transition to the new position.
You can also do this without pausing too, if you save tape quick enough.

This may result in a segmentation fault in some cases, like when something might have fallen after Murphy moved to the the new spot, or this is done several times.
This probably related to the other segmentation fault issue I posted. Segmentation fault after 2nd reload from tape
Life is partially trying to strike a balance between generating new things/ideas, and making sure they are good/organized. These extremes can be said to between gibberish mess and nothing said/done.
Post Reply