///////////////////////////////////////////////////////////////////////////////
//
//  ArmA II Operation Arrowhead Zeus AI Combat Skills
//
//  Author: India Kilo
//                                                  Last modified: 29.12.2010
///////////////////////////////////////////////////////////////////////////////


Credit and thanks to:
Solus without whom this addon would not exist: code & reference information
  http://forums.bistudio.com/showthread.php?t=84968
Zeus    (beta testing)
Killswitch & Sickboy for CBA:
  http://forums.bistudio.com/showthread.php?t=78622
ASR Grenadier Fix ref.: http://forums.bistudio.com/showthread.php?t=91530
included courtesy of Robalo_AS
BIS and BIKI  ref.: http://community.bistudio.com/wiki/Main_Page

This mod improves the ability of AI soldiers in a number of key areas:
- Improves AI's ability to spot and engage enemy, extending engagement ranges
  out to 500m and beyond
- Changes the speed at which an AI can get a bead on a target
- The AI now reacts to effective enemy fire, before taking casualties
- Accuracy is changed to ensure sustained firefights take place, allowing
  movement under contact with good use of cover
- Improved CQB
- AI use smoke and frag. Be aware of your enemy's ability to throw frags!
- AI hearing ability is reduced to realistic levels, enabling a player to make
  stealthy close quarter approaches providing he can remain unseen
- Vehicle gunners now react to enemy fire
- Careful movement and correct use of formation is now an important factor in
  improving a soldiers survivability, as are planned ingress and egress routes
- AI react more aggressively under contact and don't give up as easily
- Injuries occur more frequently in firefights. Good drills and wise medics are
  now an essential part of the game

It has greatly increased the immersion and challenge of coop play for Zeus,
hope you enjoy it!

// Installation ///////////////////////////////////////////////////////////////

Extract the zeu_AI.7z archive to your main ArmA II OA directory.
If you don't already have a suitable archiving tool, ref.:
http://www.7-zip.org/

Inside the new @zeu_AI\Addons directory are the .pbo and .bisign files:

ArmA 2 / CO & OA AI core skills:
zeu_cfg_core_ai_skills.pbo
zeu_cfg_core_ai_skills.pbo.ZEU.bisign

OA/CO AI recognition
zeu_OA_c_ai_recognition.pbo
zeu_OA_c_ai_recognition.pbo.ZEU.bisign

ArmA 2 gunshot aural configuration (for ArmA 2, OA & CO)
zeu_cfg_ammo.pbo
zeu_cfg_ammo.pbo.ZEU_test.bisign

OA gunshot aural configuration (for OA/CO only)
zeu_OA_c_ammo.pbo
zeu_OA_c_ammo.pbo.ZEU_test.bisign

OA/CO AI engagement ranges and rates of fire
zeu_OA_c_ai_rof.pbo
zeu_OA_c_ai_rof.pbo.ZEU.bisign

OA/CO realistic weapon dispersion
zeu_OA_c_wep_dispersion.pbo
zeu_OA_c_wep_dispersion.pbo.ZEU_test.bisign

ArmA 2 (only) version of realistic weapon dispersion
.\ArmA2 only\zeu_c_wep_dispersion.pbo
.\ArmA2 only\zeu_c_wep_dispersion.pbo.ZEU_test.bisign


OA/CO rocket ballistics
zeu_OA_c_RocketBallistics.pbo
zeu_OA_c_RocketBallistics.pbo.ZEU.bisign

OA/CO realistic MG recoils
zeu_OA_c_wep_Recoils.pbo
zeu_OA_c_wep_Recoils.pbo.ZEU_test.bisign

ArmA 2 / CO & OA Zeus Dynamic AI
zeu_sys_AI.pbo
zeu_sys_AI.pbo.ZEU_test.bisign
zeu_GLx.pbo
zeu_netcode.pbo

FindCover required by zeu_sys_AI.pbo
zeu_FindCover.pbo
zeu_FindCover.pbo.ZEU_test.bisign

zeu_GLx Features
As the leader of an AI squad, if you are close to buildings and change the
formation to "Vee", your section will garrison the nearest building.


