Jump to content
Sign in to follow this  
[frl]myke

Dynamic viewdistance XEH by [GLT] Myke

Recommended Posts

Edited due to completely new version!

Dynamic Viewdistance 2.1

What it does:

=============

Well, basically it extends the VIEWDISTANCE setting you have in the video options to something more flexible. Instead of having one fixed viewdistance, you set a min and max range (where min range should reflect your actual viewdistance setting) and the addon will increase/decrease viewdistance depending of your height above sea level. This is what it did before and this is what it still does.

So whats new in 2.0?

====================

When playing large scale mission with a lot of units and scripts runnin, you could have serious performance hits and increasing viewdistance would it make it even worse. So i included a FPS counter and whenever a lower limit of FPS is reached (can be set by user), the addon tries to reduce viewdistance to come back to playable performance/FPS. But it will never go below the min viewdistance you've set (although i'm thinking about to introduce a allow override function in it).

I've also included a min height level. If the player is below this lower limit, the viewdistance will not raise. Only when you go above this level (in area or in air vehicle, no matter) it will start raising viewdistance. But also here, below this "offset value", viewdistance will not go below your set min limit.

Known problems:

===============

The first time you pass an area in a plane or a chopper, there will be noticable stuttering. This is caused by ArmA since it has more data to load (landscape, textures and objects) than usual. This stuttering only happens on first fly-over, from the second pass on it should be gone and you should have good performance and higher viewdistance. Sadly there's no way to reduce or even eliminate this effect.

Also there are known incompatibility issues with other addons (thx Foxhound to pointing at) that aren't extended Eventhandlers compatible. I'mm affraid you have to choose between the addons that interfere unless the addonmakers releases a fixed version of theyr addons.

Included files:

===============

stm_dyn_vd.pbo

stm_dyn_vd.pbo.stm.bisign

stm.bikey

readme.txt

Dta/stm_dyn_vd_cfg.hpp

Extended_Eventhandlers17.zip

Please read the readme.txt (duh) for instructions about installing and configuring the addon (take your time to find best settings for your PC, once it is done, you might forget about it ).

Credits & thanks:

The idea for this addon i had from 2 others addons:

ECS which have dynamic viewdistance built-in (didn't used any code out of this).

InstantViewDistance by radical.ghost which adds an Actionmenu to the player to change viewdistance on the fly.

So credits to those 2 addons for the inspiration.

Also credits goes to:

NeoArmageddon

Mondkalb

sfc.itzhak

for helping me getting this thing to work. Without them i couldn't do it.

And also credits to BIS for ArmA

Downloads:

Mirror @ armaholic.com (New Version 2.1)

Mirror @ ePrison.de (New Version 2.1)

Mirror @ armedassault.info (old version)

Share this post


Link to post
Share on other sites

i actually read that as "Adjusts viewdistance related to Age, Sex and Location"

as the age old internet horny abbreviation goes

a more complete implementation of this could perhaps be to shoot a ray from the player head to every direction every now and then and measure how far it flies and put the draw distance there

or adding draw distance according to zoom level

good idea in any case

Share this post


Link to post
Share on other sites

Nice one, but I believe this should have been in original game... Well, it gets better every day wink_o.gif

Any hit on framerate, when climbing to 1000 meters ?

Malick

Share this post


Link to post
Share on other sites
Quote[/b] ]i actually read that as "Adjusts viewdistance related to Age,Sex and Location"

as the age old internet horny abbreviation goes

lol, the description line didn't allowed longer text so i thought people would guess it is meant as "getPosASL" command interpretation. ;-)

Quote[/b] ]a more complete implementation of this could perhaps be to shoot a ray from the player head to every direction every now and then and measure how far it flies and put the draw distance there

or adding draw distance according to zoom level

Well, the design goal was a) to have it work mission-independent, therefor an addon, b) have it adaptable for users, therefor an external .hpp file which can be edited pretty easy and c) to keep it as simple as possible on execution so the performance impact of the script would be an absolute minimum. This last point was/is importent to me as i wanted to save as much resources as possible as i guess other addons and mission script will also be running....hope you get the point.

Share this post


Link to post
Share on other sites

OK, first request wink_o.gif

Can you code in a minimum level too? My map starts at over 400m and then rises to over 2000m, so some amount of alternative bracketing is needed in my case. smile_o.gif

Share this post


Link to post
Share on other sites
Quote[/b] ]

