Jump to content
Sign in to follow this  
infiltrator_2k

Lags A Consequence Of Having A Populated Mission - Measures To Reduce It?

Recommended Posts

I created a COOP mission in Stratis that has 3 popular (bug free) scripts but maximum Opfor AI units which I believe is 144 and only 2 playable Blufor units for now just for testing purposes. The mission isn't anything fancy, just a combination of well placed units to make up well armed military sites with several groups of dynamic foot soldiers roaming the island. I found the mission playable for myself averaging 28FPS, but a friend who has an old Xeon CPU struggles with FPS averaging only around 9-12FPS. I sent him the mission to host to eliminate any connection issues but he only saw a couple of frames increase. When I've stripped out many of the Opfor units to make a lite version of the mission my friend saw an instant FPS increase to between 18-20 FPS which he finds playable.

The mission as I've mentioned isn't anything fancy and just involves eliminating the enemy units and destroying the Air Station Mike's radar site. I think the problem lies with the multiple triggers I have set. Basically I've inserted a trigger over the areas to be liberated and set a simple Opfor not present trigger. Is it that the mission is constantly polling to see if the AI are alive in the trigger areas that's causing the lag issue? If so, could Event Handlers be used to replace the trigger condition? Or is there any other way around this constant polling process if it is indeed the cause of the lag which I strongly suspect it is.

I believe spawning units at task/location 2 when task/location 1 has been completed is another remedy, but how can I say populate Air Station Mike with units where I want them as well as inserting the Site Modules? I've since learnt that an accumulation of bodies also causes lag over time which will explain also the deteriorating FPS as the mission progresses.

Share this post


Link to post
Share on other sites

Have you tried the new Simulation Manager Module (well new to stable)?

It will take care of setting simulation false to all units outside of a distance from any player. - it can be set to recognise (or not ) air units.

default is 2000 m - I looked but have not tested performance on this.

Like Iceman said though, cleanup helps;

dead bodies don't add much to a battlefield except speed bumps....;)

ps. I thought the limit was 144 groups an not units. can anyone confirm?

Share this post


Link to post
Share on other sites
ps. I thought the limit was 144 groups an not units. can anyone confirm?

Correct. Its 144 "Groups" per Side. 1 Group can be many Units.

1. Invest in RAM (biggest bang for your money)

2. Use Simulation Manager Module (set to 2000)

3. Do NOT use any Rain (new 3D Rain eats FPS)

4. Re-design Map/Mission (tricky to find balance)

5. 'Optimize' settings and Reduce Visibly (< 1900)

Share this post


Link to post
Share on other sites

Guys, can describe in more detail Simulation Manager Module or a link to a detailed description. Thanks.

Share this post


Link to post
Share on other sites

The simulation module stops all of the ai scripts I believe (animations, movement etc). It may even hide them idk. In any case, it helps with performance, where missions have alot of AI. I assume it's under modules in the editor. If you click show info it should show you how to set it up. Also, there should be some input fields for cache/simulation distance etc etc. I'm sure someone else who has more experience with it could tell you more. I've not dabbled with it.

Share this post


Link to post
Share on other sites

That's really useful, but I think he's working with editor placed units (alot of them) and simple not present triggers + hints (ie; small code). He just needs some good old fashioned unit caching and cleanup.

Share this post


Link to post
Share on other sites

lots of larger maps with lots of players use triggers to spawn ai when there is a player within a certain radius. this is why you hear some people saying to not fly over every objective when the map starts on domination style maps. because it will create a lot of ai at once and cause lag. the arma ai system suffers greatly when there is a fps drop. ai skill and fps really conflict with each other. for example you could have one or two ai at a set skill level and they would be pretty smart, then when you add 100 more ai and 60 more players and the fps drops the ai is like what do I do. but I guess that's what headless clients are for.

Share this post


Link to post
Share on other sites
lots of larger maps with lots of players use triggers to spawn ai when there is a player within a certain radius. this is why you hear some people saying to not fly over every objective when the map starts on domination style maps. because it will create a lot of ai at once and cause lag.

This is where unit caching is handy.

Share this post


Link to post
Share on other sites
The simulation module stops all of the ai scripts I believe (animations, movement etc). It may even hide them idk. In any case, it helps with performance, where missions have alot of AI. I assume it's under modules in the editor. If you click show info it should show you how to set it up. Also, there should be some input fields for cache/simulation distance etc etc. I'm sure someone else who has more experience with it could tell you more. I've not dabbled with it.

Thank you! :) Yes it really is under modules in the editor.

Share this post


Link to post
Share on other sites

There is a solution to this. You run the coop mission on a dedicated server process, on another Pc or on two of your current computer's cpu core. (Set affinity in Windows Task manager). Then leave the other 2 core for your own client use.

The DS will then actually run all the AI, while you and your friends will only render your game and the few AI , if any, within your command.

If no AI friendlies, then the DS server will manage all the AI, while offloading that from you and your friend's client.

If the DS is still laggy, and if you have a more cores on the cpu, you can add a command to the mission script to allow the use of a HEADLESS CLIENT. Basically, added another client process without any gpu or sound, that looks like a fake user, to the game. You connect the HC to the server and the AI can be split between the DS and HC.

Again, it would be best if you had a Quad core Pc running the DS on 2 cores,and the HC running on 2 core, on the same machine.

Then you and your friends connect to the server while the DS + HC manages all the AI for you.

All the best ARMA 2 servers are running this.

Read here for more HC info:

http://www.reddit.com/r/arma/comments/16nl5x/a_quick_n_dirty_guide_to_headless_clients_for/

