[SOLVED] Zay-Es Networking Client Side Changes


This is true if you do need full client prediction (basically you need to put the physics collision code on the client and the server, doubling your code. Increasing complexity alot, etc etc. I would not recommend client prediction if you can get away without it.

I did manage to implement a pseudo client prediction system ontop of simethereals interpolation that ‘feels’ good when playing at decent lag levels. (less than 400ms of lag, less than 2-3 percent packet loss). Basically I decoupled position of the client spatial from the servers position, and then interpolate the spatial back to simethereals interpolated position every 10ms. This combined with some ‘dead reckoning’ style input ‘prediction’ changed my game from unplayable above 100ms to very playable and fun.

When things start to get up a bit in lag my tank starts to ‘slide’ a bit it feels floaty, a bit icy. The effect is actually quite nice I’ve found at reasonable lag levels.



So, that’s how I want to manage things:

Rotation: All players have a BetterCharacterControl which rules their physic behavior. The CollisionShape of the BetterCharacterControl doesn’t change its rotation. It only applies the view direction as rotation to the added spatial which of course doesn’t exist on server side. But on client side I can write a system who watches my camera rotation and applies it to the player spatial instantly. Then a new RotationChanged() message is sent to the server who informs all other clients about the change. The other clients set the new rotation for the specific spatial. This procedure doesn’t change the transformation component (which holds location, rotation and scale) of the player entity because this is just related to the view.

PlayerCharacterAnination: Animation is something that should be happen instantly too when there are input events. Even here I could write a system what watches my input and out of that it creates the suitable animations for my character. Then inputs are going to be sent to the server which in turn sends them to all other clients ant they in turn play the specific animations. So all this is just things who affects the view and because of that it should not have any impacts on the entity system.

Movement: Well, this is a difficult topic… but I decided to let this happen on server side. I don’t think I have the skill the build up a prediction system on client side. So I will follow the examples @pspeed provided (Thanks!). In the end all is just an illusion anyway. When I let animations play, the player feels like he is already moving. And that is what actually matters :wink:

I would appreciate any comments. :slight_smile:

Many greetings