Code Structure Concept FEEDBACK

Guys so I thought of a cool design system and wanted to talk about it.

You know how games like League of Legends, Overwatch and all those kinds of games have a slight lag in the actual activation of hitboxes, by having a short anticipation animation segment before actually attacking? Like an archer grabbing onto the bow, pulling it, AND THEN launching it?

This concept sparked an idea in my mind. So I thought of a system where I could play an ‘anticipation’ animation on the client, tell the server that I want to attack, and then somewhere along this anticipation client animation, the server would receive the request. After waiting for the client animation to finish, the server can play an attack animation and cast hitboxes etc.

So how it works is:
→ I play 'SwordLift' animation and tell the server I want to shoot
→ Server understands and waits for a delay, with lag compensated.
→ After delay, the server casts hitboxes and plays the 'SwordSwing' animation

Here are the issues with this system:

→ If a player lags more than the length of their client anim, it would cause the player to lift their sword up, drop it, and then suddenly attack. This problem can be solved by pausing the animation at the extreme point and keeping them there until the server launches the attack. Alternatively, the server can ignore the player’s requests if the time difference was too high.

→ The same latency issue arises when server announces the other players to listen in to the vfx event on the server’s attack animation. latencies here could result in no vfx spawned by enemy clients at all, making the attack invisible and hard to read.

1 Like