Jump to content

Corpse cleanup for performance


Recommended Posts

Hey guys,


A quick suggestion to help performance on IA.


I just found a topic on the BI forums where multiplayer performance was discussed. http://forums.bistudio.com/showthread.php?169484-What-I-found-about-performance-and-I-what-I-want-to-help-fix-it Two main conclusions come from it:


-General A3 Multiplayer performance tends to deteriorate over time for no clear reason

-AI corpses do take part in this, but there's still a large part of performance decrease left unexplained.


Some quotes:


Altis airport (at our starting location) - 80-90 fps in all directions GPU usage around 75%.
Pythos town NE corner - 70-80 fps - GPU usage 60%
Pythos town with 40 AI in the town - 45-60 fps - GPU usage 55%
Multiplayer with 35 players and 70 AI before the fight - 50 fps - GPU usage 50%
Multiplayer with 35 players, 70AI most of them dead - 25fps - GPU usage 30%
Multiplayer with 35 players, 70 AI most dead and running a deletion script to remove them - 35-40 fps - GPU usage 40%
Singleplayer campaign first mission at start - 25-30 fps - GPU usage around 30-35%
Showcase infantry at start - 70 fps - GPU usage 75%
So initially what I did was create a multiplayer performance mission with 50 v 50 AI battle in a valley and watched from a vantage point. I tested it with our mods, no mods or map scripts +mods and with our full setup including MCC spawned units. I wanted to make sure our modset wasn't to blame. What I determined was less than a 2% difference between the runs, so the scripts+mods didn't seem to be the cause.
In all cases FPS never fully returned after the firefight once they were all dead and stopped moving, but it did recover about 50% of the performance. I saw 80fps before the firefight, dropped progressively to a minimum of 45 during the fight and then recovered to 60 fps.

As a test showed the problem to some extent but it never got down to 25 FPS despite all that was missing was 30 odd other players. I tried changing the test in various ways and I couldn't reproduce the 25 FPS, the results didn't really change too much with more or less AI or vehicles or changing the location to a town. This suggested to me maybe it was due to the players and not the AI or the mission. However the performance test did show that dead bodies consumed a lot of performance, so we tried deletion dead bodies mid mission and it certainly helped a bit (as you can see above) but its only about 60% of the drop that happens after a firefight is finished. Whatever is dropping performance through missions is mostly dead bodies, and our best guess is probably PhysX (since it doesn't seem to run on the GPU at all) but there is still a third that never comes back.


Another user on page 4:

Initiale FPS was tested in editor because I don't know how to make them spawn dynamicly (abou 70 fps on my setting).
So at first the fps is about 34 FPS for me. Then I kill them using the trigger, it drops to 7FPS (for about 5 sec) while the ragdoll effects kick in. Then the FPS jumps back to about what it was when all the AI was alive and running (about 35 FPS). So, at least for my specs, the dead bodies use has much ressources then the alive AI.

I finaly end up activating radio trigger Bravo to hide all the bodies. I need to wait some seconds for them to sink completly into the ground, then my FPS jumps back up to 70 FPS (about what it was in the empty editor at the same spot).


It may be worthwhile looking into corpse cleanup as a partial way of improving FPS.


Hope this helps! 

Link to comment
Share on other sites

Thanks for the research, Shorts!


This is built into I&A 3 in a more substantial manner (see AW_fnc_addDead (a function that is run on every AI unit upon death) and AW_fnc_collectGarbage) but is also already in I&A 2 in the form of a loop that, every 5-10 minutes, clears up any dead bodies and groups.


While that side of "garbage collection" is taken care of, it is admittedly done in a heavy-handed fashion in I&A 2!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Forum Statistics

    Total Topics
    Total Posts
  • Create New...