Simultaneous RPC and Remote move execution

Hi All,

I am going through Epic’s CouchKnights to see how they have set up the networking two player system and am confused about this thing that they are doing.

For the Attack they are running the setting of the trigger variable BOTH as an RPC on the server and locally if the player is the Remote.
Like this:


BUT when I do that in my setup and dial in PktLag=300 and run that move, I get a double move triggering when the Remote player executes the move.
This is not strange as it first executes locally and then again as the RPC comes into effect 300ms later coming back from the server.

Why are they doing this? I don’t understand how it is meant to work?

Cheers

All the logic for handling the attack seems to be handled by the serverside AttackEvent, so “attacking twice” should only be graphical i imagine. Although i guess it affects gameplay in that you have to sit through the delay twice if youre a laggy client.

As to WHY, well I guess they want the player to get instant feedback for when they press attack instead of waiting for when the server tells em to trigger the animation?

I ask Why because I can’t see how this would make sense?
The attack is gets triggered twice twice and it is not just cosmetic. (also it looks bad with the double start)

I am trying to look at their example to learn how I should set things up, that’s why I would like to understand why they have set it up like this?
Do other people do the same?

Cheers

Unless stated otherwise, we can only speculate.

I think its one of two possibilities. They want to give the user instant feedback that their input was recieved OR they got lazy and didnt bother tidying up the code since the double attack is mostly a graphical artifact.

Im not familiar with this code example, but some of the logic behind the attack (collisions etc) may be driven by the animation as well.