LAG - How to handle lag ? (Player kill each other)

Options
Hi,

I have made a game where you can fire spell (one every 3 secondes for example).

I check on client side if the spell touch, the issue is:

There is 2 players, A and B

Imagine player_A lag, so the player_B become immobile, the player_A shoot him easily. Then the RPC from A is send to B, to said your are dead, but the player B wasn't at the good position.

I have no idea how to do that correctly.

Wrong decision for me :smile:
Solution 1 : Ask player B, are you near that position ? if not, I make no damage, but that make a bad user experience for player A

Solution 2 : Check last value receive from user B, if that is "too old" ... bad user experience too

The only good solution is to make my own server logic with server photon and validate position of each player on server etc... (Game logic). But my skill level for server is near 0. I hope I will found other solution for my game.


Comments

  • Tobias
    Options
    Some party (either client or the server) has to make the decision who can be shot and who gets a kill.
    It is only a slight improvement, if the server does this calculation: If B is lagging, then neither A, nor the server know where B is.
    You can try both rules: Let the shooting player decide if it's a hit or let the target player decide if it got hit (and killed).
    Even if the shooting player defines the hit, the target should probably decide if it's a kill or not.
  • Honikou
    Options
    Hi Tobias,

    Yes but if B is laggy, and A shoot him, he will have a bad user experience with a great connexion... And the sensation of "touch" on fast game and fps are very important.
    But, if A is laggy, he will kill everyone easily. I don't like choose between two things like that.

    I think, if A shoot B, I have to check the last position of B received, if that is near 0.1sec (for example) , I accept the shoot, if that is more, I ask B if he is near this position at the current time when I shooted.