Custom Character Collision on the Server

Hey guys, I’m working on what will be a competitive player versus player game and I need to bounce some ideas off other people for creating custom character movement.

There’s 2 reasons why the default Roblox movement is unsuitable for my game:

a) The client has network ownership over its own character, so cheaters could potentially move themselves anywhere they want. In my game solving this would require a pretty complicated server anti-cheat.
b) If a part is in workspace, then its position gets sent to all clients, no matter what. Entering a “stealth” mode where you can sneak around other players will be part of the gameplay, and cheaters could simply make your character model visible and see where you are at all times.

The solution is making the server send character positions to the client. I have already worked out a suitable system for server authoritative movement, but my last problem is that I need to handle collisions serverside too…

I would’ve liked to accomplish this by having a part on the serverside that is controlled by user inputs, usually game engines call that a Kinematic body since you don’t let the physics engine control it, but still use the collision detection. But I can’t place a part in the workspace to represent player positions, because then it would replicate to all clients, and stealthed players could be revealed by cheaters.

The only suitable way of achieving this that was suggested so far was to use a fan of raycasts in front of the player to detect when it will collide with something. I also looked into WorldRoot: GetPartBoundsInRadius but that doesn’t return any collision info, just a list of parts, so I would have to cast a ray to each part anyway.

The physics in my game are not going to be complicated at all, and there will be 4 - 10 players per server. But I would still like a scalable system…

Does anyone have any ideas for how to do collision detection on the server, without replicating parts to the client?

edit: I forgot to mention, there’s no player-on-player collisions. You can walk through other players. So all I need is collisions with the environment.

1 Like