Q
Q
Qualiant2021-01-14 00:41:13
Game development
Qualiant, 2021-01-14 00:41:13

Is it worth keeping two timers?

I am writing my first game 2d engine. I faced a dilemma: does it make any sense to keep two timers - separately for rounds of execution of game logic and separately for rendering frames? The goal, for example, is to have two different limits: say, no more than 60 frames per second and no more than 100 rounds of game logic calculation per second.

Or is it better to keep one and, based on the frame rate per second (let's say even if it is 999), determine the interval and use it to calculate the logic, and then give it for rendering?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maaGames, 2021-01-14
@Qualiant

You don't need an FPS timer, you need to see how much time has passed since the last frame. Because the fps can be much lower than the specified 60 (even in 2D, you can load hundreds of thousands of units in such a way that it will be under zero fps).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question