Can you code in a minimum level too? My map starts at over 400m and then rises to over 2000m, so some amount of alternative bracketing is needed in my case.

OMG, first time i hear of such high mountains. biggrin_o.gif

I will think of an alternative method of adjusting viewdistance to get raises slower when not in a plane. Although if you try out the mountain north of Bagango (highest point of Sahrani) i still have really good framerates with the addon.

Meanwhile you might set the values in the .hpp file to something more moderate. Try to increase STM_estFlightLevel to something higher, maybe twice as high as you have now. This will lower the steps it increases viewdistance.

Share this post


Link to post
Share on other sites

I get really good performance with this addon. Could never fly around at altitude 2000 with 8000 VD without stutters before.

Flying and spotting from mountains now works properly as to before when everything goes white. And the VD expands/shrinks smooth. Great addon.

Should be an option in ArmA.

Share this post


Link to post
Share on other sites

Shouldn't FlightLevel be set to a distance just a little more than the max draw distance for the maximum view distance desired by the user?

Anybody know what the max draw distances are for various view distances?

Can we use that Rangefinder addon to find out?

Share this post


Link to post
Share on other sites

@Uziyahu--IDF

I think you misunderstood something. STM_estFlightLevel just defines at which height above sea level the max viewdistance is reached.

Example:

Min viewdistance is set to :2000

Max viewdistance is set to: 4000

Est Flight level is set to : 1000

So right at the beach you'll have a viewdistance of ~2000 meters. If you now start climbing a mountain, with each meter you go higher the viewdistance raises until you reach a height of 1000 meters above sea level. There you'll have 4000 meters viewdistance and the max is reached. Even if you go higher, viewdistance remains at 4000 meters.

So STM_estFlightLevel has only indirect influence of the viewdistance. It is used to calculate the stepwidth of raise and to determine at which height the final viewdistance is reached.

Another example:

Min viewdistance: 1000

Max viewdistance: 2000

EstFlightLevel: 500

or:

Min viewdistance: 1000

Max viewdistance: 3000

EstFlightLevel: 1000

Both settings will give you a viewdistance of 2000 meters at a height of 500 meters. But in the first example the max viewdistance is already reached while the second set of settings will continue to raise viewdistance until you reach 1000 meters ASL. There you'll have the max viewdistance of 3000 meters.

You see, with these 3 settings you can pretty precisely adjust the behaviour of the Dynamic viewdistance to your needs and to the performance of your PC.

Share this post


Link to post
Share on other sites

How will this effect missions that utilizes the manual setting of viewdistance, like EVO or missions that have set a viewdistance?

Share this post


Link to post
Share on other sites

@NoBrainer

Well, as DynVD measures players height above sea level and adjusts viewdistance accordingly every 0.2 seconds, all missionsside viewdistance manipulations are overwritten immediately. Depending on the System the mission maker uses, it can have no noticeable side effect to messing up everything.

If it is something similar to my addon, means changing viewdistances in short loops, it might end up viewdistance goin up and down very quickly. This would be a mess and i guess it would be unplayable. But i think no Missionmaker would implement such a dynamic adjustement since it can't be set to players PC performance.

Most common way i guess is to give the player an menu ingame to raise or lower viewdistance manually. In this case, the ingame menu becomes obsolete as the min viewdistance you've set in the addon would be highest possible without loss in performance...as you did before in the videooptions.

These two systems will not interfere directly, it just makes the ingame menu unusable. Although you can use it, each changed setting there is immediately overwritten by the DynVD.

But you still have the option to use a mod folder for this addon and if you encounter serious problems on some servers / missions, just don't load this modfolder.

But i guess in practical use, there are pretty little occasion where you would run in problems with the addon active.

:EDIT:

As this is a clientside addon it will not affect viewdistance settings on the server. If the mission offers selectable viewdistance in the briefing, these settings are used and valid for AI. So practicall speaking, if all players use the DynVD addon you may set the servers viewdistance to max (if server has enough performance), increasing AI's possibilities to a new level.

Share this post


Link to post
Share on other sites

Thanks for reply - It cleared things up...

But, how will it affect your personal viewdistance. If you set you ArmA to have 2500 VD and in the *.hpp set max=4000.It still would stop at 2500 VD.

Is this correct?

So if you would like to use this addon, you should investigate your computers max VD and set that in the max=??. So you get an addons desigened for you specs? is this correct?

Best retard NoBrainer

Share this post


