Jump to content
tpw

Dynamic View Distance (DVD)

Recommended Posts

Thanks for this really useful tool, tpw. Its really helping to keep my framerate acceptable on my ageing system.

Share this post


Link to post
Share on other sites
Thanks for this really useful tool, tpw. Its really helping to keep my framerate acceptable on my ageing system.

My pleasure. It's cheaper than a cpu/gpu upgrade on my box too!

Share this post


Link to post
Share on other sites

I tested this addon for 30 minutes or so and Im absolutely happy with it.

It may also save some money for me now but I have to make some more testing :).

Share this post


Link to post
Share on other sites

errr where is my "Arma2 userconfig directory."?

I keep getting userconfig/DVD/DVD.hpp not found, the game will not start and it CTD's.

I have been too busy learning scripting - I skipped over the basics lol.

Share this post


Link to post
Share on other sites
errr where is my "Arma2 userconfig directory."?

I keep getting userconfig/DVD/DVD.hpp not found, the game will not start and it CTD's.

I have been too busy learning scripting - I skipped over the basics lol.

If you don't have a directory named "userconfig" in your ArmA2(OA) directory you'll have to create one. For the rest please read the opening post again as there is described what goes where.

FYI: since addons aren't "user adjustable", addonmaker have agreed to work with a folder named userrconfig where user adjustable config parts are located. Those files are usually well documented so unexperienced (in terms of scripting/addonmaking) users will understand them easily.

Share this post


Link to post
Share on other sites

Thanks [GLT] Myke - I thought the info in the first post was referring to the folder under MyDocuments/Arma2 where the user profile.cfgs are.

Not seen this userconfig before - it goes in your main Arma2(OA) game folder. Might be best to tweak the install instructions as they assume everyone has a userconfig folder and knows what it is.

I can now start testing it! :D

Share this post


Link to post
Share on other sites

There was an addon made for Armed Assault (I think) that worked extremely well. It increased the view-distance in proportion to altitude. Maybe you could use that solution for operating an aircraft?

Share this post


Link to post
Share on other sites
Thanks TommyC81.

OK, here's roughly how it works: Preferred VD and Preferred FPS are basically values that you have determined that your setup should be able to manage. For instance, I know that in most maps I should get roughly 35-45 fps with a viewdistance of 1800m. So I put 40fps and 1800m into preferred FPS and VD respectively. DVD then drops the VD if the FPS drops below 40, and increases the VD if the FPS goes above 40.

This does not mean that your setup will stay running at 40fps all the time. If you move into a really dense area with lots of AI, then dropping the VD to 300m may still not be enough to raise the FPS to 40. If you move into a desert area with little scenery, then increasing the viewdistance may not be enough to peg the FPS at 40.

Maximum VD is simply the viewdistance beyond which the system will not go in an effort to peg FPS at your preferred.

I hope this makes sense. Short of showing the you algorithm I use, this is the best I can do.

Hi tpw, and thanks for the explanation. As I understand it, VD starts at the preferred_vd and from there on just tries to keep the requested FPS by adjusting the VD (while keeping the VD within the specified min/max).

I find it working fairly well, if you don't mind I would however suggest a few changes:

I occasionally experience FPS oscillating in a big interval (from 30 up to 60 and back again, pref_fps = 45) due to VD increased/decreased to much at a time. And occasionally also microstuttering when VD is adjusted by a small distance every monitoring interval. This could obviously just be a config problem, but what about:

  • Instead of setting a "pref_fps", you set a "pref_fps_min" and "pref_fps_max", which would give you an interval in which the VD won't change. I.e. as long as the FPS stays within those two figures, the VD is unchanged.
  • Change the fixed interval FPS monitoring to a Simple Moving Average (SMA) that is updated every second. You could probably also try an Exponential Moving Average (EMA) as well, could prob give better results. http://en.wikipedia.org/wiki/Moving_average

Just a few thoughts, thanks again!

Share this post


