Reducing replication delay in fast-paced combat game for "knockback" e.g velocity applied to player

Hey all,

We are building a fast-paced combat game where players can attack each other in melee combat. When a player hits another player, the damaged player receives “knockback”, e.g they are physically knocked back slightly. You can see this mechanic in games like Minecraft and many fighting games.

I tried several methods to achieve this, but the most consistent was directly applying velocity on the target client. Other methods ran into the problem of Roblox giving clients complete authority over their own player’s movement, which then replicated to the server. This is actually super similar to how Minecraft works (Minecraft has Client-authoritative movement and a ‘set velocity’ command and uses that for knockback).

So the process for knockback is as follows:

  1. Player 1 attacks Player 2 successfully
  2. Player 1 fires an event at the server representing this attack
  3. The server validates this action and fires a knockback event at Player 2
  4. Player 2 receives the knockback event and adjusts velocity, simulating the knockback

Here is a video demonstrating knockback in its current state:

This method works consistently, but has some issues.

  • Passing the event from Player 1, through the server, to Player 2 takes time. This adds a delay to the knockback happening, which can look and feel bad
  • This method is open to exploits, although it’s preventable

I’m struggling to think of good ways to reduce this delay without doing custom replication which is a major pain in the butt and adds a lot of overhead to all replicating tasks.

My questions: Do you have any ideas for ways I could reduce this delay in knockback being applied? Have you experienced similar problems in Roblox games related to movement when the player is authoritative?

Any help much appreciated, thanks for reading.

3 Likes

No you cannot travel faster than the speed of light and client side prediction in this case will lead to rubberbanding almost 100% of the time to correct between predicted and real knockback. The minecraft model is best and on low pings feels instantaneous enough.

2 Likes