The Photon Forum
is Closed Permanently.

After many dedicated years of service, we have made the decision to retire our Forum and switch to read-only: we´ve saved the best to last! Your search result can be found below. Plus, we offer support via these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Setting up Client-Side Prediction and having the MasterClient keep the authoritative game state.

matthewjd24
2020-04-21 11:07:30

Hi guys, I'm setting up a small multiplayer RTS game with PUN 2 in Unity. I know PUN uses a client-authoritative model, so I'm trying to use a 'dumb-client' model where every player in the room issues their commands to the master client, which sends the updated game-state back to the players. After that I will implement client-side prediction so that it seems instantaneous to the client while really it takes a little bit for the master client to get back to them, and as long as the client had the correct gamestate X ms ago (where X is the ping to the server) then it should be good, otherwise it will be corrected.

My question is regarding doing this with PUN 2. From what I've read, I will have to do this all manually with RaiseEvents. Does anybody here have experience setting stuff up like this in PUN? It seems like it's really going to be a pain. I'm pretty new to this so I feel it's going to be a STEEP learning curve. Any suggestions on how I can implement this so it's simple and effective is greatly appreciated, thanks.

Comments

JohnTube
2020-04-28 08:28:08

Hi @matthewjd24,

PUN does not do any client side prediction.
Regarding Master Client, here is what you need to know.

RaiseEvent is a key to all custom logic yes.
Did you consider Photon Bolt? Not sure it has what you need but it may be suitable for you.

Back to top