Auth Rigidbody Prediction sample

Options
Cronos
Cronos
edited February 2021 in Photon Bolt
Hi there,

I have been digging the Photon Samples to help define the best model to go with our game and got some questions related the "Auth Rigidbody Prediction" one:

1) On this page (https://doc.photonengine.com/en-us/bolt/current/community-wiki/extra-bits/use-cases ) it indicates that Rigidbodies can't be predicted, so the use case "Completely Client Predicted, Server Authoritative Using Commands" wouldn't be feasible. But on the "Auth Rigidbody Prediction" it does prediction with Rigidbodies, so a "Completely Client Predicted, Server Authoritative Using Commands" is possible?

2) What is the mirror player for?
The mirror player on FixedUpdate seems to not do anything, as mirrorPlayer transform is never assigned.

3) Is the PhysicsScene cached in "StaticTest.localPhysicsScene = StaticTest.localSimScene.GetPhysicsScene();" somehow paused/not running? I ask because the "ExecuteCommand" of RPlayerController is manually calling: "StaticTest.localPhysicsScene.Simulate(Time.fixedDeltaTime);" and if the StaticTest.localSimScene is already running, wouldn't its rigidbodies already being simulated every frame and by having the "RPlayerController" calling Simulate wouldn't it double up its simulations and "go ahead in time"? Sorry if it sounds confusing.

4) With this approach, is it needed to create a separate additive scene for each Entity controlled by the Player? For example, if I have 4 local players and would like them to be together on an Online match, then I would need 4 separate scenes? And then, on each local player's ExecuteCommand call "StaticTest.localPhysicsScene.Simulate(Time.fixedDeltaTime);" ?

Thank you!

Comments

  • stanchion
    Options
    1) It is "possible" as seen in the sample but no where near easy or straightforward.

    2) I'll take a look at the specific variable, but the concept of the mirror scene is to have the player you're controlling along with other objects relevant to the player so that they can collide and so on. With Unity Physics you can individually step scenes, to to have full control of physics of a player they need to be in their own scene. Since Unity has 5+ different Physics systems they support now, I imagine one of them doesn't have this limitation.

    3) The physics are on manual mode. They only run when called.

    4) This sample keeps in mind an FPS where you control a physics based player or a car. I haven't put any thought into how a player controlling multiple characters would work.

    Feel free to post in the #samplepack channel in Discord for easier back and forth.
  • Cronos
    Cronos
    edited August 2019
    Options
    Thanks for the clarification!

    I imagine for the local splitscreen to run on this scenario it would need one extra scene to simulate each local player rigidbody. That could be tricky (or not).

    Seems like this could be CPU intensive for the server too.

    I'm leaning towards doing the "Client Auth, Predicted Movement With Server Side Sanity Checks With Commands" approach. But I couldn't find any sample for this use case. Do you know any? A doc detailing it would work too. I'm curious to see how a server side sanity check would be.

    Thank you
  • stanchion
    Options
    Yes local splitscreen is always tricky.

    None of what I refer to above has to do with the server. It is client side prediction. However, what Rocket League does is very server intensive.

    This sample has no physics but it follows that design. https://github.com/Reinisch/Warcraft-Arena-Unity
  • Cronos
    Options
    Great sample, very helpful. Thank you