I’m trying to make a game like Vampire Survivors, and in the game, there will be hundreds of enemies spawning around the player.
My problem is that I can’t find a way to make it secure against exploiters, while syncing it between all clients and ensuring smooth gameplay. I have tried this video, but it doesnt really work for this case because I’m expecting to have multiplayer and the clients won’t be in sync.
The big problem here is that the enemies have to collide with each other. Otherwise, I could just calculate the movement on the server and render it on the client, but the issue is really the collision between the enemies and the players.
Handle all game logic, including enemy movement and collisions, on the server, and use collision groups to manage which objects can collide with each other.
It’s best to handle NPCs on the client to prevent the server from shutting down. It’s recommended that you use parallel LuaU for this as well. You can also make it so that some far-away NPCs are computed on the server and closer ones on the client to distribute the load better.