Rewind problem

Found a bug? Please report it, but remember to follow the bug reporting guidelines.
Missing a sane feature? Let us know!
But please do NOT request ports to other systems.

Moderator: ZSNES Mods

Post Reply
rlbond
Hazed
Posts: 82
Joined: Tue Jul 12, 2005 5:13 am

Rewind problem

Post by rlbond »

When rewinding multiple times, rewind "skips" some of its previous states.

It's best shown with a game with a timer such as super bomberman.
Set the rewind timer to something nice (I set it to 25/5 = 5 seconds).

Now, start a multiplayer game in super bomberman. The timer will start at 2 minutes. At 1:50, press rewind. Predictably, the game will go back to the previous state (it was 1:52 for me). This means there are rewind save states at the following in-game times:

1:57
1:52
1:47, etc

so now wait until the time is 1:45, and press rewind twice. The first time it will back up to the previous state (1:47), but the second time it will skip the 1:52 state and jump straight to 1:57. I hope that makes sense.
To truly own, you must own at all games.
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

It makes sense. I have already talked about that with Nach, because I don't find it satisfying.

This is the cause:
When a rewind state is saved, it sets a timer to the value chosen by the user. Once this timer reaches 0, another rewind state is saved.
When you press the key, it loads the last state and erases it without regard to anything else, then sets the timer to the current value - so after the time is spent again, it saves a state.

Little picture in case I wasn't clear enough:
t = 0s | Save 1
t = 5s | Save 2
t = 10s| Save 3
t = 12s| Load 3 - State 3 erased
t = 15s| Save 3
t = 20s| Save 4

So when you reload them successively, the 't = 10s' state effectively disappeared and you jump from 15 to 5.

I can fix that behaviour in a snap, but then you wouldn't be able to go 2 rewinds back (which means, baaad fix) because you'll reload the last one forever.
To fix it and keep prev-prev rewind load feature functionnal, we could mimic the code used for chapters in movies. This would require a bit of work to rewrite the rewind routines, of course.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Post by Noxious Ninja »

Couldn't you use a linked list for the rewind states? Or am I completely misunderstanding the problem?
Last edited by Noxious Ninja on Fri Sep 30, 2005 5:48 am, edited 1 time in total.
[u][url=http://bash.org/?577451]#577451[/url][/u]
rlbond
Hazed
Posts: 82
Joined: Tue Jul 12, 2005 5:13 am

Post by rlbond »

yes, or perhaps do some sort of "if it's been x seconds since I've made a rewind state, go back 1 state and erase that 1; if not, go back 2 and erase 2" kind of thing. Of course I have no asm experience so I don't know how hard this would be.
To truly own, you must own at all games.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Noxious Ninja wrote:Couldn't you use a linked list for the rewind states? Or am I completely misunderstanding the problem?
The latter.
rlbond wrote:Of course I have no asm experience so I don't know how hard this would be.
Main rewind code is in C.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

Nach wrote:Main rewind code is in C.
^_^ the second thing I worked on, and the first as official ZSNES dev.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
rlbond
Hazed
Posts: 82
Joined: Tue Jul 12, 2005 5:13 am

Post by rlbond »

well then, it probably wouldn't be too hard, compared to a lot of other stuff.
To truly own, you must own at all games.
Post Reply