News:

Herr Otto Partz says you're all nothing but pipsqueaks!

Main Menu

25 minutes replay

Started by alanrotoi, December 23, 2021, 01:38:29 AM

Previous topic - Next topic

alanrotoi

Easy to reproduce:
1. race against an opponent
2. choose a track with a pipe like in the picture
3. the opponents are very slow in that element so you can stuck them quiet easy
4. I did it crashing against the mid block then he came and couldn't pass. The opponent always choses the right way and as he goes too slow it won't crash againt you.
5. He'll stay there 25 minutes but as I crashed I couldn't save the replay but I could watch it.

I hope this find helps somehow to understand the replay time limit.

Cas

Oh, so when it reaches 25 minutes, it just stops?  In theory, as long as the player has finished or crashed before 10 minutes have elapsed, the opponent can take whatever amount of time without causing any memory overwrite, since only the key presses from the player are to be stored. However, the current tic number has to be kept track of. For the 10 minute limit (which is a memory region size limit), the number of tics is:

10 (minutes) x 60 (seconds in a minute) x 20 (tics in a second) = 12000

... corresponding to the number of bytes used to store the replay. But even if memory is not a concern, for a 16 bit unsigned integer, this counter should overflow at 65536 and if it's signed, at 32768. The images show that this stops exactly at 25 minutes, which equals 30000 tics, suggesting a good round number lower than 32768 was picked by the programmer to prevent the overflow and that the replay is stopped preemptively.
Earth is my country. Science is my religion.

Daniel3D

Even if the replay is stored at half the ticks (like I had at first because of a not ideal DOSBox setup) the replay file is about half the size but still capped at 25 minutes.
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

afullo

The overflow at 32768 tics can be confirmed by taking a penalty time such that the sum with the elapsed time is higher than 27:18.35 (32767 tics): the total time would be displayed as negative, as in an earlier topic from 2018 I already showed (I'm from phone and unable to link it on the fly, but in the case I will be able later).

Daniel3D

Quote from: afullo on December 24, 2021, 09:51:16 PM
The overflow at 32768 tics can be confirmed by taking a penalty time such that the sum with the elapsed time is higher than 27:18.35 (32767 tics): the total time would be displayed as negative, as in an earlier topic from 2018 I already showed (I'm from phone and unable to link it on the fly, but in the case I will be able later).
http://forum.stunts.hu/index.php?topic=3409.msg72638#msg72638
Here is the post.
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

alanrotoi

So, is it possible to make more space for player replays?  ::)

Daniel3D

No. You get memory overflow problems.
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

Cas

Wow!  Looking at that post, I realise how volatile my memory is  ;D

And yes, I remember having tested at low frequency, whether the 10 minute limit could be exceeded safely and the result was a negative. I don't remember, however, whether Stunts would stop normally or crash.
Earth is my country. Science is my religion.