Good SNPCs optimization tricks?

I’m trying to optimize my SNPCs as much as I can so that it doesn’t lag the server. The only trick I found at the moment is to “Pause” the Think() function when there’s no one around the NPC.

Any ideas?

Disable IK on the models.

Garry added Entity.SetIK, but it dosen’t work. I made a thread about it awhile back.

Isn’t that Clientside though?

I am not experienced with scripting for GMod, but I am experienced with Lua.
Wouldnt it be possible for you to create a streaming feature for the NPCs? There isnt any reason in having them around if noone is close or looking at them. As I said before, I dont have any experience with scripting for GMod, so I am just guessing here.

The idea is to store all the info you need about a NPC to recreate it once its needed. If there isnt a player around the NPC then you can just destroy it and keep the info stored in a table. Then when a player gets near the area where the NPC was or looks at that area, you can create it again with the data stored in the table. This will eat some memory, but not a lot. If you can script it with the tools GMod offers for Lua, then Im sure this will help you solve the problem you are having.

Networking causes most of the lag on a client. Disabling IK stops the client from sending a shit tonne of unneeded data to the server.

See how many fast zombies you can spawn without lag, then see how many citizens you can spawn without lag. You should be able to spawn alot more fast zombies.