Link to post
Share on other sites
Hi tpw, and thanks for the explanation. As I understand it, VD starts at the preferred_vd and from there on just tries to keep the requested FPS by adjusting the VD (while keeping the VD within the specified min/max).

I find it working fairly well, if you don't mind I would however suggest a few changes:

I occasionally experience FPS oscillating in a big interval (from 30 up to 60 and back again, pref_fps = 45) due to VD increased/decreased to much at a time. And occasionally also microstuttering when VD is adjusted by a small distance every monitoring interval. This could obviously just be a config problem, but what about:

  • Instead of setting a "pref_fps", you set a "pref_fps_min" and "pref_fps_max", which would give you an interval in which the VD won't change. I.e. as long as the FPS stays within those two figures, the VD is unchanged.
  • Change the fixed interval FPS monitoring to a Simple Moving Average (SMA) that is updated every second. You could probably also try an Exponential Moving Average (EMA) as well, could prob give better results. http://en.wikipedia.org/wiki/Moving_average

Just a few thoughts, thanks again!

Thanks TommyC81. Thanks for the suggestions. I'm surprised you get massive framerate oscillations as I tried to write the code in such a way as to avoid it. Then again, I am a shit coder...

Re suggestion 1. The whole idea is that if you set your preferred fps at 45, and your average goes up to 50, then only a small adjustment is made, which should hopefully not be very noticeable. However, I take your point and will think about trying to implement it.

Re suggestion 2, that's very interesting. The SMA in particular is algorithmically simple. The exponential average though gave me an aneurysm looking at the formula.

I'll see what I can come up with...

Share this post


Link to post
Share on other sites
Thanks TommyC81. Thanks for the suggestions. I'm surprised you get massive framerate oscillations as I tried to write the code in such a way as to avoid it. Then again, I am a shit coder...

Re suggestion 1. The whole idea is that if you set your preferred fps at 45, and your average goes up to 50, then only a small adjustment is made, which should hopefully not be very noticeable. However, I take your point and will think about trying to implement it.

Re suggestion 2, that's very interesting. The SMA in particular is algorithmically simple. The exponential average though gave me an aneurysm looking at the formula.

I'll see what I can come up with...

Thanks for the feedback tpw!

Most of the big oscillations occur on a benchmark mission I've created on Utes, but like I said, it might relate to a poor config by me. However, the continuous small oscillating changes in VD (a few hundred meters up and down, depending on FPS) can sometimes cause microstuttering, that's why I feel it could perhaps be desireable to have an interval where the VD just stays fixed until avg_fps goes outside it. Easiest implementation could prob be a +/- 10% allowance from the set pref_fps (i.e. pref_fps = 45, avg_fps between apx. 40 and 50 will leave VD untouched)

Hehe, yeah, know what you mean regarding EMA. It is however not as complicated as the mathematical formula looks like.

This is how you calculate EMA:

Let's say you want an EMA over the last x seconds.

You need to start with some value, a good starting point is a basic average for the first x seconds.

Starting from the x+1 second you will calculate EMA like this:

EMA = ( Current_FPS + ( Prev_EMA * ( x - 1 ) ) ) / x

