TPW HUD - Realistic Tactical Goggles Display

Author: tpw
Requires: CBA A3, tpw_core.sqf, tpw_hud.pbo

Description
-----------
Yet another author jumping on the HUD bandwagon to make the tactical goggles do something other than look hard. No-one is going to call you a glasshole when you're holding an assault rifle! Not to detract from anyone else's efforts, I just thought I'd throw my hat in the ring with a personal HUD based on plausible 2035 technology, with a display that doesn't look like a part of the game interface. TPW HUD simulates tactical goggles providing improved situational awareness by presenting the following data in a non distracting and non interactive way:

Player/environment
------------------
	- ASL: Height above sea level.
	- AZT: Direction of the player's gaze.
	- GRD: GPS map co-ordinates.
	- LMT: Local time.
	- TMP: Temperature (if used in conjunction with TPW FOG).
	- HLT: Player's heartrate and health.
	- RNG: Range to the ground/object in the centre of the player's gaze.
	- VEL: Player's speed. Will switch to knots if the player is in an aircraft.

HUD icons
---------
In addition, TPW HUD simulates the ability of future visible/infrared image processing and pattern recognition to identify combatants and non-combatants within a few hundred metres of the player:
	- Footbound units are represented with a diamond icon. Manned air/land vehicles and static weapons are represented with a rectangle.
	- Unmanned vehicles are not displayed.
	- Enemy combatants are represented in orange.
	- Friendlies  combatants are represented in blue.
	- Civilians are represented in white (if they are friendly).
	- Squad mates are represented in green.
	- Dead units are not displayed.	
	- The icon is displayed at approximate centre-of-mass of the unit.
	- Distant units have smaller icons.
	- If the target moves out of LOS of any squad member then for up to 30 seconds its last known position is displayed by a 1/2 diamond (footbound) or a 1/2 rectangle (vehicle), with an indication of when it was last observed.
	- To avoid display clutter the HUD will not show units/markers closer than a user specified distance to the player.
	- The number of squad, friendly and enemy units currently being tracked by the HUD is displayed.
	- A soft beep will sound each time a new enemy is detected.

Predictive targetting
---------------------	
TPW HUD features predictive targetting. In addition to the unit's icon, a targetting icon will be displayed showing where the unit will be in the time it takes your rifle projectile to reach it. The HUD uses a default muzzle velocity value of 800m/s, but will adapt to the actual muzzle velocity of your weapon once it has fired. 	

Optical assist
--------------
TPW HUD will increase its detection range when players uses binoculars or optical sights. Any units identified using optics will be displayed using their last known position for up to 30 seconds, if the optics are lowered.  

Markers
-------
TPW HUD will display the position and distance of markers placed on the map by the player (or scripts). Double click on the map, and enter "!!" (no quotes) in the description field, followed by any other text. For instance, if you enter "!!wp", then the marker will be displayed on the HUD as "wp". If you enter "!!", then the marker will be shown without a name, only a distance. Markers will appear on the HUD in the same colour as your squad. You can add as many markers as you wish to aid navigation etc.	

Virtual tracers
---------------
TPW HUD simulates the ability of future of personal millimeter radar, lidar, high speed image and sound acquisition and powerful computer algorithms (phew!) to trace the trajectory and ownership of projectiles around the player. The system is discriminatory enough to identify friendly and enemy projectiles, and is useful for tracking the location and direction of enemy fire, and accurately adjusting/directing your fire. Virtual tracers last for 3 seconds, and follow the same colour scheme as other HUD icons. Virtual tracers are off by default, and may be toggled off / grenades only / all projectiles.  

HUD networking
--------------
TPW HUD simulates the abilities of networked tactical goggles to provide range and visibility information on any targets within the range of the squad. If any squad member has line of sight (LOS) to any target then its range is displayed beneath its icon. This means that you can get effective target information on units you may not have LOS to, provided someone else in your squad has. 

UAV integration
---------------	
TPW HUD simulates the increased situational awareness provided by a UAV. If any member of the player's squad is controlling a UAV, the UAV acts like an aerial set of networked tactical goggles, potentially gaining line of sight on units not visible to the rest of the footbound squad.	

Full colour night vision
------------------------	
TPW HUD simulates advances in cathode-less image intensifying technology to give the player full colour night vision. On a moonlit starry night they will approximate daylight levels of brightness, with slight blur and electronic noise. 

Electrochromic tinting
----------------------
TPW HUD similates the ability of future goggles to use electrochromic tinting to progressively darken and block out more light at the push of a button.
	
Positional audio ping
---------------------
When activated, the nearest enemy will be indicated with a positional audio beep (eg an enemy on your left will beep in your left ear) every 1.5 sec. The beep volume is distance dependent (closer enemy is louder), and an enemy to your rear will beep at a lower tone. 	
	
Effectiveness simulation
------------------------	
TPW HUD optionally simulates reduced effectiveness of unit scanning under various conditions. If the system cannot get full information about a unit then the unit's icon is displayed with reduced brightness, at its last known location. Depending on the distance and conditions, it may take several seconds for the system to register again. Under clear daylight conditions the HUD will pretty much be totally reliable out to 200m, on a rainy night prone units 450m away will probably not register 50% of the time.  
	- Reduced effectiveness at night.
	- Reduced effectiveness in fog/rain.
	- Reduced effectiveness for prone units.
	- Reduced effectiveness for distant units.
	- Vehicles detection is less prone to errors due to their larger IR and visual signatures.
	- If the player is hit by projectiles/explosions then the HUD will flicker briefly to simulate temporary damage to sensors and the projector. The HUD will resume normal operation after a second or so.	
	- The HUD will not function when the player's head is under water.

Limitations
------------	
What TPW HUD doesn't do:	
	- It doesn't tell you any more about a unit than its side and distance.
	- It can't magically see through walls or the landscape (but it may appear to if other members of your squad have LOS on a unit that you don't).
	- It won't make threat assessments and/or target selections. It merely provides the information so that you can.

2035 technology
---------------	
TPW HUD is predicated on plausible advances in the following technologies:
	- Embedded high resolution transparent stereo colour OLED display.
	- Accurate head and eye tracking with sub millisecond latency.
	- Centimetre accurate inertial and GPS positioning.
	- Gigapixel resolution visible/infrared imaging.
	- Image processing and heuristic pattern recognition able to reliably identify combatants/non-combatants out to several hundred metres.
	- Scanning infrared laser rangefinding to provide range information on all identified units.
	- Personal millimeter length radar and lidar for tracking nearby projectiles.
	- Encrypted mesh networking to enable connected goggles to share resources.
	- Non-invasive retinal scanning for health and stress monitoring.
	- Improvements in CPU power, miniaturisation and power consumption to allow all of this to sit in a robust google glass sized hardware package.

If you think this degree of tech advancement is implausible, just think back to what your mobile phone could do in 1995... 	
	
How to use
----------
TPW HUD will only activate if the player is wearing (black) tactical goggles. You can remove/replace the goggles in game and the HUD will deactivate/reactivate accordingly. By default TPW HUD will assign tactical goggles if the player is not already carrying or wearing them. 
The HUD will by default only display in 1st person view, and will deactivate in map view.
If other members of your squad are also wearing tactical goggles then the networked goggle simulation will kick in. 
You may cycle through the goggle HUD brightness settings by pressing Ctrl + Alt + H.
You may toggle the full colour night vision using Ctrl + Alt + N. If you are wearing normal NV goggles then they will automatically be switched off in place of the full colour NV. You may adjust the level of NV gain (brightness) using Ctrl + Alt + B.
You may toggle virtual tracers off / grenades only / all projectiles using Ctrl + Alt + T.
You may cycle through the progressive electrochromic tinting settings with Ctrl + Alt + A.
Positional audio ping may be toggled with Ctrl + Alt + P.

Configuration
-------------
TPW HUD has extensive configuration items in the TPW_MODS.hpp file:
	- Determine if the HUD is displayed in 3rd person (default off)
	- Determine which of the HUD data elements you want displayed (by default all HUD elements are displayed).
	- Individually size and place each HUD element.
	- Easily scale the HUD to be larger/smaller without having to individually edit each HUD element.
	- Easily offset the HUD without having to individually edit each HUD element.
	- Easily scale the HUD text smaller/larger without having to individually edit each HUD element.
	- Determine whether units and markers will be displayed (by default they are).
	- Determine which icons you'd like for units, vehicles, enemy units, enemy vehicles, markers and predictive targetting.
	- Determine whether the HUD will simulate reduced effectiveness under various conditions (by default it does).
	- Adjust the colour of the HUD, friendly, civilian, enemy and squad units.
	- Adjust the default transparency of the HUD display.
	- Adjust the range that the HUD scans for units and vehicles.
	- Adjust whether the HUD will beep when enemies are detected
	- Add your own goggles/headgear to list which HUD will be displayed on.
	
By default TPW HUD arrays the data in a compact form on the bottom right of the screen. You can easily change this to have the HUD centered, expanded to the edge of the screen, or all elements lined up down one side, etc etc. I encourage you to post your HUD configs to share with others.	

Issues
------
TPW HUD actually arose from some debugging code which I use to keep track of other TPW MODS. It's written in a modular way and it should be simple for you to adapt and extend its functionality.	
	- TPW HUD is in constant development and I am always seeking feedback as to how to improve it. If you can suggest other useful (and plausible) information for the HUD then I'll try to implement it.	
	- Full colour night vision relies on post processing being active for its electronic noise simulation. 
	- Due to the use of setaperture, if you quit or end a mission with full colour night vision active, then the next mission will appear too bright untiL TPW HUD activates again and restores the default brightness.
	- Electrochromic tinting also makes use of setaperture to darken the screen. A given setaperture setting will not work across all times of day, so it is actually keyed to the angle of the sun above the horizon so that the first press of the button should only give a slight reduction in brightness (if at all). You'll have roughly 6 steps in darkness reduction before cycling back to untinted. Tinting will not work when the sun is below the horizon.
	- I have purposefully made TPW HUD simple in appearance, so as not to appear like part of the game interface. This means no dark boxes or shadowed text/icons, and definitely no fancy effects. I advise playing Crysis if this is what you're after!
	- I'm not particularly interested in your opinions regarding the use of TPW HUD as cheating. If you are playing in the default 2035 setting, it's actually likely that the goggles actually underrepresent the available technology. If you're playing in a 1985 setting, then don't use them. I'm spectacularly uninterested in your opinions of how this affects your MP experience - it's an SP only mod.