Mitrich's timewarp & networking

Hi,

I'm not very familiar with box2d's internals... But would it be feasible to make the collision detecting/resolving work a bit like Mirtich's timewarp (http://citeseerx.ist.psu.edu/viewdoc/do ... 1&type=pdf)? This seems like a good match for a networked/distributed simulation. And does box2d's ccd support a variable deltatime?

Thanks!

Martijn
Box2D's continuous simulation is island based and uses variable time steps. I think it captures much of the functionality of Mirtich's Time Warp system without a lot of the complexity.

One thing that could be improved is making it possible to run islands in parallel. Since the islands change during the course of the continuous sub-stepping, this could become quite complex.
I see, sounds promising enough!

I'd like to modify it to support something like rollbacks/forward simulation; would it require much modification to manually create 1 island with the affected bodies (the other islands hidden from the simulation), and simulate this island forward in time so only the affected bodies will be recalculated?

And would it make sense to use ccd to simulate forward in time? As you could use variable timesteps I thought it might make sense to use ccd in combination with a greater timestep in stead of catching up with many steps?

Thanks again,

Martijn
bitshit wrote:
I'd like to modify it to support something like rollbacks/forward simulation; would it require much modification to manually create 1 island with the affected bodies (the other islands hidden from the simulation), and simulate this island forward in time so only the affected bodies will be recalculated?


The solver already simulates single islands. It is not stepping the whole world. I'm not sure how you would do the rollback on multiple islands that are stepped in parallel. In my experience this is not very important in Box2D because the system mainly does dynamic-vs-static continuous and islands do not propagate through static bodies.

The biggest performance gains would likely come from skipping CCD for slowly moving bodies.

bitshit wrote:
And would it make sense to use ccd to simulate forward in time? As you could use variable timesteps I thought it might make sense to use ccd in combination with a greater timestep in stead of catching up with many steps?


There are no large scale catch up steps. The sub-steps use a time step that will take each island from the time of impact to the end of the main time step. Before the sub-step, there is a cheap island catch up to the time of impact.
Is there maybe an high-level overview available somewhere on how box2d handles it's collision detection, island creation etc?
I'm hoping to write more about the internals of Box2D some day. For now you just have the code.

Original thread: https://box2d.org/forum/viewtopic.php?t=5861