Page 1 of 1

[Not a bug] Weird running bug

Posted: Fri Apr 19, 2013 7:11 pm
by ficolas
Idk if this is because of lag, but when you put the zoom in to the max, the player runs faster, and when it is out, the player runs slower, I thought it was an optic ilusion thing, so I tried counting the seconds, and yup, the player runs faster when the zoom is in

Re: Weird running bug

Posted: Sat Apr 20, 2013 1:03 am
by SilverWarior
As far as I know the game speed is currently heavy inpacted by FPS.

Re: Weird running bug

Posted: Sat Apr 20, 2013 7:49 am
by drs9999
maybe your UPS (not FPS) dropped when you zoomed out?

I just made a quick test ( so I can be wrong) in a fresh game, so the UPS were allways at 60 and I did not see a difference in the running-speed/ duration.

Re: Weird running bug

Posted: Sat Apr 20, 2013 7:50 am
by MF-
SilverWarior wrote:As far as I know the game speed is currently heavy inpacted by FPS.
it should not be in 2.10
It's giving me abrupt scene jumps when it skips frames...
Is the separation imperfect?

Re: Weird running bug

Posted: Sat Apr 20, 2013 3:56 pm
by slpwnd
The problem with the render / update separation is that they are both still running in the same thread. The way this is done is that there is a timer set to rate 60 ticks per second and whenever this timer event is received the update is performed. If there are multiple queued timers in the row they are all performed (up to configurable Max Updates Per Frame). Only after this is the game rendered. After the rendering the game waits for the vsync to flip the video memory buffer to the screen.

This leads to complications:
1) When a vsync is missed (even by the slightest margin) the whole execution waits for the next vsync (typically 1/60s).
2) Sometimes the multiple updates per frames kick in even when this is technically not necessary (when discrepancies caused by blocked waiting add up).
3) It can happen that the thread starts waiting for the timer event even when it could start updating already.

We have some simple mechanisms to deal with 2 and 3 however the came is still shattering now and then. We hope that when the rendering and updating will be done in separate threads this will be way less visible.

The advantage of the previous simplified approach (1:1 update:rendering directed by the vsync) was that the game was always running "smooth" even though slower (30fps).