Call function after delay - Which delay?

For questions about using Classic.

Post » Wed Mar 03, 2010 4:16 am

Hey everyone
I'm making a new game that's using lots of functions, and I usually need to tie them together.

David showed me the "Call function after delay", a nice workaround for Construct's way of computing things (I don't remember his explanation, but this is irrelevant to my question anyway :lol: ).

Anyway, I wanted this delay to be as quick as possible, but I'm afraid to use a very small value (like 1ms, for example) and have the risk of skipping the next function... So, is this possible to happen? What would be a minimum safe value for this delay?
B
107
S
40
G
10
Posts: 456
Reputation: 13,202

Post » Wed Mar 03, 2010 4:46 am

20ms is above the TimeDelta-safe zone, so to speak. I recall Ash mentioning long ago than anything less isn't 100% reliable.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Mar 03, 2010 11:05 am

'Call function after delay' only checks if the delay has expired at the end of the event list. So if you're running at 100fps, it'll only check to see if the delay has expired every ~10ms, so timings less than that don't make much sense. It's perfectly safe to use smaller values, they'll just still be executed after about 10ms. Generally all timing things in Construct are synchronised to the framerate so your resolution will be about (1000ms / framerate) milliseconds.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,528

Post » Wed Mar 03, 2010 11:37 am

Great replies! Thanks guys!
I was always concerned about this... :lol:
B
107
S
40
G
10
Posts: 456
Reputation: 13,202


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests