In our multiplayer network game (4.7.0 Preview 8, PC)
We have setup the player blueprint and player controller to frequently show the result of SwitchHasAuthority
with a “Auth” or “Rem” Print String.
On startup the remote client player (in the menus) is “Auth”
Once a client joins a server session and is in the game and on the ground it switches to “Rem”.
So in our PlayerBP and PlayerControllerBP SwitchHasAuthority is returning Remote.
Is there any reason the server swould be telling the client to switch a player’s authority over its self to the server?
Is that normal behavior?
I though from reading various tutorials and such that a player keeps authority over its self
so you can control it from the usual keyboard inputs with no net delays.
This is normal behavior. The server will always be the authority, even over your own character.
Not over your Hud though. A call there will return your client as authority.
Ok, so this means controls such as Jump or Walk Forward get sent as events to the server, the server moves the player, and then the player’s client gets the changes.
Is this responsive over the iNet?
Is there some way to get instant response on the client, and then ignore or sync up later with the server’s idea of reality?
(Or maybe tell the server what the client expects so in effect the client is the authority?)
Such control events are fine for things like throwing a grenade or picking up an item to inventory, but what about Jump, Strafe, and such that should be super-responsive?
No, that was the case in very old games and it created an unbelievable input lag. It is actually the second way you describe it. You can test it out by having a client desync and fall while the server is still thinking client is held in place (by despawning the ground on the client but not on the server) and it will create that repeating lag/teleporting effekt. If you wanna understand more on how it works check this out: What Every Programmer Needs To Know About Game Networking | Gaffer On Games