I’m designing a PVP game where the client sends weapon input to the server, and the server then handles all weapon mechanics like cooldowns, damage, and range. My main concern is if this will lead to lag, performance issues, or desynchronization in a PVP environment.
I’m in the design phase and haven’t implemented this yet, but I’m leaning this way for cheat prevention and game state integrity. If you’ve worked on similar systems, I’d really appreciate any advice on how to mitigate lag and manage server performance.
Thanks pls comment i wanna know ;-;
Yeah, it can lead to lag. This is unavoidable due to ping though. There are things you can do to mitigate it.
I’d recommend using client-sided hitboxes with server validation (such as a range check, or checking to see if the attacker is facing the victim) instead. If you want security, you can make the server re-fire the client to create the hitboxes, but this can also cause delay depending on if your weapon has a windup or not. (see post below, I’m kind of bad at explaining lol)
Everything else should be fine on the server, but cooldowns may be inconsistent. If you want, you can use client-sided cooldowns with a server-sided check (with lenience).
This might be a good read for you when it comes to hitbox related stuff: