I'm not asking for any scripts
I was wondering how people make massive RPG games with NPCs that aggro on to the player and other humanoids
Some scripts I've seen it checks the entire workspace for Humanoids but this gets very laggy when you have big maps. I have tried using Region3 but then the problem occurs that you need to clear a space or it needlessly checks the surrounding props.
My current tactic is putting all the NPCs in a folder so I can loop through it and only get NPCs which removes the problem of looking through the entire workspace however when I look at the NPCs such as the drooling zombie NPC roblox supplies I get really confused by the use of modules and the point of them.
I just want to know anyone elses ways of making not laggy enemy NPCs or you have links of making better ai
A Module Script allows you to reduce the amount of repeated code (DRY Principle). Functions will need to be written only once, and then can be used everywhere by requiring the module.
...
Hundreds of humanoids in the same place is bound to cause a lot of lag.
A technique I read about was to have the server handle the NPC information as a 'skeleton'. Then have the client render in the limbs and animation. While I can spend all my time re-explaining these ideas, the original posts are better in explaining. Plus, the replies may spark an idea for you.
...
This Roblox Devforum post by Ruben_Zanzus is a neat way of handling many NPC's. He managed to handle around 1500 NPC's while maintaining 60 fps.
CARBID_TM's reply at the very bottom is basically what I was trying to say: Most efficient way to have semi-large amount of NPCs
CARBID_TM explains the concept in more detail: Supporting a large amount of AI
This one has a few thread redirects to check out and talks about disabling unused HumanoidStateTypes. For example, the climbing state casts several rays to check for walls: Collisions and zombie NPCs