Multiple Players interacting with all Photon aware objects at the same time.

Options
knighthawk
edited April 2023 in Any Topic & Chat

Hi,

I have a couple of games where all the players need to interact with all the networked objects in the scene at the same time, basically a none turn based game.

Each player has a Puck and this puck is used to hit a master puck, but their puck can also interact with the other 2 players pucks knocking them out of the way, while the other players are moving.

Multiple players could hit the object at the same time.

Similar to the examples below, in my VR Bowls game I set all network objects to the Owner of the player that has just picked up their ball, but I want other players to be able to pick up their bowls, possible even practicing, but when they do the owner is changed and the players bowl that has just been bowled stops.

This means that waiting for all the bowls to settle before allowng the next player.

Is Photon View the way to go, or maybe even PhotonEvents, getting around the Authoratative issue.



Thanks

Mike

Comments

  • Tobias
    Options

    To be blunt: PUN is not the best tool for that job. The state for the game is distributed. Everyone controls the local puck and there is a ball someone needs to simulate as well. The physics in each players' device will run immediately and try to make sense of the movement but as everyone's position is coming in with some delay, nothing really ever fits. Basically everyone (all players AND the physics) shout all the time where the ball should be.

    You'd do these types of games with Quantum in best case as it also works great on mobile and web. In it, only input is sent and used tick wise (unless way too late). The deterministic physics solves the situation and everyone gets a verified state asap.

    Fusion is also fine for it, as in Host mode, everyone just sends input (which then moves the puck on the Host's simulation, rather than everywhere). The state is simulated in one place only. This is much smoother.

    In PUN, I don't really have a solution for this type of gameplay. Yes, you could also just have all clients send their input and the Master Client simulates the world (has control of all PhotonViews). But this re-invents the wheel and as there is no direct connection, it gives a bigger benefit to the Master Client.

    Sorry, can't solve this for you with PUN.

  • knighthawk
    Options

    Hi,

    Thank you for you input, I did think as much, so I will put my Fusion / Quantum hat on and get learning.

    Thanks