Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manually stepping the engine results in non-deterministic area overlap #308

Open
bcolloran opened this issue Nov 14, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@bcolloran
Copy link

Describe the bug

I'm trying to get rollback + client prediction working using godot-rapier-physics, which requires manually stepping the engine.

The manual stepping itself works fine, but the results of the simulation are different, at least when checking for area overlaps with Area3D.has_overlapping_bodies() -- the simulation ticks on which bodies overlap depends on how the simulation is stepped, not on the simulation tick on which the overlap check is made.

(I wonder if this has to do with syncing of transforms that are defined on the Godot side with transforms needed for collision checks on the rapier side?)

To Reproduce
run the main scene in this repo:
https://github.com/bcolloran/godot_rapier_physics_rollback_test

with the "advance kind" enum set to each different value:

image

Expected behavior

The logging that prints out which ticks the areas have overlap should print an identical set of ticks no matter how the simulation is stepped.

Environment:

  • OS: linux mint
  • Version: latest
  • Godot Version: 4.3
  • Type:
[plugin]

name="Godot Rapier 3D"
description="A 2D and 3D drop-in replacement for the Godot engine that adds stability and fluids."
author="appsinacup"
version="0.8.8"
flavour="godot-rapier-3d-single-enhanced-determinism"
script=""

Example project
here's a complete minimal repo:
https://github.com/bcolloran/godot_rapier_physics_rollback_test

@bcolloran bcolloran added the bug Something isn't working label Nov 14, 2024
@bcolloran
Copy link
Author

This is a little subtle, so I thought it might hopefully help to include a screen recording explaining my experimental setup

rollback9.mp4

Feel free to ping me here or on discord. Also, if you have ideas about how this might be addressed, I don't mind trying to put together a PR if you can give me some pointers and orientation (though I know that explaining a project you've been building can take longer than just fixing things yourself :-) )

Thanks, amazing project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant