Server or Client side?

Hello everyone :slight_smile: !

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 :

  1. The client send the spellID and the spell position to the server with a remote
  2. 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 !

Thanks for reading

2 Likes

Both. Both the server and client. On the client for immediate feedback for UX’s sake. On the server so everyone else can see it.

1 Like

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).

1 Like

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.

Remember: Never trust the client.

2 Likes

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.

1 Like

So, Order1 or Order2 ?

Order 1 :

  1. The client send the spellID and the spell position to the server with a remote
  2. The visual effect is played right after the info is sent to the server for the player who sent it on his machine
  3. The server does some sanitycheck
  4. The server fire all clients throught a remote with the spell ID and position
  5. All clients do the visual effect from their machine (execpt the one who sent it, cuz he is already playing it)
  6. At the same time the server will do the damage when needed

Order 2 :

  1. The client send the spellID and the spell position to the server with a remote
  2. The server does some sanitycheck
  3. The server does the visual effect and the damage when needed
  • Order 1
  • Order 2

0 voters

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.

1 Like

Simple question, firing a lot of remotes at the same time doesn’t cause a lot of lag ?

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.

1 Like

and the magic circle was made from the server or the client ?