ServUO Version
Publish Unknown
Ultima Expansion
None
Hello ive been testing for quite a lot. i noticed that the higher the mobile speed (CurrentSpeed) the more cpu the server uses, i spawned 500 mobiles with 0,250 speed and the cpu usage increase to almost 10%. Is there a way to optimize the way the speed its handled?

I can spawn 5k mobiles with low speed movement and the cpu doesnt even increase at all
 
If you spawned them all in one place, then the CPU usage will be mostly from movement pathing from them trying to think and move around and validate targets, and send packets to your client.

AI are not active when there are no players around.
 
Hello. It doesnt matter if i spawn them at once or 1 by 1, the cpu usage its due the currentspeed, ("way too fast") lets see if i explain myself good:

I spawn 400 custom mobiles, at 0.250 currentspeed, the cpu gets to 4-6% if i freeze them (Attach XmlFreeze) the Cpu goes to 0%

if i change to currentspeed to 5 (very slow) the cpu decreases to 1-0% so it has to do with the high movement speed
Im using Runuo 2.2 by the way
 
Last edited:
I don't think you understand, try spawning 400 mobs spaced 100 tiles apart from each other across your map vs 400 mobs within your screen and you'll see Vorspire is 100% correct!
 
As Voxpire said it's probably the pathing. The reason why the CPU increases when the speed increases it's because the pathing calculation rhythm also automatically increases. If 400 mobs need to move every X ticks, the CPU has to calculate the pathing every X ticks.

Therefore, if you make the ticks 20X (i.e. 0.25 interval instead of 5, as per your example), the CPU has to calculate 400 pathing 20 times faster than before. The faster they move, the more pathing (and all the rest of AI calculation connected to that) has to be calculated exponentially.
 
Back