Page 1 of 1

[0.15.19] take_screenshot() desyncs at high speed

Posted: Thu Jun 08, 2017 1:59 pm
by DaveMcW
Steps to reproduce:
1. Load this save:
timer_1000x_speed.zip
(394.91 KiB) Downloaded 114 times
2. Run this command:

Code: Select all

/c game.take_screenshot{path=game.tick..".jpg"}
Expected result: The screenshot matches the file name.
Actual result: The screenshot is 129 ticks higher than the file name on my computer.

You can change game.speed to 1, to verify the timer really is in sync. It is a bug in the take_screenshot() function.

I was trying to automate screenshots of very short events far in the future, and this bug messes up my timing.

Re: [0.15.19] take_screenshot() desyncs at high speed

Posted: Thu Jun 08, 2017 6:59 pm
by posila
Hi, take_screenshot just queues screenshot request for rendering thread. If there are multiple updates in between rendering, screenshot is not from the same tick as take_screenshot was called.
You might call it a bug, but we won't "fix" it, I am sorry.

Re: [0.15.19] take_screenshot() desyncs at high speed

Posted: Sun Jun 18, 2017 9:27 am
by DaveMcW
I found a workaround.

Code: Select all

/c game.take_screenshot{path=game.tick..".jpg"}
for i = 1, 1000000000 do end