View Full Version : View distance in campaign - fix for low performance
Jun 5 2009, 18:46
If you get low performance in the larger campaign missions, try dragging down your viewdistance.
I had the phenomena that the campaign mission "Razor Two" was running at 20-25fps, but when I entered the menu to pause the AI and scripts, my performance went up to 40fps.
After trying almost everything, I finally hit the culprit: Viewdistance! In Razor Two my performance is nice as long as I am at around 2500-3000 viewdistance; then I get 40fps ingame and in the menu. When I go to 4000 viewdistance, the performance goes down to ~20fps. But as soon as I pause the game (AI), I get my 40fps again.
So the slowdown is most likely caused by scripts, and only on high viewdistances. This leads to the following theory:
Higher viewdistance also activates further away AI/scripts, which causes lower framerates.
So, if you happen to get lag in a singleplayer mission, odds are there are too many enemy units inside your visible area. Lowering the viewdistance should deactivate enough of those to get playable fps again, presuming my theory is correct.
The real question is: If my theory is correct, why does a lower viewdistance improve performance? Are only those enemies active that are inside your visible area (distance to enemy < viewdistance)? Or is something else happening that is causing this slowdown?
(I could think of maybe Micro-AI getting activated for every unit in your visible area, which would be fixable by limiting Micro-AI to a certain distance independent from the viewdistance.)
Jun 5 2009, 18:51
How about you render less scenery, and thus, the framerate jumps up?
Jun 5 2009, 19:47
How about you render less scenery, and thus, the framerate jumps up?
If that would be the case, please explain why the framerate jumps up to the previous level when I pause the game (which pauses AI/scripts).
Besides, I did the same test in an empty map, same viewdistance, same spot, but no mission running in the background. There I also got high fps.
Jun 5 2009, 20:59
When you pause a game, you pause also the animations, which could explain the performance jump too, but your theorie is quite possible :) Nice one!
Of course reducing viewdistance will increase FPS, its simple logic.
When a mission is being played there is a whole lot more than the general area being processed, your fps will be lower than when spawning yourself in the same spot in the editor.
When you pause the game in a mission, ai and scripts stop so your frame rate will shoot up as you are under less load.
If you play the same mission again but reduce viewdistance your fps will increase but not because the ai is not in view, that has nothing to do with it as it is still being processed. You are freeing up the CPU as you are no longer rendering as much scenery, the gain is being used to process the AI, the surplus is your FPS increase.
Jun 6 2009, 00:53
Ok, once again, as I seem unable to convey the issue.
xmongx, if what you say is true, then there should be an fps difference between paused and unpaused at ALL viewdistances, right? But the framerate stays the same (40fps) regardless if I pause or not below a certain viewdistance. And I think 3000 is a significantly high viewdistance; it is not that I got this result at 500m or so. Besides, this is just one simple test, mind you, so probably there was some heavy AI stuff going on at a certain distance from me in that situation. Also, do not forget that the game is supposed to offload AI scripts and so on to different threads, so up to a certain point AI should not affect the renderer thread at all. I am testing this on a 3.4GHz Quadcore CPU.
What I am saying is NOT that "Hey guys, performance improves when you turn down the viewdistance!" No, what I try to tell you is that up to a certain distance the AI/scripts do not seem to matter, and your graphics card is the limiting factor. But after you reach a certain viewdistance, all of a sudden your fps drop considerably and are CPU-limited. Changing the graphics-settings will not help much then.
Look at these simple facts:
1. Framerate does not change when pausing scripts below a certain viewdistance.
2. Framerate drops considerably under a certain, higher viewdistance, but returns to almost the old value when the scripts/AI are paused.
The only logical conclusion I can come up with is that first, the amount of scripts running seems to be the limiting factor for performance if a certain script-load is reached, and second, that the script-load on the CPU seems to rise with the viewdistance.
I am open to other suggestions, but right now I do not see any other explanation. If what I am seeing here is correct, a second slider for "AI distance" would benefit the game a lot. That way we could enable way higher viewdistances, without fearing that the high AI load for far-away AI units would kill our performance that much.
Jun 6 2009, 01:32
One thing you are missing. Higher viewdistance means more complex visibility checks with AI, meaning more CPU usage. I think things like AI and physics are also simplified when beyond the viewdistance.
Jun 6 2009, 07:42
I don't think the visibility checks for the AI get more complex, as they seem unable to spot far-away units anyway. And even if so, this would be a perfect opportunity to limit that distance, so the game remains playable at higher viewdistances.
And AI and physics being simplified/turned off beyond viewdistance is exactly what I am trying to say; the question is why it is turned on or even turned to very detailed as seeon as it is in the visible range? it would be way more efficient to just let it be turned off/low when beyond a certain range. My suggestion for a "AI distance" slider is touching on exactly this.
ArmA 1 was usually playable at high viewdistances, but there the singleplayer missions were not that spread-out over the whole map. And in multiplayer this should not matter anyway, since the AI runs on the server. I might be generalizing, but one of the new things in ArmA 2 is bigger missions in singleplayer, that spread over significant parts of the whole map. The game might need special optimizations for this, so we can enjoy high viewdistances without having to worry about AI/scripts getting too CPU-heavy. They don't need to be, which is easily demonstrated by the fact that the mission is still functioning (and running fast) under lower viewdistances.
ive seen fps increase from going from 2400m, to 2000m, to 1600m and to 1300m...below 1300m view distance just isnt worth it in terms of being able to actually play the game.
Sofar through my playthough of the campaign, Manhatten is the biggest fps killer just because its go so many scripts to run and look after thanks to its sandbox set up and the ambient combat ( which is the best thing ever!)
This is on Chenarus though, Utes on the other hand because its such a small island i can play with everything up at maxium and 2400 view distance playing an mp version of the mission "war welcome" and have no FPS issuses.
i only wish utes was big enough to support 10 towns for more warfare action.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.