I’m currently building a spell system in my game and I was wondering if it was better to do the visual of the spell client side or server side.
Basically, it’d work like this :
The client send the spellID and the spell position to the server with a remote
The server do some sanitycheck
Then i have 2 choices :
Fire all clients from the server with the spell ID and position then do the visual effect of the spell on each client, and just do the damage on the server by using a basic part.
Or I do everything from the server, doing the damage from the spell (obviously this will always be on server side), and the visual effect from the spell (so I wouldn’t need to fire it to every client).
So give me your opinion on which one is the best !
I think it will be better to do the visual on the client as it will look smoother for the player, and it will take a bit of strain off the server (very tiny, but still).
It’s better for you to do the visual stuff on the client and then handle how much the damage of the spell, the cost of it (if there’s any) and the cooldown of the spell on the server.
Why? You might ask? Well you see exploiters are a thing and they can ruin the players day easily if you give them access to change the spell’s damage, the cost and the cooldown of the spell too, that would be COMPLETE CHAOS.
I’ll have to agree with Nerkonl here. Do not put things like XP, Dameage, Cooldown, on the client, as that can easily be exploited. Put the visuals, like the animations on the client, the projectiles(maybe). If your cooldowns were client based, they can easily be spammed and exploited, ruing the game for everyone.
I worked with a game similar to what you are trying to achieve. In order to cast your magic, you pressed the certain keybind, which they fired 3 remotes, one told the server I’m about to cast, the next made the magic circle, and the 3rd fired the projectile. If you tried to exploit this, the cooldown was still there, but it was faster. You can also make it so that if the remote is fired X amount of times in X duration, they could be kicked, and maybe logged to a webhook.
Edit: The second remote also sent the location of where the projectile would be hit.
it does in some cases, it also depends on how you structure it. It didn’t lag for other players as much as it would for me. I noticed that if I spammed remotes for lets say 30 minutes ish, it would lag, but if I stopped for 1-2 minutes, the lag would disperse.