I am currently working on a game with authoritative networking. However, for the mouse look, should the player send the rotation to the server or should the server process the client’s mouse position and then set the client’s rotation? In Insurgency - Save 66% on Insurgency on Steam, and other similar source games, the client appears to send the mouse position and base rotation off that. Could someone please just give me their option, since the most obvious way is for the client to send their rotation, but I want to reduce the chances of cheaters as much as I can
client should only send movement inputs to the server, which then tests the move and broadcasts the position of all moved objects at whatever interval you need.
It’s just that I think there might be a bit of a performance issue with sending the coordinates of the mouse over the network every frame. Any other alternatives, or should I take the potential performance hit to deal with cheaters?
Yep, sorry, wasn’t thinking last night. I do send the heading in degrees as an Int16 - it’s one of the few things that isn’t too important for cheating. Especially as I have a “do a 180 u turn” key as well.
I probably didn’t explain enough - It’s a 1st person game. I was thinking of sending the X rotation and the Y rotations to the server and making sure that they aren’t outside the mouse look’s clamp range. I’m also going to use Steam’s Authentitation system and check if they are VAC banned too (If it goes on Steam)
You must send the direction of the camera as precise as possible (not too many little hacks and work arounds ), otherwise the movements will get out of sync.
The way I do it is: I send a rpc with commands and camera direction , all in the same rpc. This way it stays in sync well.
There is no point to try and prevent aimbot or else(regarding rotation)… hacks will always be possible.
The movement input needs sending to the server, so it can be translated into motion and positions then broadcast. The Y rotation can be sent which you can cut down to an word or byte even. All clients will Lerp and player Y rotation changes so sending accuracy to decimal places isn’t required.
What I do is send the mouse X * sensitivity and mouse Y * sensitivity as two floats, then process that on the server. I also use client prediction to smooth it out. Then, using Network View, the rotation is overridden by the server. Using this: Posts as a console really does help on performance. Lerping with mouse look didn’t work for me - it’s very juddery. Thanks for your help guys.
Btw just for movement, is 3.5kbps a lot of bandwidth?