Page MenuHomeFeedback Tracker

Spawned AI cause significant server performance cost compared to those placed in the editor
New, WishlistPublic

Description

When AI are spawned after mission start using the createUnit Array or any BIS function, the server load increases significantly more that an equivalent number of AI introduced into a mission via the editor.
This can be demonstrated using the attached example missions that use 400 AI on each mission on opposing sides (the effect definitely exists with far fewer AI, but 400 helps to illustrate it).

When I run the tests on my dedicated server, the editor placed AI give 32 - 48 Server FPS when AI starts and 22 FPS when they get moving, while the spawned AI give 7-9 FPS when they are all spawned and 11 FPS when they get moving. {F21025}

Details

Legacy ID
3507287126
Severity
None
Resolution
Open
Reproducibility
Always
Category
AI Issues
Steps To Reproduce

Export the missions onto the server.
Load up "400_ai_test_server_editor_bis", start the mission and observe the server FPS.

There are 200 Blufor AI and 200 Opfor AI on opposite ends of the runway which will start moving toward each other and eventually engage in combat.

Note that the FPS reaches a constant level once the AI start moving and then a new constant level once the two sides start shooting at each other.

Then Load up "400_ai_test_server_spawn_bis", start the game and wait 10 seconds for the AI to begin spawning. They will then move out in the exact same manner and the rest is exactly the same as the previous mission.

Additional Information

The performance difference between spawned and 'placed' AI could be much greater, as the server performance with the example mission that spawns AI may reach a minimum level with fewer AI.

For both missions, there are 40 groups of 5 basic infantry used on both sides, with a simple move waypoint given to each group leading to the opposite side of the runway (where the opposing side starts).
The code for spawning the AI is executed in the init.sqf.

Event Timeline

Phoenix_ZA edited Additional Information. (Show Details)
Phoenix_ZA set Category to AI Issues.
Phoenix_ZA set Reproducibility to Always.
Phoenix_ZA set Severity to None.
Phoenix_ZA set Resolution to Open.
Phoenix_ZA set Legacy ID to 3507287126.May 7 2016, 3:37 PM

If the category is wrong, then please change it.

ceeeb added a comment.Jul 28 2013, 3:01 PM

The spawn mission creates 400 units, while the editor test mission has only 200 units. Once the spawn init.sqf is modified to create only 20 groups per side, performance is near enough to equal.

I suspect that even with equal number of units, the spawn version may create more complicated pathfinding than the mission editor version (need more comparable group starting points via init.sqf)

I am unable to test this on dedi. But ceeeb should be right the 1st reason he mentions, but also "the spawn version may create more complicated pathfinding".

Check issue 0012695: createUnit (array) creates AI with skill 1 by default (http://feedback.arma3.com/view.php?id=12695)

which indeed should activate more demanding routines from the AI.