I want to make my game Server Authoritative a bit later on. I use PUN, and I am not that great with it. I plan on checking more into this on the PUN documentation later.
But, I was wondering, is there a simple way to have the server generate a fake client/player, that is the MasterClient always? I don’t know how to do any back end things unfortunately. But, I don’t want my game cheated to hell either.
Here’s a piece of advice: Design your networking system with a preset plan. After you finish it, it’ll be a huge pain to go back and change it, much less design it based on a completely different framework.
So for an authoritative server, every client sends the authority inputs, and the server simulates everything. Photon can’t do that, so your idea of using the master client as the authority is the next best option. You do the exact same thing - send the master client inputs. If it’s a first person shooter, you can just send when i.e. ‘W’ is pressed then send when ‘W’ is unpressed. Then the master client plugs these booleans into your character control system, simulates it, then sends everyone the position of the simulated units after the input. There are some downsides to this method you should carefully consider.
- Easily hackable. If you’re the master client, you control everyone’s health, position, etc.
- This puts all the burden on 1 person’s computer - the master client - so if he’s gone or can’t handle it, you’ll have to somehow make someone else the master client
For most games, it’s better to send position updates. The only situations you would use this kind of networking is in 1. synced physics simulation and 2. artificial intelligence control.
If you really want to make a non-hackable FPS in perfect sync, check out how Halo did it: Microsoft to open-source cloud framework behind Halo 4 services | PCWorld. Actually, they’re planning to make their system open-source but you’ll probably not be able to use it with Photon.
I understand. I have actually been designing with the change in mind. I have been designing it for functionality, but keeping in mind that I want to change it server authoritative later. You are right about it being difficult to change it later, I tried that route once over a year ago and broke it horribly. Which is how I got where I am today. My thing is, I want a “Dedicated” server to simulate a MasterClient. Player 0 if you will. So, a 16 player match would ignore his existence, and actually be a 17 player match. Anyways, I didn’t know if there was any known/easy strategies for “faking” a master client player, where the master client is actually a server simulated client.