0 Favourites

Timing issue on different platforms

  • Hello. I'm doing some rhythm game where timing is very essential but I haven't used to Construct 2 engine yet, so here is the technical issue that bothers me:

    Music starts right after the layout is loaded, then I use "Wait" function to catch up with beat (i.e. 4 secs). After some time passes I change the variable that activates "Every 8 seconds" loop to spawn sequence of notes every 8 beats. So I expect it to start after 12 seconds and when I run this layout from the constructor (in browser) - rhythm is just perfect. But! If I start from previous layout and go to playable layout from menu - timer goes off 1-2 seconds sooner. If I build ".exe" and try it again - timer ends almost 4-5 seconds sooner. There was a bug that began notes' spawn few seconds later but I forgot how to repeat it. Anyway, these timings are terribly random and nothing good for gameplay.

    Are there any specifics of engine I don't consider or should I use some other actions for synchronizing? Thank you.

  • For timed events using the timer-behaviour gets the best results..

  • For timed events using the timer-behaviour gets the best results..

    this ^ and also try using delta time.

  • >LittleStain

    Oh, forgot about that behaviour. I've linked main event to timer's loop and notes appear at the right moment now. Thank you

    Still, I don't get why it was so random earlier. Does "Every X seconds" event use another less precise algorythm? Should I ever use it then?

    edit: By the way, is there any delay between loops of timer behaviour? It feels like rhythm began to go off slightly.

    jojoe

    Can I use dt outside of "Every tick" event?

  • >>LittleStain

    Oh, forgot about that behaviour. I've linked main event to timer's loop and notes appear at the right moment now. Thank you

    Still, I don't get why it was so random earlier. Does "Every X seconds" event use another less precise algorythm? Should I ever use it then?

    edit: By the way, is there any delay between loops of timer behaviour? It feels like rhythm began to go off slightly.

    >>jojoe

    Can I use dt outside of "Every tick" event?

    What do you mean by an "every tick" event..

    All events, that are not triggered events, are every tick events when their conditions are met..

    Every x seconds uses the wallclocktime, which starts counting when the game is started..

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • [quote:xww8chsu]Every x seconds uses the wallclocktime, which starts counting when the game is started..

    So whenever I activate that function - it's already started?

    I mean, if there's "every 5 seconds" event which gets greenlight 2 seconds after beginning of layout - that doesn't really matter because I've spent unknown amount of time in the menu? Geez, I wish I knew that before I screwed my mind. Thank you for explanation.

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