FOV modification, especially suitable for players that use TrackIR or freelook.
Makes objects as close to scale as possible in first person view. While this
narrows the field of view compared to vanilla, players with TrackIR keep full
situational awareness as they can easily look around:
For use with ArmA 2 CO & OA
.\optional\zeu_OA_c_FOV.pbo
.\optional\zeu_OA_c_FOV.pbo.ZEU_test.bisign

ArmA 2 (only) version of FOV
.\ArmA2 only\zeu_cfg_FOV.pbo
.\ArmA2 only\zeu_cfg_FOV.pbo.ZEU.bisign


and again, for ArmA 2 only, weapon sway
zeu_c_anims_weaponsway.pbo
zeu_c_anims_weaponsway.pbo.ZEU.bisign

The .bisign file is to enable players using properly signed addons to join
servers that require them.

Zeus AI Combat Skills also requires CBA Extended Eventhandlers.
Note only:
cba_extended_eventhandlers.pbo

and .bisign files are required for correct operation, full CBA is not needed.
You can find CBA at: http://forums.bistudio.com/showthread.php?t=78622

Make a copy of the ARMA II shortcut on the desktop or wherever you have it.
Right click the copy and select properties. In the target box, append:
 -mod=@cba;@zeu_AI

It should look like this:
"C:\Program Files\Bohemia Interactive\ArmA 2\arma2OA.exe" -nosplash -mod=@cba;@zeu_OA -maxmem=2047

To load more than one mod folder use semi-colons to separate the mod list:
...\arma2.exe -mod=BAF;PMC;@mod1;@mod2;@mod3;@zeu_AI

For an explanation of the -nosplash & -maxmem= parameters, reference the ArmA II
startup parameter page:
http://community.bistudio.com/wiki/ArmA:_Startup_Parameters


Player and server profile skill levels significantly affect gameplay. Empirical
data provides the following recommended skill settings for the .ArmA2Profile:
  skillFriendly=0.98500001;
  skillEnemy=0.99500001;

Recommended precision settings for the player/server profile are:
  precisionFriendly=0.5;
  precisionEnemy=0.48999981;

Higher precision settings tend to make the AI too accurate, which destroys
immersion. These are recommended values borne out of extensive
testing.
Note the value for precisionEnemy is considerably higher than Zeus AI for
ArmA II.
You can of course vary them as you wish to make enemy more lethal, but the
window for adjustment is very small.
Friendly precision is set higher to mitigate against friendly fire and does not
appear to unbalance gameplay when commanding AI squads.

Additional Options:
To disable Zeus AI dynamic behaviour for a specific combat unit, place the
following code in the init line:
this setVariable ["zeu_AIBypass", true];

This will be useful if you are hand placing an AI in a mission and do not want
them to move of their own accord in reaction to enemy.

To disable the default civilian behaviour of stop and dismount vehicles when in
danger, place the following code in the init line of the civilian unit, for the
driver:
driver vehicle this setVariable ["zeu_CivStayInVehicle", true];

or for a passenger (driver stops and gets out, passenger stays in the vehicle):
this setVariable ["zeu_CivStayInVehicle", true];

The civis will follow this behaviour unless the vehicle is disabled by shooting
out a tyre or disabling the engine (if this is possible).

Typical use may be for the driver of a VBIED.

It is recommended that enemy tags are disabled for all difficulty levels by
setting the server profile entries to:
EnemyTag=0;

UltraAI should also be disabled - enabling it makes AI into AK snipers, ruining
any chance of movement under fire:
UltraAI=0;

// Server Admins Installation Guide ///////////////////////////////////////////

Server installation steps are the same as above.
Server profile settings for skill & precision are very important and should be
configured to the values listed above.

If a server admin decides addon signatures should be verified, he should add
the following line to the server.cfg file:

verifySignatures=1

A server admin can decide which addon makers' keys he considers trustworthy by
placing their public keys in the "keys" directory. Usually (vanilla
installation) there's only Bohemia Interactive's signature, called bi.bikey,
in this directory.
You can find the Public Key for ZEU in this package under the following path:
"@zeu_OA\Server Key"

// Tips for mission makers ////////////////////////////////////////////////////

- Vary the skill level of enemy you put in a mission.
  Setting the skill slider to 100% in the editor for every enemy you place may
  seem like a good idea, but it can be counterproductive to make the AI into a
  bunch of terminators... Zeus AI reactions are improved over stock AI and they
  will spot and engage you to a more realistic level.
- Use forward spotters.
  A spotter set to not engage, forward of the main body of enemy can give the
  AI a useful extension to their combat range or awareness - they will inform
  the other units in their group when they spot enemy (ref. commandWatch,
  commandTarget, doWatch, doTarget)
  The spotter doesn't have to be covert, dickers on motorcycles or walls/roofs
  of buildings (unarmed with combat behaviour disabled) can lend authenticity
  to OA scenarios.
- Emulate enemy tactics in rural OA scenarios.
  Enemy tend to concentrate in the green zones, simply because of the cover
  available. The AI are pretty vulnerable on open terrain against humans, so
  choose ground with relief/features they can use.

  They are infamous for 'encirclement' tactics, so make sure you have a
  distraction group plus groups ready to move to the flank and rear - it will
  provide much greater interest and a challenge to the human commanders.
  Zeus AI can make more intelligent use of weapons systems - give some RPG
  gunners OG-7 rounds if you want them to engage infantry and soft targets.
  Equip PG-7 rounds if you want them to engage armour.

  Place random 'groups' on routes that the enemy might use for movement.
  Use column or compact column formation - insurgents in perfect wedge 
  formation just don't look the part. Vary the group sizes and regularity.
  Bumping or being bumped by such a group can add a lot to an infantry mission.

// Troubleshooting & FAQ //////////////////////////////////////////////////////

Report any issues and constructive feedback on the BIS forum thread:
http://forums.bistudio.com/showthread.php?t=89970

Please post your system specification and configuration if you are
troubleshooting

Q. Does it work with ACE?
A. You can use the existing ACE ArmA 2 Zeus AI core skills with the following
   new modules to enjoy the dynamic AI features:
   zeu_cfg_core_ai_skills.pbo
   zeu_cfg_core_ai_skills.pbo.ZEU.bisign
   zeu_sys_AI.pbo
   zeu_sys_AI.pbo.ZEU_test.bisign
   zeu_GLx.pbo
   zeu_netcode.pbo

   & FindCover required by zeu_sys_AI.pbo:
   zeu_FindCover.pbo
   zeu_FindCover.pbo.ZEU_test.bisign

   zeu_sys_AI and zeu_FindCover require Extended Eventhandlers, so you
   also need:
   cba_extended_eventhandlers.pbo
   cba_oa_main.pbo
   & .bisign files

   Important: You must use the ACE specific version for:
   zeu_ACE_c_wep_dispersion.pbo

   instead of the OA version (zeu_OA_c_wep_dispersion.pbo) or a dependency
   error message will be generated on mission load:
   .rpt: "Addon zeu_ace_c_wep_dispersion (entry PKT_veh) not found in the list
   of active addons."
   Warning Message: You cannot play/edit this mission; it is dependent on
   downloadable content that has been deleted. zeu_OA_c_wep_dispersion"

Q. Does Zeus AI Combat Skills require CBA?
A. Zeus AI Combat Skills requires CBA Extended Event Handlers version: 0.6.0
   or later (v0.7.1 tested ok) to work with OA.
   Required files:
   cba_extended_eventhandlers.pbo
   cba_extended_eventhandlers.pbo.CBA_v0-6-0.bisign
   cba_oa_main.pbo
   cba_oa_main.pbo.CBA_v0-6-0.bisign

Q. What happens if the mod is only installed on the server, i.e. players
   don't have it?
A. If AI is in a player's group then that AI is local to the player. If
   the player doesn't have the addon and the server does his AI will be
   less 'skilled' than the server's

Q. Is this update for OA-only, or is it also compatible with vanilla A2.
A. Dynamic AI is fully compatible with base ArmA 2 - I did all the original
   development work with ArmA 2, so there shouldn't be any problems.

   You won't need any of the _OA components, so just use the .pbo's listed
   below together with those from base Zeus AI - ArmA 2/CO & OA AI core skills:
   zeu_cfg_core_ai_skills.pbo
   zeu_cfg_core_ai_skills.pbo.ZEU.bisign

   ArmA 2 / CO & OA Zeus AI:
   zeu_sys_AI.pbo
   zeu_sys_AI.pbo.ZEU_test.bisign
   zeu_GLx.pbo
   zeu_netcode.pbo

   FindCover required by zeu_sys_AI.pbo
   zeu_FindCover.pbo
   zeu_FindCover.pbo.ZEU_test.bisign

   Note, zeu_sys_AI and zeu_FindCover require Extended Eventhandlers
   (thanks to Killswitch, Sickboy):
   cba_extended_eventhandlers.pbo
   & .bisign file

Q. Sometimes my soldiers who is far from battle begins to go cover, and thats
   a problem because it takes alot longer to move my soldiers by foot, than
   when they don't go to cover.
   Is there any way around this, have tried to give safe order, burt still they
   go to cover. It's really anoying when you have to move youir soldiers a long
   distance?
A. Put the AI into Safe or careless mode and compact column or diamond
   formation - you should be able to command them then, even if they were in
   danger mode.
   ref.: beta 60718
   [60711] Changed: Units now never enter cover while moving in compact (Delta
   or File) formations

   For reference, this is default ArmA 2 behaviour and is not related to Zeus AI

Q. Does it work with ACE?
A. You can use the existing ACE ArmA 2 Zeus AI core skills with the following
   new modules to enjoy the dynamic AI features:
   zeu_cfg_core_ai_skills.pbo
   zeu_cfg_core_ai_skills.pbo.ZEU.bisign
   zeu_sys_AI.pbo
   zeu_sys_AI.pbo.ZEU_test.bisign
   zeu_GLx.pbo
   zeu_netcode.pbo

   & FindCover required by zeu_sys_AI.pbo:
   zeu_FindCover.pbo
   zeu_FindCover.pbo.ZEU_test.bisign

   zeu_sys_AI and zeu_FindCover require Extended Eventhandlers, so you
   also need:
   cba_extended_eventhandlers.pbo
   cba_oa_main.pbo
   & .bisign files

   Important: You must use the ACE specific version for:
   zeu_ACE_c_wep_dispersion.pbo

   instead of the OA version (zeu_OA_c_wep_dispersion.pbo) or a dependency
   error message will be generated on mission load:
   .rpt: "Addon zeu_ace_c_wep_dispersion (entry PKT_veh) not found in the list
   of active addons."
   Warning Message: You cannot play/edit this mission; it is dependent on
   downloadable content that has been deleted. zeu_OA_c_wep_dispersion"

// Known Issues ///////////////////////////////////////////////////////////////

30.11.2010 AnimalMother92: game pausing when zeu_GLx.pbo is loaded
  ref.: http://forums.bistudio.com/showpost.php?p=1799964&postcount=1116

09.12.2010 aeggwards1: Independents firing on BlueFor when set as friendly
  ref.: http://forums.bistudio.com/showpost.php?p=1808940&postcount=1187

// Changelog //////////////////////////////////////////////////////////////////

- version 0.02d (29.12.2010): Fixed: AI engaging under "Hold Fire" order
  i.e. ROE violation when enemy near
  biki states units ordered to hold fire are set to combatMode "GREEN" (Hold
  fire - defend only) - as of build 1.57.76934 this is not the case, they are
  in combatMode "YELLOW" (Fire at will)
  ref.: http://community.bistudio.com/wiki/ArmA:_AI_Combat_Modes#Engagement_rules
  AI hold fire finally matches default ArmA 2 performance

