netfox icon indicating copy to clipboard operation
netfox copied to clipboard

Stepping Physics with Rollback

Open albertok opened this issue 10 months ago • 4 comments

Helper classes for supporting physics stepping and rollback.

Auto-stepping is disabled and taken over by the netfox loop.

Physics implementations supported:

Progress

  • [x] bass classes
  • [x] docs

albertok avatar Mar 26 '25 07:03 albertok

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:

image image

elementbound avatar Mar 31 '25 21:03 elementbound

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.

albertok avatar Apr 10 '25 12:04 albertok

Rapier seems to have a bunch of collision issues for me, but these might not be fixable in the rollback code:

  1. With rollback_space enabled in the driver, CharacterBody no longer collides with Areas or other CharacterBodies at all
  2. 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 avatar May 05 '25 16:05 kumpmati

@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.

albertok avatar May 06 '25 14:05 albertok