Link to post
Share on other sites
Thanks for reply - It cleared things up...

But, how will it affect your personal viewdistance. If you set you ArmA to have 2500 VD and in the *.hpp set max=4000.It still would stop at 2500 VD.

Is this correct?

So if you would like to use this addon, you should investigate your computers max VD and set that in the max=??. So you get an addons desigened for you specs? is this correct?

Best retard NoBrainer

Not correct. The VD setting in ArmA can be overridden using the "setViewDistance" command, which is probably how this addon works.

So you can leave your VD as it is.

Share this post


Link to post
Share on other sites

Also remember that if your using ECS addon it already has this feature. Obviously if not then its a great addon to have.

Share this post


Link to post
Share on other sites
Thanks for reply - It cleared things up...

But, how will it affect your personal viewdistance. If you set you ArmA to have 2500 VD and in the *.hpp set max=4000.It still would stop at 2500 VD.

Is this correct?

So if you would like to use this addon, you should investigate your computers max VD and set that in the max=??. So you get an addons desigened for you specs? is this correct?

Best retard NoBrainer

MadDogX is correct. In the .hpp file at the STM_minViewdistance, enter your actual viewdistance you've set in the options or e few meters less (you might try which settings fits best your PC's perfrmance).

At STM_maxViewdistance enter the viewdistance which you want to have as max.

And at STM_estFlightLevel enter at which height of your player unit (regardless if on foot on a mountain or in a plane) the set maxviewdistance will be reached.

At players height of 0 (which is nearly at the beach), you'll have a viewdistance of nearly ~STM_viewdistance. Now while moving up, viewdistance is slowly reaised.

The math formula is:

(STM_maxViewdistance - STM_minViewdistance) / STM_estFlightLevel

This will determine how much the viewdistance is raised per 1 meter the player goes up. As by the formula you might guess, STM_estFlightLevel can influence these steps. Higher values there result in smaller steps per meter.

So best thing is, you try different settings and look which fits best with your PC's performance.

As example, actually i use 2000 meters as min, 8000 as max and FlightLevel 2000. This gives me smooth performance on my PC.

Share this post


Link to post
Share on other sites

No, I don't think I misunderstood. (I like how everyone on this forum thinks I don't know how to read English.)

My point in saying that FlightLevel should probably be set to just a few meters above the maximum draw distance for the desired maximum view distance is this:

When objects are no longer drawn on the ground, you're not going to get any better performance (unless maybe texture detail is reduced at higher altitudes, too?), because there will be nothing left to subtract from view.

So... from the altitude that objects stop being drawn on the ground (taking into account the additional altitude of the highest peaks on the terrain, of course), you might as well hit your desired maximum view distance. Anything higher will be the same experience.

That is why I ask, "What are the maximum draw distances for objects at various view distances?" When we have a chart or guideline, we can set our FlightLevel accordingly.

This is why we might need the Rangefinder addon to come up with a chart.

Share this post


Link to post
Share on other sites

hello Myke, very good idea

my only concern is that I don't want to have the same viewdistance walking on a 1000m high plateau like flying 1000m high

so a small change I would suggest is replacing

Quote[/b] ](getposASL player select 2)

with something like

Quote[/b] ]((getpos player select 2) + (getposASL player select 2) / 4)

on a small test with

STM_minViewDistance = 1500;

STM_maxViewDistance = 6000;

STM_estFlightLevel = 3000;

it looked good, comparing climbing with flying.

Regards,

QuietMan

Share this post


Link to post
Share on other sites
hello Myke, very good idea

my only concern is that I don't want to have the same viewdistance walking on a 1000m high plateau like flying 1000m high

so a small change I would suggest is replacing

Quote[/b] ](getposASL player select 2)

with something like

Quote[/b] ]((getpos player select 2) + (getposASL player select 2) / 4)

....

Regards,

QuietMan

Hi quiet_man

good point, indeed. Although i try to avoid to do any checks with getpos at all. While i was testing the first versions with getpos and flying over some bumpy area or some steep mountain peaks resulted in changing viewdistances too obviously and sometimes to an annoying low level (crossing mountains peak 10 meters above ground).

I'm still researching to get a good balance between performance, smooth effect and easy setup.

I understand your concerns but i'm affraid at the moment i can't offer any other solution. But i'm still researching on it and maybe i'll get the trick to achieve a smooth expanding of viewdistance with different behaviours for Infantry and pilots (literally speaking).

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  

×