Why do people say to use client animations for combat?

I’ve researched for a while and a lot of people on DevForums say that animations should always be played on the client… okay but when you’re making a combat game that has combos, and stun systems how do you detect if a player’s stunned or lost connection? I’m pretty sure anyone who scripts a game involving combos wouldn’t want the player’s combo to still work when the player’s disconnected.

Not only that but when you check if a player’s stunned on the server it’s easier to control if the player shouldn’t be able to attack. But on the client they may not even get the message yet, so the player would still be attacking??

So I don’t get it if people say to play animations on the client then what do you do about these main concerns?

You clearly haven’t researched enough. You’ll usually see something along the lines of “server load” or “lag” when people say to play effects on the client. This is because handling effects on the server will usually lag it out, such as tweening or particle effects.
You’ll still handle all the collisions and hitboxes and whatnot on the server, because you should never trust the client to tell the server what to do.

Players disconnecting is a very weird situation, since I’ve rarely seen it happen, and I don’t think there’s any issues with it. If you disconnect while playing a fighting game, that’s on you for relying on your unstable internet.

This is because handling effects on the server will usually lag it out, such as tweening or particle effects.

Never experienced this with any games I’ve released. Playing animations on the client would make the combat not synced with the server, and if you’re making server combat with hitboxes, stuns, and combos on the server then you need to make sure everything is synced accordingly.

Players disconnecting is a very weird situation, since I’ve rarely seen it happen, and I don’t think there’s any issues with it. If you disconnect while playing a fighting game, that’s on you for relying on your unstable internet.

I was mentioning that when a players internet spikes irl or their ethernet cable goes loose just a simple example. When you’re disconnected your client will still play animations when you click. So I’m confused, what would I do to make sure that the player isn’t disconnected from the server before playing the animation and adding the combo?

that’s on you for relying on your unstable internet.

Okay but it can become abusable, I mean there’s ways to make sure that the player doesn’t hit the other player more than once but why would I want some ugly unsynced animations on the client to begin with when I can just play the animations on the server with no problem? as I said I’ve had no issues with this before, never had a server crash over it.

??? No, you tell the server you want to attack in a certain way, and then the server will process that request and tell every client to play certain effects. You’re making it sound like you’re handling hitboxes on the client side, which is a terrible idea.

Ethernet cables going loose is also a little odd, I wouldn’t trust gaming on that. Internet spikes aren’t really an issue, it’ll just delay when the input gets to the server, or when an effect to play is received by the client.

I’m confused with what you mean by “ugly unsynced animations”? If the game lags a little for a client, the animation won’t stop and the client won’t fall behind, it’ll just catch up straight away once the connection is stable again.

Never said the server would crash. I just said that it would lag the server since it has to handle much more work than it should.

I do my animations, effects, etc on client for well, its better cause the server has to run all this stuff and that creates lag so the more you do on the client can be better (unless its like data n stuff).
As for people leaving or disconnecting having something in place to detect for this would be rather smart!

at least my thoughts

1 Like

??? No, you tell the server you want to attack in a certain way, and then the server will process that request and tell every client to play certain effects. You’re making it sound like you’re handling hitboxes on the client side, which is a terrible idea.

Are you implying that I should fire the client to play the combo’s animation? I mean this would work, but it would still be unsynced depending on the players ping.

Ethernet cables going loose is also a little odd, I wouldn’t trust gaming on that. Internet spikes aren’t really an issue, it’ll just delay when the input gets to the server, or when an effect to play is received by the client.

Thing is I don’t want animations or combos to play at all while the player is disconnected. That’s why I’m confused. I could use a RemoteFunction and invoke the server then return the combo to play the animation with. This would fix my problem, but remotefunctions are a bit laggy.

I’m confused with what you mean by “ugly unsynced animations”? If the game lags a little for a client, the animation won’t stop and the client won’t fall behind, it’ll just catch up straight away once the connection is stable again.

What I mean is that if the player’s disconnected from their internet then the animations still play when the player clicks. This is a scenario where the combo is handled on the client too. It’s the only way I can see making animations on the client work, which I can’t see working.

Never said the server would crash. I just said that it would lag the server since it has to handle much more work than it should.

You said “Lag it out” which implies the server crashing, but point is regardless I haven’t seen any lag happen from server animations when making combat systems.

When I make running, and walking animations, and just anything basic I tend to make it on the client. But for server based stuff like combat you need to make sure the player’s connected to the server as well. I can’t simply just play an animation on the client without checking if the player’s connected to the server. Because if they’re not connected to the server then when they reconnect the remote that handles when the animation should damage the player will have been ran like 20 times.

Also adding to this, I can add checks to make sure it only damages them once but the point is I don’t want them to be able to attack or do anything while disconnected.

Everything is a “bit laggy” when it comes to networking, lol.

I probably didn’t explicitly say that no effects will be playing until the server confirms to the client that the attack is being executed.

I’m not sure how you’ve tested this so I can’t really comment on it.

1 Like

So by disconnect to the server you mean like the user lagging out?
If so thats gonna be a problem no matter what, that is a downside of this method, but doing it client sided means that they are less likely to disconnect because the server has to store much more data. And it storing lots of data on the servers can start to make client server connections really bad, ping can increase, things taking longer to load, etc.

What I’m not talking about isn’t just simply lagging out. I’m talking about ping spikes, because in different regions the server spikes up to 300-400 ping for some players. And in games like deepwoken, or any combo based game the way that combat works is since the combat is handled on the server their attacks are slower based on their ping because the network has yet to receive the message from the server before continuing. I don’t know how they handle animations, but it just feels like they handle them on the server as well.

Everything is a “bit laggy” when it comes to networking, lol.

Good point, I may try just using a RemoteFunction and see how that goes.

I’m not sure how you’ve tested this so I can’t really comment on it.

Simply just made a game and it had servers over 30 players without any lag spikes that I know of. Nobody complained about disconnection or lag issues. And I handled animations and hitboxes on the server and everyone seemed to like that more.

1 Like

Well it really depends on which one you want to use.

On the one hand you can do it on the server and risk causing higher ping to begin with and peoples attacks could register late and the game getting slow,
Or on the other hand do it on the client where the user could possibly exploit it (which is getting rather rare these days) but it makes the server have to use much more of its data in order to run animations n stuff, although if a user does have ping that can very much mess with the attacks and make them be weird.

Maybe you can find a middle ground where it runs on the server only when it needs to. Just some thoughts

2 Likes

I’ll mark this as solved, I’m probably going to try using a remotefunction to check if the server is available every time the player clicks to attack on the client. It could cause lag, so we’ll see. If it doesn’t work out I can always just change it up though that’s the good thing about scripting anything.

1 Like