Gday all.
Here's a simple script I've been working on which does a few useful things:
What it does:
1 - It dynamically and smoothly adjusts viewdistance according to your framerate.
2 - It prevents the framerate from dropping and staying too low in areas of scenic complexity or lots of ai.
3 - It stabilises framerate so that there are less noticeable fps changes.
4 - It increases the viewdistance when using scopes/binoculars.
How it works:
The script launches a background process to monitor the average fps over a user specified time period (eg 10 seconds). This is then compared to the average from the previous 10 seconds, and if the fps has decreased then the viewdistance is dropped accordingly. Conversely, if the fps increases, the viewdistance is increased. It's set up so that it won't cause large oscillations in viewdistance/framerate.
The script also checks if you are using a scope or binocs and increases the viewdistance to simulate being able to see further and with more detail than with the naked eye.
These kind of scripts work on the assumption that in areas of high scenic complexity such as the middle of Zargabad or in a dense forest, you won't really notice that the view distance has been dropped. Similarly, if there are a lot of enemy ai trying to smoke you, you're probably more interested in getting a smooth bead on them than in admiring distant scenery. Another assumption is that increasing viewdistance when looking down a scoped weapon doesn't actually negatively affect fps most of the time.
You'll notice the viewdistance changing if you look for it, just like you'll notice lod switching or clutter popping in if you look for them too. After a while you simply stop noticing.
How to use it
Save the script below as whatever you like, wherever you like, and call it thusly from your init.sqf:
These are the values I use on my middle range system (Dual coreE6750, GTX460)Code:nul = [this,400,1800,25,40,10] execvm "nameofscript.sqf";
400 = minimum view distance (m)
1800 = maximum view distance (m)
25 = minimum framerate
40 = preferred (realistic!) framerate
10 = time to average framerate over
Obviously you'll change these values to suit your system. If you can't deal with fps below 30 then set the minimum to 30, and/or lower the minimum viewdistance even further. If your system can comfortably pull 75 fps at 5000m viewdistance then adjust accordingly (alternatively your computer is so powerful it probably doesn't need this script!).
Comment out the hintsilent line near the bottom of the script to remove debugging messages.
Script below:
Spoiler:
If you can see a way to improve this script or have any suggestions then I'd love to hear them.
Lastly, if you want a more comprehensive system to adjust framerate then look at VictorFarbau's VF FPS Saver (VFFPSS)
http://forums.bistudio.com/showthrea...c+viewdistance
HOME
Reply With Quote



