HNHacker News
TopNewBestAskShowJobs

certeoun

110 karma · joined August 17, 2021

submissionscomments
certeoun··on Ask HN: Is there a real alternative to Android/iOS?
I didn't see any real backtracking from them. Last time I checked, they tried to downplay the impact of their new measures on privacy.

So apparently, there is currently CalyxOs that works with Pixel phones and Pop!_OS. Pop!_OS is an alternative to Windows or macOS. I believe that Microsoft does the same thing with its telemetry services.

certeoun··on Game Timers: Issues and Solutions (2012)
I think I finally got it now. I set myself up with roadblocks preventing me from seeing the tree in a forest. After learning what delta time (and variable timesteps) are, I finally understood what the core issue (frame rate independence) is and why you need a fixed timestep for it.
certeoun··on Game Timers: Issues and Solutions (2012)
Now, I seriously question the notion of "the internet never forgets things". I wonder how much valuable knowledge got lost from that era (the 90s).
certeoun··on Game Timers: Issues and Solutions (2012)
Was it this article?: https://www.gamasutra.com/view/news/115711/The_Game_Develope...
certeoun··on Game Timers: Issues and Solutions (2012)
> The simulated time is incremented by 16ms per inner loop a roughly 60hz rate. You’re correct that the simulated time catches up to the real time. Just wrong about the number of sub-steps. Technically Fabian’s solution will likely run slightly ahead of real time because of the inner loop condition.

Can't the inner while take 1 ms or 1 ns for an iteration? I don't see how the inner while's execution time is at roughly 16 ms. Okay, if my number of sub-steps is wrong, then I am really missing something here. Just trying to understand what exactly is wrong with my thinking.

It is supposed to be so simple, yet I have real trouble understanding it currently. I am basically stuck now.

certeoun··on Game Timers: Issues and Solutions (2012)

    while (running)
    {
        static std::uint32_t simulation_time{0U};
        std::uint32_t const real_time = SDL_GetTicks();

        process_input();

        while (simulation_time < real_time)
        {
            simulation_time += 16U;
            update(16U);
        }

        render();
    }
As I understand it, the inner while loop's is essentially playing "catch up" with the outer while. For simplicity's sake, let's assume that simulation_time is incremented to 1 in the inner while (simulation_time += 1U). Further, let us assume that simulation_time is 42 in the first iteration. Now, the inner while needs to execute 42 times until it fails the loop condition (42 < 42).

On the second iteration, simulation_time is equal to 58 (42 + 16). The inner while executes (42 < 58) 16 times now.

On the third iteration, simulation_time is equal to 59 (58 + 1). The inner while executes (58 < 59) 1 time.

The real_time cannot stay the same, as it polls the number of ticks since SDL was initialized. So apparently, simulation_time is always smaller than real_time.

(If for some reason, real_time isn't incremented in an iteration, then the inner loop will not get executed. However, I don't see a case where it can happen.)

Now, inside the update function there is a position update akin to current_position += speed * 16U. Now with the above iterations:

- The first iteration, causes 42 update calls (so current_position is updated 42 times as well).

- The second iteration, causes 16 update calls.

- The third, calls update 1 time.

So we are advancing the position of something variable times. (We are also executing the inner while in variable amounts.)

Maybe I am missing something here, but why doesn't the non-constant number of updates cause jitter? I really don't understand why it works at all to be honest. I am trying to understand it fully.

certeoun··on Game Timers: Issues and Solutions (2012)
I am a little confused, isn't this a "fixed timestep"?: https://www.gafferongames.com/post/fix_your_timestep/

Fabien calls it "fixed timeslice". I find Fabien's solution much simpler. It is quite different to Fiedler's one.

certeoun··on Game Timers: Issues and Solutions (2012)
> The joy of "discovering" this approach was short lived: This system is very well known in the game industry and is actually the keystone of games such as Starcraft II or id Software engines !

Is it very well known in the game industry? I have trouble finding anything about it.

← PreviousPage 2 of 2