- version 0.02c (27.12.2010): Changed: re-inforcement ranges for each faction
  are reduced to prevent all enemy forces being sucked in to the first contact:
  East: 2000m
  West: 2500m
  Resistance: 1400m
  others: 1000m
  Improved: AI will now only use small boats for transport, not ships
  Improved: Rating for helicopters is now more granular, attack helicopters are
  treated differently to transport choppers
  Improved: information sharing is less efficient between AI groups, variation
  added for how long it can take and how likely it is to succeed
  Fixed: helicopters that are transporting troops will no longer attack enemy
  Fixed: zeu_OA_c_ai_rof.pbo - attack helicopters not engaging targets
  Fixed: zeu_OA_c_RocketBallistics.pbo - AH-64D not firing FFAR (FFAR initSpeed
  must be 0.05 or greater) thanks metalcraze

- version 0.02b (19.12.2010): Fixed: AI missing radios causing loss of radio Tx
  Fixed: Bad conversion: array
    Error in expression <eader _tg) ) >500)
    ...
    File x\zeu\addons\GLx\f\zeu_Travel.sqf, line 78
  Improved:  Error in expression <argetGroup))) == 0) then {
  ...
  File x\zeu\addons\GLx\f\zeu_AlertedGroup.sqf, line 633
  Improved: distance AI can call for reinforcement using radio is now dependent
  on which faction they are a member of (placebo equipment variation)
  Improved: AI CQB response when bumped

- version 0.02a (04.12.2010): Added zeu_ACE_c_wep_dispersion.pbo for ACE
  compatibility, ref.: Does it work with ACE?

  zeu_QuickReactions.sqf - improved: AI engaging too soon when in combatMode
  "WHITE" (Hold fire, engage at will), i.e. perceived ROE violation
  AI hold fire now matches default ArmA 2 performance (without zeu_GLx.pbo)

- version 0.02 (27.11.2010): Added zeu_GLx.pbo & zeu_netcode.pbo
  zeu_GLx.pbo provides the platform for implementing AI tactics. Base
  attack/hold/withdraw functionality, together with calling for support

- version 0.01d (20.11.2010): zeu_sys_AI.pbo - improved: AI engaging too soon
  when in combatMode "WHITE" (Hold fire, engage at will), i.e. perceived ROE
  violation
  Fixed: AI gunners not responding to human group leader move commands issue
  Improved: AI gunners and snipers are more inclined to hold position and
  provide supporting fire when not in a player commanded group
  zeu_OA_c_ai_recognition.pbo - improved: hearing ability for tank crew
  zeu_sys_AI - changed: possibility of AI using smoke when hit reduced
  zeu_OA_c_ai_rof.pbo - improved: AI helicopter gunners not engaging

- version 0.01c (04.10.2010): zeu_OA_c_ai_recognition.pbo - added OA character
  classes
  zeu_sys_AI.pbo - AI engagement opportunities increased
  zeu_OA_c_ai_rof.pbo - AK_BASE & RPK RoF, minFireTime
  zeu_cfg_ammo.pbo - added ammunition aural configuration
  zeu_OA_c_ammo.pbo - OA/CO ammunition aural configuration
  zeu_OA_c_RocketBallistics.pbo - fixed: Error in expression <255:>

- version 0.01b (04.09.2010): zeu_OA_c_RocketBallistics.pbo - added CG/MAAWS
  zeu_OA_c_FOV.pbo - added binocular FOV

- version 0.01a (24.08.2010): zeu_OA_c_FOV - default FOV slightly relaxed to
  reduce tunnel vision in and around buildings. View with weapon at the ready
  adjusted to compensate.
  zeu_OA_c_wep_dispersion - Fire modes adjusted to improve fire discipline,
  especially for vehicle weapons and MG's
  zeu_sys_AI - two bug fixes, no feature changes

- version 0.01 (10.07.2010): original release

// ArmA II - Zeus License /////////////////////////////////////////////////////

To use the Zeus mod you must agree to these conditions:
You are permitted to install and use the Zeus mod for personal entertainment 
purposes only. Any military, commercial or educational use is strictly 
forbidden without permission from the author.
Free redistribution is permitted for the original Zeus mod package as long as
it is distributed 100% free of any kind of charge.
Distribution of parts of the Zeus mod or the distribution of modifications of 
the Zeus mod is allowed, but please credit the author.

No warranty, either expressed or implied is included with this work.
Use is entirely at your own risk.

///////////////////////////////////////////////////////////////////////////////