Replies: 3 comments 5 replies
-
The short of it is that as you suspect - Godot doesn't make it easy but it's not impossible with compromises. Godot's physics aren't deterministic and there's no interface to re-simulate physics multiple times in a render frame. Not many game engine's can for that matter. So RigidBodies can't really participate in rollback code but it is possible to do state syncing so that the physics simulations are somewhat in sync across clients. Netfox doesn't have a feature for this yet but it has been talked about - see #265 . You basically copy the physics states from the server and apply them to the clients. The example Netfox comes with doesn't use RigidBodies. It uses more predictable nodes like CharacterBody3D and ShapeCast3D which can be forced to repeat movement and collision checks several times per frame. |
Beta Was this translation helpful? Give feedback.
-
I want to add that you can have deterministic physics if physics are server-based, regardless of what engine or physics you use.
|
Beta Was this translation helpful? Give feedback.
-
Okay. I've put together a simple 3D networked game using Netfox and Jolt. I don't mind if the physics are all done on the server and broadcast to the clients, but I'm having trouble getting that to work. The players are CharacterBody3D and can move around on both the server and client smoothly. However, I've also added a RigidBody ball I want them to push around and right now, colliding with the ball does not cause it to move. I've added a RollbackSynchronizer and TickInterpolator to the rigid body and have them serving the transform, linear_velocity and angular_velocity properties. I would have hoped that this would simulate the physics on the host and then the client would try to sync to that, but instead the player bodies just collide with the RigidBody as if it were a StaticBody. If I delete the RollbackSynchronizer and TickInterpolator, the physics works again, but the host and client are completely out of sync. I'm using this code at the end of the player update to push the ball:
|
Beta Was this translation helpful? Give feedback.
-
I'm interested in using Netfox for a physically simulated 3D environment where several players would be playing a sports game involving pushing a RigidBody ball around a playing field. From what I've read in the docs and on other forums, I'm getting the impression Netfox isn't good at this because Godot's current physics engine implementation doesn't allow for deterministic behavior. On the other hand, Netfox does come with that example where two players are jumping around a 3D landscape and it seems to work.
I'm wondering if it makes sense to try and create a 3D multiplayer physics based ball game using Netfox, or if this is something that is outside of Netfox/Godot's capabilities.
Beta Was this translation helpful? Give feedback.
All reactions