So, I’ve recently made a sprinting system for my battlegrounds game, and I was about to start making the dash system, but I’ve been wondering whether I should handle the movement-related systems on the client, or on the server. For right now, the sprinting system is handled on the client, but that could change depending on the responses to this post. The reason for me asking this is that I’ve (kinda) recently read somewhere that movement should be handled on the client, I’ve also read somewhere, on the Dev Forum actually, that a game called The Strongest Battlegrounds (I’m sure you’ve heard of it) handles their movement on the client, and I want my game to have a similar feel to that game. The problem is that I’m kinda worried that if I do the movement on the client, I will have to replicate it to all the other clients or something (especially with the dashes) and the game will be less efficient, or the movement will be delayed for some other reason, there’s also the hacker dilemma, which I wont get into. But on the other side of the equation, I don’t really want to do it on the server because of lag and stuff.
So, should movement-related systems be handled on the server, or the client? What are the advantages of handling movement-related systems on the server and vise versa? What are the disadvantages? Which one would be more efficient? Which one would provide a better experience for the players? Which one would cause less lag? Those are the type of questions I want to be answered. Thank you for your input in advance.
It depends. If you don it on the client, it will be smoother, but it will be exploitable. If you do it on the server, it will look laggy a tad, but it shouldn’t be exploitable. So it depends. If you have a good anti cheat, you should probably aim for client, if you don’t, do it on the server.
I literally just moved all of my sprinting code from Server to the Client. It’s not that complicated, because, from what I understand, Roblox replicates a lot of client movement and positioning on its own. I use custom sprint, so only have to sync up animations and effects. With dash it would be a bit complicated, but it’s still worth it, because players get an enjoyable and responsive move.
The gameplay might look smooth while testing on Studio, but have in mind, that Roblox servers won’t be that friendly to your players and some might have to wait half a second for their dash to start. You could potentially hide some of that lag with animations, though.
In regards with exploits and dashing, I’d send player dash start and end positions to the server and validate the distance there, correcting the client if needed.
Thanks for you input! but can you elaborate on how I could send a player’s dash start and end positions to the server? Because I’m currently using linear velocities to create the dash, and I plan to make it so that you can turn while dashing, so I’m kind of having a hard time with coming up with a way to do that. Also, how would I utilize the start and end positions? Would I constantly check the position of the player to make sure there not going past the end position or something? just want some clarification concerning the anti-cheat type stuff. Thanks!
Sorry, I was thinking about simple forward dash with fixed distance. In that case, send start and after dash ends, send end position to check the distance in server to validate distance (no need to be exact) and inform other clients that a move started/ended if needed That’d be easiest.