Performance and dt at Layout Start

Discussion and feedback on Construct 2

Post » Fri Aug 30, 2013 4:48 am

I have an event that spawns objects every 180*dt seconds ("Every X Seconds"). However, at the start of the layout on the mobile version, there's usually a lag period when everything is loading up. During this time, it takes ages to hit 180*dt (about 15 seconds total). The event works normally after this 15 seconds.

Changed the event to every 3 seconds instead of 180*dt, and the event works normally from the start. If I spam all the events using a keyboard input from the start, there's barely any lag, but for some reason dt is really suffering when I use it with the "Every X Seconds" event.

I want to keep framerate independence, but dt seems to be hindered pretty badly at the start of the layout. Any suggestions?

Update: Ran the game with tickcount, seems that the tickcount doesn't suffer as badly as I thought, hits 180 ticks in 4-5 seconds at most. However the spawn every dt seconds event still doesn't work till it hits 15 seconds in.Len2013-08-30 04:56:03
B
7
S
2
G
1
Posts: 37
Reputation: 1,278

Post » Fri Aug 30, 2013 4:56 am

I thought time (every X seconds) was framerate independent?
B
28
S
8
G
5
Posts: 429
Reputation: 7,007

Post » Fri Aug 30, 2013 5:01 am

For the "Every X Seconds" event, it says that it's limited by framerate.

"Specify time, in seconds, between running the actions. Interval is limited by framerate (actions will not run more than once per tick)."

Does that mean that it can't exceed framerate, or it is not framerate independent?
B
7
S
2
G
1
Posts: 37
Reputation: 1,278

Post » Fri Aug 30, 2013 10:09 am

Using "dt" in "Every X seconds" makes no sense at all. "Every X seconds" is already framerate independent, because it measures time in seconds, not frames. As the description says it simply won't run more than once a tick (i.e. never more than "Every tick" would run).Ashley2013-08-30 10:10:34
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Fri Aug 30, 2013 11:15 am

Thanks for clearing it up.
B
7
S
2
G
1
Posts: 37
Reputation: 1,278


Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests