Hacker News new | ask | show | jobs
by diggan 841 days ago
This is really awesome! I recently picked up Bevy and Rust to resume my attempt at making games and hopefully publishing something worthwhile. This is something that I felt was missing since day 2 of learning Bevy.

My own personal workaround have been to dump "user actions" to a ndjson file, which I can load at runtime when I want a "replay" but obviously missing being able to move forward/backwards, it just plays the actions.

Would love to see it working with bevy_xpdb, although I'm not sure how deterministic it is and if that gets in the way (I assume so?), it does have a `enhanced-determinism` flag that says "Enables increased determinism", but the lack of "complete/full determinism" terms doesn't give me a lot of hope.

2 comments

Whether the physics engine is deterministic or not doesn't matter here -- Revy (and more importantly, Rerun) doesn't replay anything: it just stores state, every single frame, and then visualizes that state at every timestamp available.

Check out e.g. the live demo of the breakout example for example [1]: if you click on the pallet and then go to its parent node, you'll see that we just store that node's final transform (i.e. post-physics) every frame.

Happy gamedev!

[1] https://app.rerun.io/version/0.14.1/index.html?url=https://s...

Well, floating point isn't deterministic in its rounding on a per-op scale. And doing tonnes and tonnes of floating point operations isn't going to help that. The only way to get deterministic floating point is to start tracking state at boot and not have a scheduler switch away and mess with FPU state while your program isn't in control.