Best practices? every tick vs. every 0.x seconds vs. dt

0 favourites
  • 2 posts
From the Asset Store
75 power-up sound effects; bonus and notification sounds, fanfares, harp glissandi, stabs, clock ticks, etc.
  • So, I am getting started with the platform, and I want to settle in a good model to update the game state.

    I can do 'every 0.016 seconds' for a theoretical 60 game state updates per second.

    Or I can to 'every tick' - which I don't know how to set the tick rate.

    I can also use dt to track how much time has passed since the last game update, but I suspect it is tied to tick rate, so I don't know if it would interact well with 'every X seconds'.

    Both tick rate and 'every X seconds' are a best-effort, that is limited to processing capacity of course, so the game will slow down if there is too much going on.

    Are there clear downsides on using 'every X seconds' over 'every tick'?

    Can I set a fixed tick rate, or cap it at e.g. 60 hertz?

    I would like to have game logic to run at a fixed rate independent of frame rate, even if frame rate slows down. Would it be a good model to use 'every X seconds' to update data, and use 'every tick'to update the screen?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes, making the 'Every X Seconds' updating data can be better and will not outrun the memory of the game, and, the 'Every Tick' will literally at every 1 tick updates the game screen, but, you can do it with the 'Every X Seconds' for better Ram memory. Normally i use the 'Every X Seconds' to minify the use of the Ram, specially when i'm making an bigger game. But, you can normally do with boths, the only change is that will affect the game's perfomance.

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