Deprecated: Function create_function() is deprecated in /home/customer/www/ on line 811

Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/ on line 814


Topic: Timer bug -- 0.75 seconds => goes out of phase

Bug Report
    Attached are two maps. The one ending in "bug" is as follows: One of them has 3 moving platforms and 4 switches (two are superimposed). The green platform has smooth 1, and blue and orange are smooth 0. The switches have a 0.75s timer. The path_corners that move the platforms are 2.25s and 0.75s. The platforms disalign if you use their switch for long enough. After 8 cycles of orange, it is impossible to reach the goal.
    The second map (ending in "fixed") changes the timing to 0.7 and 2.1, and everything works fine. After 16 cycles there is no noticeable difference.
    I also have three replays. Two demonstrate the above, and the third demonstrates that the ball standing in the timer constantly is irrelevant.

Probable Suspects
    I think the most likely explanation is that the physics engine works at a certain frame rate (90 steps per second), and 0.75 does not evenly divide that, so it has to use an approximation like 0.74444... (or perhaps 0.75555...). Now, either

  1. the 2.25 path is approximated as 2.24444... which is not 0.74444... * 3, or

  2. some adjustment is being made that keeps the paths on track, and it is not applied to the timer (or vice versa).

Post's attachments

not_standing.nbr 712.34 kb, 118 downloads since 2019-05-28 

timer_bug1.nbr 542.4 kb, 101 downloads since 2019-05-28 

timer_fixed.nbr 860.58 kb, 110 downloads since 2019-05-28 9.56 kb, 113 downloads since 2019-05-28 9.55 kb, 101 downloads since 2019-05-28  <<< My First Set

Second set progress: 6 near complete, 5 in progress

Deprecated: Function create_function() is deprecated in /home/customer/www/ on line 811


Re: Timer bug -- 0.75 seconds => goes out of phase

I had a (quick) look at this. The problem seems to be that when determining the delta time to pass to sol_move_once, only possible path changes during that interval are guarded against, but no check exists for deactivation of timed switches.

So if a mover and the timed switch controlling its path are both at, say, tm=744 and now the state is stepped forward by 11ms, both will end up at tm=755. Having exceeded its base tm of 750, the switch disables the path, but the mover already has an additional 5ms on its clock.


Re: Timer bug -- 0.75 seconds => goes out of phase

Excellent work, you guys.

I committed a potential fix on Github. It seems to fix the test map.


Re: Timer bug -- 0.75 seconds => goes out of phase

Keep me up to date, until you'll got in a new mind.

Made with Microsoft Visual Studio 2019
Made with Msys2 for Windows 10