caster skill how to sync

When I press a cast key, the skill starts to play. The host receives the message after a while because of the network delay, and starts to play the skill. The performance time of both sides is inconsistent.

Answers

  • I'm working on a small multiplayer rpg and what i do is I run a simulation of the skill client side- check if the skill can be executed based off client state and if so, play the animation (this is networked so the host/other clients see the animation being played). Then I run a simulation of the damage calculation based off the client state and pretend to deal the damage. So the client sees the action being executed when they press the button and doesn't ahve to wait for the server. While that is going on, I send an RPC to the server and tell it to execute the validation/damage calculation (I don't care about the animation since the client is syncing it). Once that is done it applies the "real" damage to the target and that gets synced to all clients.

    TL;DR- simulate it client side and do it for real on the host/server.

  • Thank you for your answer!

    Has the damage calculation result been verified by the server?