Share this post


Link to post
Share on other sites
There is a solution to this. You run the coop mission on a dedicated server process, on another Pc or on two of your current computer's cpu core. (Set affinity in Windows Task manager). Then leave the other 2 core for your own client use.

The DS will then actually run all the AI, while you and your friends will only render your game and the few AI , if any, within your command.

If no AI friendlies, then the DS server will manage all the AI, while offloading that from you and your friend's client.

If the DS is still laggy, and if you have a more cores on the cpu, you can add a command to the mission script to allow the use of a HEADLESS CLIENT. Basically, added another client process without any gpu or sound, that looks like a fake user, to the game. You connect the HC to the server and the AI can be split between the DS and HC.

Again, it would be best if you had a Quad core Pc running the DS on 2 cores,and the HC running on 2 core, on the same machine.

Then you and your friends connect to the server while the DS + HC manages all the AI for you.

All the best ARMA 2 servers are running this.

Read here for more HC info:

http://www.reddit.com/r/arma/comments/16nl5x/a_quick_n_dirty_guide_to_headless_clients_for/

Thank you for this.

I am very curious about the limits of performance with HC. Do you have a sense of how far you can push this in terms of the number of AI units on field at a time? I'm working on a dynamic war mission which will push the effective AI population of Altis (Enemies, civilians) above 1,000. Unit caching is perfectly capable of this under ideal circumstances, but in certain cases unit caching provides no advantages (such as in cases of large numbers of players scattered over the map.

Is headless client something that can 500+ units, each in groups running AI scripts such as UPSMON?

Share this post


Link to post
Share on other sites

Another alternative is to have spawn scripts that run only when they become relevant or players get near.

Share this post


Link to post
Share on other sites
Another alternative is to have spawn scripts that run only when they become relevant or players get near.

I believe that this has already been mentioned in this thread. Of course that proposed solution only works for a linear mission design. For something more dynamic, unit caching would have to be added.

Share this post


Link to post
Share on other sites

I've looked at the Repetitive Cleanup script on Armaholic and I'll definitely be using it. But how do I cache units? What does it actually do and how does it work? Does the Simulation Management Module have this unit cache feature?

Share this post


Link to post
Share on other sites

Unit caching stores the units and delete's them when the player(s) are not with a certain range. When the player(s) come within a certain range, the units are rendered again. In that particular script, it will cache all units accept for the leader(s) of said group(s). You can define the desired caching range aswell. Just the otherday, i had a map with 300+ AI running smooth as glass. You'd have thought there was nearly a bare map. Well, there was essentially after the units were cached :cool:

note: I'm not to familiar with the specifics of the simulation module.

Edited by Iceman77

Share this post


Link to post
Share on other sites
Unit caching stores the units and delete's them when the player(s) are not with a certain range. When the player(s) come within a certain range, the units are rendered again. In that particular script, it will cache all units accept for the leader(s) of said group(s). You can define the desired caching range aswell. Just the otherday, i had a map with 300+ AI running smooth as glass. You'd have thought there was nearly a bare map. Well, there was essentially after the units were cached :cool:

note: I'm not to familiar with the specifics of the simulation module.

Ahh.... a script. I've been digging around on unit caching trying to find some information on the subject and found an Arma II script that apparently works with Arma III. I read the description and you've just confirmed what I thought was the case. I'm just disappointed the BIS never integrated that feature in the editor, or is it the case that the newly installed simulation manager module now incorporates this caching feature?

Given the chance, I would prefer to use all of the editors features to perform a task, as it ensures they'll be no adverse performance effects from poorly written/buggy code. It begs the question to why people should have to write the code in the first place. Surely if someone writes a script in the majority of cases it will be because what they wanted the editor to do cannot be done without the need of a script. Take BTC Revive for example: it's an incredible desired feature that has been downloaded many times, so why haven't acted on this and introduced it as a feature in the editor?

I've been working away from home all week, but when I get home I will be delving into the simulation manager module to see it can do. I've looked at the Repetitive Cleanup and I'll definitely being using that script for sure. I hope it'll allow to me to edit and increase the 60 second clean up for bodies though as IMO 60 seconds it way too quick. In reality and in war scenarios bodies are always collected whenever possible by comrades. Many often put themselves in the line of fire to retrieve their comrade's body. So I have no issue with using the RC script. I think the clean up should ideally occur when players aren't in a specified area though, that way no one sees the bodies disappear and it could be seen as hidden enemy cleaning up after the threat has dissipated.

Share this post


Link to post
Share on other sites

@Infiltrator_2K: As the script is parameterized you actually have to define the delay by yourself. 60 seconds is just an example value.

Share this post


Link to post
Share on other sites
Guys, there is a tutorial on HC to Arma 3?
We weren't really discussing HC KalGaNoff, but it's something I'm looking into as a further possibility to host larger missions with lots of AI.
@Infiltrator_2K: As the script is parameterized you actually have to define the delay by yourself. 60 seconds is just an example value.

Thanks IndeedPete for confirming that. I strongly suspected that was the case, it's just when I read the scripts description it failed to mention this parameter was editable other than to zero to disable it.

Share this post


Link to post
Share on other sites

Well, last night I added the Repetitive Cleanup script and some Simulation Modules to the military sites that had a lot of AI and everything seems to be going well for a while and my friend saw an increase to his FPS and he averaged over 20 FPS. Then after a while it crawled to 7 FPS. The Repetitive Cleanup was working as was the Simulation Modules, so I'm stumped to what could be causing the issue now.

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  

×