"wait" variance

Discussion and feedback on Construct 2

Post » Sat Nov 05, 2016 11:40 pm

Frustrated!

I am using a wait function. even though I am using the same machine I can run the game (via layout) and the wait function will vary.

For example:
If I set "wait" at 1 sec it will delay for 5 secs.
If I set "wait" at 3 secs it ran the following times: 10.42, 14.86, 13.21, 14.90).
If set "wait" at 4 secs its real time runs were 18.56, 1960, 17.15 and 18.20.

And these times are based even if I run a refresh in the browser.

What gives? What am I missing?
B
24
S
10
G
1
Posts: 43
Reputation: 2,288

Post » Sun Nov 06, 2016 12:18 am

We'd have to see how you are using it.
ImageImageImage
B
71
S
22
G
247
Posts: 3,753
Reputation: 137,552

Post » Sun Nov 06, 2016 1:25 am

Is it within a loop ?
B
60
S
19
G
5
Posts: 32
Reputation: 5,692

Post » Sun Nov 06, 2016 1:44 am

I'm guessing you manipulate a time scale somewhere in your code? Maybe for a slow-mo effect?
ImageImageImage
B
27
S
16
G
82
Posts: 1,029
Reputation: 45,777

Post » Sun Nov 06, 2016 2:09 am

Nope. No manipulations, no loops - nothing that sophisticated (lol). It's located in my On Start Layout Event.

But even if I had some sort of...well anything (except for some kind of random generated something or the other) you would think there would be some consistency. Even when I do a refresh on the browser- and not having manipulated anything- it still gives my these fluctuations as shown in the initial post. I would understand it if it was on different machines, browers or whatever. But it's on the same machine, within a minute of each "play through".

By the way, I use a stopwatch to track the times. Even taking into consideration some imprecision with me pressing the button (and notwithstanding the variance between the real times for each Wait setting), how does one account for the variance between the "wait" setting and the real times?

Also, I'm using the free version, if that makes any difference.
B
24
S
10
G
1
Posts: 43
Reputation: 2,288

Post » Sun Nov 06, 2016 2:17 am

Maybe there's a high initial load? Do you have many or big assets on this layout? You may try to implement a kind of stabilizer before you run the actual layout events. I wrote a tutorial about it some time ago: https://www.scirra.com/tutorials/4832/h ... en-layouts

The point is that if you have a lot of things to load/render initially then there might be a kind of lag at start and so the wait loop will get lagged as well. So the stabilizer trick is to wait untill all gets loaded and there's not FPS drop any more.
ImageImageImage
B
27
S
16
G
82
Posts: 1,029
Reputation: 45,777

Post » Sun Nov 06, 2016 3:15 am

Thanks for the feedback and suggestions, BF. I'll try the loader and see if that helps. Otherwise, I'll...heck not sure what the heck I'll do. lol.
B
24
S
10
G
1
Posts: 43
Reputation: 2,288

Post » Sun Nov 06, 2016 4:05 am

http://www.blackhornettechnologies.com/Construct2Stuff/WaitAccuracy.capx
What do you get with this sample?
I get:
0.005
1.008
2.007
3.1007
4.107
5.108
6.107

Not perfect, but close enough.
ImageImageImage
B
71
S
22
G
247
Posts: 3,753
Reputation: 137,552

Post » Sun Nov 06, 2016 4:57 pm

Thanks BH, but if I have the wait set to 5 seconds it needs to wait 5 scs (+/- 1 sec). If you know away to make that happen, I would REALLY appreciate the heads-up. Thx for your support.
B
24
S
10
G
1
Posts: 43
Reputation: 2,288


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 6 guests