How can I handle +100 NPCs?

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.

Any help is appreciated!

2 Likes

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.

3 Likes

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.

3 Likes

I ended up deciding to make it single player for a better experience, thank you for the tips!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.