Way to go back and forth through the scene data history for debugging?

Hey all, I’m trying to debug a scene here that has a weird behavior just sometimes and wanted to track it to better understand.

I have a moving player on a surface, everything was working smoothly before I add the deltaTime to the changing of the player position, now just sometimes I got a weird and very fast flick bug on its movement, I cant tell if it stops for a moment, goes back or something cause its too fast and thats what I wanted to be able to debug.

Would be awesome to have a way to frame by frame debug my scene checking properties and kinda “moving back” frames ago to be able to see the issue and how the data looked like at that time to understand the issue way better, does BabylonJS has something like that for debugging in kinda “real time data visualization and result”?

Not sure if I was clear, but I wanted to check not only the data, but the visual render player position, the deltaTime and other data at the moment

You could serialise as a Babylon file and compare, as the data structure is maintained by the engine. It depends on how much detail you want to go to. You can consider stripping data/node that is the same as the previous undo snapshot. The first snapshot is complete (not stripped). In JS you can use references to reduce overhead, serialisation is not necessary unless you plan to export or do VCS diff. Then it’s up to your test suites :smile:.

1 Like

We did that for SpacePirates demo.

A frame is recorded and restored on demand. IIRC, there was some frame interplation as well.
Basically, for your use case, everything can be trashed except storing/restoring this data:

3 Likes

I’ll take a look on it, thank you!