Dynamic View Distance

From F2 EN
Jump to: navigation, search

Description

The view distance used by a player can have a dramatic effect on two aspects of ArmA:

  • Performance: high view distances will cause low-powered graphics cards to really struggle, and result in poor FPS; low view distances have the opposite effect.
  • Player effectiveness: a low view distance will hinder the effectiveness of a player in the role of fast jet pilot, whereas for a player in an infantry role this would not be an issue.

The Dynamic View Distance component allows the mission designer to set a standard view distance for all players, with special view distances for players in the roles of pilots or gunners for helicopters and fixed-wing aircraft, or commanders, drivers and gunners in tanks. The component automatically switches a player's view distance to the appropriate value, depending on whether s/he is in a pilot / gunner / commander / driver slot.

For example, a player's view distance will be normal when s/he is standing on the ground next to a fast jet, but will be changed to a special value the moment s/he gets into the pilot seat – and then changed back to normal when s/he dismounts again.

Required files

All the code associated with this component is found in:

  • init.sqf
  • f\common\f_setLocalVars.sqf
  • f\common\f_addSetViewDistanceEHs.sqf
  • f\common\f_setViewDistanceGetIn.sqf
  • f\common\f_setViewDistanceGetOut.sqf

How to activate

Open the file init.sqf and look for the code segment entitled:

// F2 - Dynamic View Distance 

In the block of code below edit the following lines, removing the // at the start of each:

// f_viewDistance_default = 1250;
// f_viewDistance_tank = 2000;
// f_viewDistance_rotaryWing = 2500;
// f_viewDistance_fixedWing = 5000;
// [] execVM "f\common\f_addSetViewDistanceEHs.sqf";

How to use

Default view distances

By default, the following view distances are used:

VehicleVariableView Distance
Nonef_viewDistance_default1250
Tanksf_viewDistance_tank2000
Helicoptersf_viewDistance_rotaryWing2500
Aeroplanesf_viewDistance_fixedWing5000

Changing default view distances

Assuming you have already activated this component (see above), open the file init.sqf and look for the code segment entitled:

// F2 - Dynamic View Distance 

In the block of code below edit the following lines, changing the value of each variable to reflect your desired settings:

f_viewDistance_default = 1250;
f_viewDistance_tank = 2000;
f_viewDistance_rotaryWing = 2500;
f_viewDistance_fixedWing = 5000;
[] execVM "f\common\f_addSetViewDistanceEHs.sqf";

Tips

  • There is a known limitation with this feature: if a unit enters a vehicle as a passenger, s/he can sometimes use the action menu to move to a pilot / driver / commander / gunner position without having his/her view distance changed.

Credits

  • Raedor
  • Fer