That will give you an average that reacts quickly to FPS changes, without being to quick (depending on how many seconds (x) you use to calculate the EMA.

SMA and EMA is popularly used in financial decisions, and I guess it's not too unlike what we're trying to achieve: A setting that is good for the next, predicted FPS.

Have a look: http://www.babypips.com/school/sma-vs-ema.html

Thanks again!

Share this post


Link to post
Share on other sites

DVD_debug = 1; // Set to 0 to remove. Displays average framerate and viewdistance. Useful for establishing optimum settings for your system.

Is this somekind of overlay thingy? Anyways, I can't see it for some reason. I've tried CO and OA without anyluck. I think the addon is working cos it caps my fps but i would still like to see where and when it changes the viewdistance.

I am using steam version with Arma2launcher.

Edited by Atkins

Share this post


Link to post
Share on other sites
DVD_debug = 1; // Set to 0 to remove. Displays average framerate and viewdistance. Useful for establishing optimum settings for your system.

Is this somekind of overlay thingy? Anyways, I can't see it for some reason. I've tried CO and OA without anyluck. I think the addon is working cos it caps my fps but i would still like to see where and when it changes the viewdistance.

I am using steam version with Arma2launcher.

If the addon is working you'll see the viewdistance change every 5 seconds or so. Regardless of whether you have debugging on or off, you should see a popup saying "Dynamic View Distance 1.03 Active" when you first start the mission.

Are you using the latest version (1.03)? I can definitely turn the fps/viewdistance debugging display on or off by changing userconfig\dvd\dvd.hpp -> dvd_debug to 1 or 0 respectively.

It just displays a little hintbox in the top right of your screen. As far as I know the hintsilent command which I use is standard across all versions of Arma2.

Edited by tpw

Share this post


Link to post
Share on other sites

I am using 1.03 and when launching with Arma2Launcher I see @DVD in the upper right corner of the Main Menu where it lists my mods.

Installing this mod to Arma2 folder gave an error msg so i've copied it to Arma2OA folder so it wont give the error msg when running CO but i can't see no overlay with dvd_debug set to 1.

Should I see this hintbox at the main menu already?

I wonder if I have some option turned off which prevents showing that hintbox? Perhaps some Ati tray tool option?

I am running steam version of CO though with arma2launcher outside of steam.

Edit: Fixed. I was missing CBA. My bad, i am still a bit newbie with mods etc...

Edit2: Min VD and preferred VD doesnt work. Even though i hit the wanted 40 fps, my vd stays at 500-1000 ( 1500 is in the config file) and VD goes below the minimum value for some reason as well when i get low fps.

Edited by Atkins

Share this post


Link to post
Share on other sites

It seems that one has to revert a mission and restart it to enable new values from config file.

Share this post


Link to post
Share on other sites

This looks very interesting, i shall try and get this running tonight

Great Idea1 Tpw thanks.

Share this post


Link to post
Share on other sites

I would suggest adding some override key bind to this mod. Like when you absolutely need to see up to the normal viewdistance no matter how low fps you will get. Pressing some button to enable/disable this mod would do the trick.

Share this post


Link to post
Share on other sites
I would suggest adding some override key bind to this mod. Like when you absolutely need to see up to the normal viewdistance no matter how low fps you will get. Pressing some button to enable/disable this mod would do the trick.

Good suggestion, I'll see what I can do.

Share this post


Link to post
Share on other sites

Been using DVD for a while now on my elderly rig and it's a really neat little tool, stops the framerate becoming unplayable when things get busy, and the transitions aren't too noticeable. Thanks for all your efforts with this :)

Share this post


Link to post
Share on other sites
Been using DVD for a while now on my elderly rig and it's a really neat little tool, stops the framerate becoming unplayable when things get busy, and the transitions aren't too noticeable. Thanks for all your efforts with this :)

Thanks for the nice feedback. I'm happy to be able to make a small contribution back to the community which has given me so much enjoyment.

Share this post


Link to post
Share on other sites

I have no any problem on FPS with this mod, it's a must have mod for my list!

Share this post


Link to post
Share on other sites

Thanks!

Share this post


Link to post
Share on other sites

its support server-side ovveride for ensuring fairplay on servers ?

or moves toward opposite side ?

Share this post


Link to post
Share on other sites

I am wondering whether this mod is able to separate the rendering of environment and vehicle, meaning that it will only change the view distance for environment while maintaining the view distance or better still max out the view distance of vehicle...

Share this post


Link to post
Share on other sites

Okay so i'm a complete noob, but you said it must say the mod is activated in the top right hand corner, and it doesn't on mine.

Im a bit lost, when you say extract the @DVD folder anywhere, do you mean anywhere on my computer?

or can you give me a recommended place to put the folder, also do i take the 'addon' folder and 'keys' folder out?

Sorry i just really want to play some Arma 2, and i have lagggggg =(

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

×