Ability Framework Replication Help (Similar To The Strongest Battlegrounds)

Hey there! I’m working on an RPG Souls-like game, where I need to create abilities and weapons that both players and NPCs can use. I’m struggling with the replication and structuring of the code for these abilities.

For example, here’s a dash I’m working on:

Here is what I’ve tried till date:

Method 1:

  • Client takes input, requests to server
  • Server validates cooldown, tells all clients to simulate vfx
  • The attacking client listens to the same signal and applies physics on itself

Pros:

  • Physics is smooth, since all bodymovers are on client.
  • Tweening functions nicely
  • VFX is in sync with animations

Cons:

  • Server has no idea what’s happening; can only make guesses.
  • Chaining of abilities with multiple moves difficult for the above reason.
  • VFX on NPCs is not in-sync with the actual ability, since in this case physics is on server and vfx is on client.

Method 2:

  • same as method 1, except that all vfx and physics is on server.

Pros:

  • Server is aware of what’s going on
  • Chaining of abilities possible. If one hit lands, server can play the next move
  • Server is aware of player’s movement and can reliably spawn hitboxes on end of a movement ability.

Cons:

  • Takes away smoothness of physics, dashes with turning
    are a big no-no
  • Tweening will now stutter
  • Isn’t necessarily great at vfx replication, but atleast the vfx is somewhat in-sync with the ability since both physics and vfx is handled on the server.

TL;DR
Both the above methods I’ve used have failed. The attached videos will explain them properly. I’ve tried keeping all vfx on client, but I’m not able to reach the smoothness of a battlegrounds game. Somehow, in those kinds of games, the vfx is on-point. The physics is also client friendly and reacts immediately to camera movement. I want to know how they achieve that.

If anyone knows how the replication in TSB works, please let me know!

4 Likes

Hey so i’m not much of a help here but may i know how you make your dashes? im also trying to make a dash system like tsb so i can flick my dashes

Right now (and this is not confirmed to be how tsb does it), I’m applying a linearVelocity RelativeTo the lookvector of the player on server. This allows the client to change direction at any moment, and I’m decelerating that velocity in a heartbeat loop (on server, also). It gives a proper result, but I can’t say if its how it should be done.

thanks
i got mine working with body velocity and applying physics to it so the player does not just stay in the air