Jump to content
Sign in to follow this  
PeterBitt

Performance: Spawn AI or DisableAI ?

Recommended Posts

hello mission makers, i have a question regarding the performance loss with many units on a large island:

how is the performance boost of disableai compared to spawned units?

i want to have 200+ units on the map that wake up when you get closer to them - how will performance be when 200+ units stand around with disableai "move", "target", "watch", and so on? do they affect the performance negatively when they are not in sight?

should i better spawn the units when needed?

Share this post


Link to post
Share on other sites

I'd say in general performancewise its best to spawn something. Tricky part is to get the spawning distance right so the player doesnt realize it. Once he sees something spawning in front of him the emergence is gone.

So i guess you should do what you feel most comfortable with. Both ways can destroy your mission if you do it wrong.

Share this post


Link to post
Share on other sites
hello mission makers, i have a question regarding the performance loss with many units on a large island:

how is the performance boost of disableai compared to spawned units?

i want to have 200+ units on the map that wake up when you get closer to them - how will performance be when 200+ units stand around with disableai "move", "target", "watch", and so on? do they affect the performance negatively when they are not in sight?

should i better spawn the units when needed?

Hi,

Well, the best option is ofc to spawn the units within the mission.

DisableAi is not what you would want, but enableSimulation and maybe hideObject?

_neo_

Share this post


Link to post
Share on other sites

thx for quick reply mates.

when using "enablesimulation false" + "hideobject" i should gain good performance, shouldnt i?

i can leave out "disableai", right?

my problem with spawned units:

i have set the spawn triggers to 1500+ meters, so it happens that on my way to task-A, the units from task-B get spawned too and stay there forever, doing waypoints and eating performance...

when using disableai (or better "enablesimulation") i can disable the units again, when i leave the zone.

another pro is that i can place the units via editor and dont have to script em.

Share this post


Link to post
Share on other sites

Why don't you use Wolffy.au scripts that cache groups (down to just one person) until you get close to them? Havent got the link at the moment.

Share this post


Link to post
Share on other sites

i think if you dont disableAi on all "move", "target2" etc they will still eat performance based on surroundings.

I think if you use disableAI along with hide and enablesimlation they will be treated as an dead object, only taking up space not being used in CPU calculations.

Easy way to test this is to place down 2-300 units and load up fraps to see the FPS.

try once with only hide and enablesimul false and compare that to a run with disableAI included.

But anyways, spawn will always be the best way to limit CPU usage.

Also search for cache scripts, they simply delete any units exept the leader in a group based on certain distance from a player or side and that really helps out on Big battles.

Fex: 50 groups with 10 people in each group is 500, wich is alot for the CPU, using cache script you only have 50 units running on the CPU and when near one of the based on set distance you have 59 units running the CPU, within reach of a second group and you add 9 more etc...

All wps and such are intact for the groups.

Also there is a script by murklor, wich basically makes you put down whatever you want in the editor, assign wps etc and then they are deleted at mission start and spawned with correct wps etc once a trigger is activated, wich could be range, variable based or different conditions etc.

Think this script was updated not long ago aswell.

Edit: Kremator beat me to it with the cache recomendation :)

Edited by Demonized

Share this post


Link to post
Share on other sites

cool i definitely will check these two scripts asap. especialy the one from murklor sounds very promising!

i tested a little with many groups in editor > strangely "enablesimulation false", "disableai "xxx"" or hideobject dont help much with performance :confused:

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×