"wait" variance

0 favourites
  • 9 posts
  • 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?

  • We'd have to see how you are using it.

  • Is it within a loop ?

  • I'm guessing you manipulate a time scale somewhere in your code? Maybe for a slow-mo effect?

  • 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.

  • 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.

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)