Stepping Physics with Rollback
Helper classes for supporting physics stepping and rollback.
Auto-stepping is disabled and taken over by the netfox loop.
Physics implementations supported:
- Godot Rapier Physics addon.
- Custom Godot Builds with the stepping PR
Progress
- [x] bass classes
- [x] docs
Added a PhysicsDriverToggle implementation - they show up in the editor under Project > Tools, and they can check whether the toggled physics driver is even available:
Nice work on the toggles @elementbound
I havent forgottten about this PR, just that time of year where I'm traveling a bit and don't get as much time to work on things.
Working on a RollbackSynchronizer Player driven RigidBody at the moment. It's a bit tricky as the pattern is a little different to what you would do with a CharacterBody.
Generally movement is all self contained in rollback_tick. When dealing with RigidBodies we need to let all RigidBodies take in what forces they will have, run the physics simulation for a step and then save the snapshots.
Rapier seems to have a bunch of collision issues for me, but these might not be fixable in the rollback code:
- With
rollback_spaceenabled in the driver, CharacterBody no longer collides with Areas or other CharacterBodies at all - RigidBodies go through the floor in 3D
Here's the project I used to test these out: https://github.com/kumpmati/netfox-physics-rollback-test
@kumpmati Thanks for picking up on the 2D and CharacterBody issues.
Still looking into all its variations. Its mentioned here also: https://github.com/godotengine/godot/pull/76462#issuecomment-1762708058
Rapier seems to have a bunch of collision issues for me, but these might not be fixable in the rollback code:
Yeah, Rapier has its own issues. Collision seems to be spotty unless the surface is really thick.