How to optimize a lot of npcs?

Hello, i’m working on wave defense game, and i want to achieve around 100-200 enemies at once, but i also want them to have some basic collisions with enviroment

My current aproach is:

  • Hitbox cube on server (and uses roblox physics for collisions)
  • Model & VFX client sided
  • Use Animation controller and lerping in another thread rather than using humanoids
  • Send less data via network
  • Disable touched event detection (Idk if it gives some performance boost, but taking into consideration they can fire a lot of touched events maybe…)

Does anyone have good idea?

My main worry is about collisions, because enemies must collide with enviroment, other enemies and player, but it may also lag

1 Like

I mainly create NPCs directly on the client (so non-networked) as i mainly make SP games, but for having networked NPCs that are efficient, you prob have to start with optimizing the Humanoid (or even use a custom solution) and have 1 AI script managing all npcs and handle VFX and Animations on the client

2 Likes

Collision fidelity is good but alone it won’t solve everything so I recommend using parts that scale with each NPC model. Just don’t make the mistake of using unions. There’s been too many weird issues related to unions and so I say if you’re going to do it just use parts maybe blender could help but even with that you still have to be careful if you are going for optimization. Hope this helps!

maybe try making your own type of humanoid because humanoids can be very laggy

Can you explain more about the game?