Unwinding the simulation

j3parker
Posts: 1
Joined: Sat Nov 27, 2010 4:55 am

Unwinding the simulation

Post by j3parker »

I haven't checked the code yet (sorry if I am being impolite by asking) but does bullet currently have functionality for restoring past states?

If not, how hard would it be to save the current world state entirely (from inside the Bullet engine)? If the memory requirements are not insane I'll need to implement a cataloging of past states. I would store the state after every tick in some fixed circular buffer. Perhaps only saving for every n ticks and simulating the difference would be ideal.

Otherwise, how well does bullet simulate backwards in time? This seems quite dangerous from a determinacy point of view though.)
rraallvv
Posts: 30
Joined: Thu Feb 09, 2012 2:39 am

Re: Unwinding the simulation

Post by rraallvv »

I'm interested too, it appears bodies' motion state are not saved/imported.

Any help is appreciated
TheJosh
Posts: 17
Joined: Tue Jan 24, 2012 5:39 am

Re: Unwinding the simulation

Post by TheJosh »

What is the need for this? I'm guessing network code (wind back, apply change, wind forward), as used by various games, and pioneered (as far as I'm aware) by John Carmack?
xexuxjy
Posts: 225
Joined: Wed Jan 07, 2009 11:43 am
Location: London

Re: Unwinding the simulation

Post by xexuxjy »

Bullet doesn't (can't) simulate backwards in time (don't think any physics engines can as there are a multitude of possible states). I think most games do what you suggest and store off a chunk of previous inputs so they can be replayed forwards from that point.