Hello,
I’m currently testing the performance of scripts in my game. A particular script that controls NPC movement has high activity rates, up to 5-6% in a full server.
I’m not entirely sure what activity rate I should aim to stay under. I’ve heard here and there that the benchmark should be 3%, but I haven’t found much documentation to justify this claim.
I haven’t presently faced any issues of server-side lag with the game (even with well over a 100 NPC characters present on the map), but I’m worried that my script may be poorly optimized.
Basically, do the below metrics show any symptoms of inefficient scripting? And, if so, what can be done to reduce server load with NPC movement?
For some extra information: the NPC’s use custom A* pathfinding which runs on a queue system in the ServerController (script activity here averages around 1% and rarely exceeds 3%). The tweening and animating of NPC’s is done locally.
The NPC move script is cloned for each NPC and handles determining the particular NPC’s current destination, path and movement (the movement is done through :SetPrimaryPartCFrame() )