Handmade Hero»Forums»Code
Mārtiņš Možeiko
2559 posts / 2 projects
A bit confused about main loop
Replying to da447m (#25792)

Not sure I understand what rewinding has to do with anything here?

Even with box2d you will see strange behavior on collisions if you will do just a linear interpolation during those 10 units. It will look very glitchy and people will see that as a bug or bad physics.

100 posts
A bit confused about main loop
Replying to mmozeiko (#25793)

Not sure I understand what rewinding has to do with anything here?

It is in my OP :)

As an extra here, I always assume[d] jon blow did something like this with braid rewind to help compress state/pos, but to my surprise he said somewhere he recorded everything in 60hz!

So what is broken with such apparently simple pattern?

(sorry this Q looks a bit all over the place :)

Mārtiņš Možeiko
2559 posts / 2 projects
A bit confused about main loop

To rewind you simply snapshot state after each simulate_physics() call, then you can reset it to any of previous states as you wish. For fixed timestep simulations this will be very simple and deterministic. I don't know what/how Braid did or what issues it solved or not.

Simon Anciaux
1337 posts
A bit confused about main loop
Replying to mmozeiko (#25796)

There is this GDC video about the rewind in Braid: The Implementation of Rewind in Braid