🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Is client-side prediction impossible when using built-in physics on an engine such as Godot or Unity?

Started by
3 comments, last by GBN 4 years, 9 months ago

Hello everyone!

Recently I have been beating my head against the wall trying implement and learn more about client-side prediction with rigidbodies in Godot and I have a few concerns on how I should be approaching this.

  1. Is client side prediction impossible if physics is non-deterministic? I assume this to be true if we cannot predict the SAME exact outcome from every action.
  2. Are rigid bodies in engines such as Godot and Unity something to avoid when trying to synchronize games over the network? I did some research on this and found some older posts from the past 5 years or so recommending against using Unity's built-in physics due to it not being deterministic, I am wondering if it is the same with Godot or not.
  3. Regardless of the above, at this point I would assume coding the physics myself would be a lot easier and provide a lot more certainty when troubleshooting synchronization problems over the network.

I feel like I have made a fundamental error in using rigidbodies and would really appreciate any feedback on this.

Thanks a bunch in advance!

 

Advertisement

For an FPS-style game, client-side prediction is not "impossible," but it will go wrong slightly more often than if you have a deterministic physics engine.

Given that you have to deal with the case when the server diverges anyway, that's not really all that big a deal, unless you have gameplay where rewind/correction just "mustn't happen." If that's your gameplay style, I recommend not acting on input until it's been echoed back from the server -- the input-synchronous model, popular with RTS games, for example.

Unreal Engine also uses non-deterministic physics, and there seems to be UE based games that do OK on the network. UE doesn't even use a fixed time step size! So it's all a question of how many entities you want to synchronize, how much bandwidth you want to consume, and how much out-of-sync you're willing to accept.

 

enum Bool { True, False, FileNotFound };

I am trying to make something fast paced with precise collisions and a similar feeling to Stick Fight. I do not have enough experience to visualize and know what the correct answer for something like this is.

So even when physics is non-deterministic corrections can be applied and still make for a smooth experience? I am struggling to understand the process  and picture the flow chart of making corrections feel smooth if they need to happen often.

I actually found a post on here that may shed some light on some of my confusion

I will study this and see where it goes.

Thank you

 

This topic is closed to new replies.

Advertisement