Author: ollem
Author Website:

Requirements: Community Base Addons

Version: 5.51
Signed: Yes, serverkey included

Short description: Singleplayer, Multiplayer and Dedicated Server Compatible AI Suppression System

Date: 2013-12-07 21:13


Comments: (11)
Rating:



 



TPWCAS - TPWC AI Suppression System

by
TPW && -Coulum- && fabrizio_T && Ollem


Description:
One of the things sorely missing from Arma2 is reaction to passing bullets. An AI unit will often stand quite happily whilst bullets whiz by. This makes effective suppression of AI enemies difficult - you basically always have to aim to kill them since you can't make them keep their heads down by shooting nearby.

This addon aims to address this problem by making AI units react to passing projectiles. If a bullet snaps by within around 10m of an AI unit, it will crouch/kneel (depending on movement), and if more than around 10 bullets pass by a unit in 5 seconds, the unit will drop/crawl. After 10 seconds without bullets, the unit will return to its previous stance.

Additionally, suppressive fire can alter the aiming shake, accuracy and courage of the suppressed unit. The more fire directed near a unit, the lower its skills will become. Nearby casualties will further decrease a unit's courage. After 5 or so seconds without bullets, the skills will gradually return to normal. Player units will optionally experience some visual effects if suppressed (camera shake, vision blur and darkening).

Currently there is no "suppressed" eventhandler in the game engine, so TPWCAS aims to mimic one by constantly monitoring whether any active bullet/shell projectile objects have units within a 10m radius. This allows TPWCAS to work for any opfor, blufor or independent on the map, whether editor-placed or spawned.

TPWCAS significantly changes gameplay, allowing for longer engagements and more thought required to survive them.

IMPORTANT NOTE:
TPWCAS is not an all-in-one AI behaviour modification mode. Its primary purpose at this time is to cause units to duck/drop and lose some shooting competence under suppressive fire. It's designed to play well with mods which DO alter AI behaviours under combat stress, and you are encouraged to use these if you require additional realism such as moving to cover.
Version 4.0 includes an optional feature to tigger a basic move to cover by AI in case of close by cover.

VERY IMPORTANT NOTE:
TPWCAS started life as an SP only mod, but a large amount of effort has gone into modifying the bullet detection, suppression and visual debugging framework to work for MP and dedicated server. While every effort has gone into testing in SP, MP and dedi, we simply cannot vouch for perfect operation under all circumstances.


Features:
TPWCAS enables stance and skill modification under fire:
  • Units react to bullets passing within 10m.
  • Units on foot or operating vehicle or static guns are affected.
  • Units driving are unaffected.
  • Only uninjured units are affected.
  • Bullets fired from less than 25m away are ignored.
  • Bullets from small calibre pistols and SMG are ignored.
  • Units react differently according to the side of the shooter.
  • Friendly shooter: > 0 bullets --> kneel/crouch.
  • Enemy shooter: 1 - 10 bullets --> kneel/crouch, > 10 bullets -->drop/crawl.
  • Units regain previous stance after 10 or so seconds without nearby bullets.
  • Friendly shooter: no skill reduction.
  • Enemy shooter: skills reduced according to number of bullets.
  • Units gradually regain skills after 5 or so seconds without bullets.
  • Shooter may be "revealed" to the suppressed unit.
  • Units are more easily suppressed if there are nearby friendly casualties.
  • Player experiences visual effects if suppressed.
Visual Debugging:
Coloured debug balls can be enabled to assist to visualize TPWCAS suppression functionality:
  • No ball - unsuppressed.
  • Green ball - close friendly fire detected - going crouched
  • Yellow ball - sporadic enemy fire detected - going crouched
  • Red ball - threshold value of enemy fire detected - going prone
  • Black ball - unit is fleeing (fleeing does not mean the unit is running away, but will not be able to be suppressed).
  • * Purple ball - indicates LOS (Line Of sight) was triggered

Smoke and flagpoles are related to take cover and civilian runaway trigger:
  • Enemy AI:
      * Yellow smoke + flag pole - selected cover position
      * Blue smoke - unit reached cover
      * Green smoke - unit stayed a few random seconds in/close to cover position and default AI behavior will take over again
      * Red smoke - unit went (too far) to wrong direction or took too long to reach cover and default AI behavior will take over again
      * Cyan smoke - unit is already in cover (or at least no Line of Sight to shooter)
  • Civilians:
      * Yellow smoke + flag pole - runaway destination position
      * Blue smoke - unit reached selected destination and should go prone
      * Green smoke - unit stayed a few random (20 to 40 seconds) at position and default AI behavior will take over again
      * Red smoke - unit went (too far) to wrong direction or took too long to reach cover and default AI behavior will take over again


Installation / Usage:
Please read the online readme for full details of TPWCAS, including features, installation, configuration, caveats, credits and the full changelog!
TPWCAS comes as a script version and an addon version (both in the same download).
CBA (community base addons) is required for both versions.

Script version:
Save all the files in scripts into your mission directory (or wherever you'd like really).
Call it with: null = [] execvm "tpwcas\tpwcas.sqf", in your init.sqf or in the init of any object on the map. You only need to call it the once.

Addon version:
As we always recommend use modfolders to seperate the custom content from the official game content to prevent problems. For different ways to set up your modfolders and use them please visit our FAQ.

When you are using the Steam version you can find a Steam mod installation and activation FAQ here.


Included .pbo files:
tpwcas.pbo


Media:



Caveats:
* The system uses setunitpos to change unit stance. The stance changes are subordinate to those issued by a player to a squad. A squad given "stand" orders will not duck when bullets start flying. Nor will a fleeing unit. Nor will a unit ordered into cover. Nor may units taken over by various FSMs.
* TPWCAS is not bulletproof (pun intended), and may not operate perfectly under conditions of very heavy fire by multiple units or, if the framerate is too low.
* TPWCAS ignores rounds fired from pistols and low calibre SMGs, and subsonic ammunition. You won't be able to suppress the enemy by waving your pistol around.
* TPWCAS implements changes to accuracy, courage etc under fire. The system should play nicely with ACE, ASR_AI, COSLX and other AI behaviour mods, but please report any clashes.
* As far as the authors can tell, TPWCAS causes minimal drops to framerate even on low spec machines, with 50 or so AI taking pot shots at each other. Your mileage may vary depending on computer specs and number of AI. We take no responsibility if your computer explodes.
* Debug balls are registered by the game engine as civilians (!), and may cause some unwarranted effects. Use text debugging if this occurs.
* TPWCAS is in its infancy and probably won't work the way everyone wants it to. We welcome any feedback and suggestions.


Credits & Thanks:
* Variable, Jedra and 2nd Ranger for initial ideas and suggestions.
* Orcinus, Kremator and CameronMcDonald for valuable input, suggestions and encouragement.
* Froggluv and Pellejones for performance testing.
* Robalo for helping to make his incredible ASR_AI skills addon and TPWCAS work nicely together, and for additional code ideas and help.
* Falcon_565 for demonstrating the power of cba_fnc_addPerFrameHandler.
* Foxhound for ongoing support of mod makers.
* BIS for an amazing piece of software which even allows scope for mods like this.


Changelog:
v5.51
- skill accuracy fix
- fixed some other issues

v5.5
- should work with latest A2 patch

v5.0
- update: fixed error messages which appeared after latest A2 beta patch

v4.5
- New: fully automatic detection and support of HeadLess client
- New: 'find cover' function has been made FPS aware too: below configurable server FPS threshold (default 17 FPS) find cover function will be skipped to save some CPU for more important tasks
new usercondig file entry: // 19 AI SEARCH COVER REQUIRED MINIMAL SERVER FPS, ELSE PROCESS IS SKIPPED
tpwcas_getcover_minfps = 17;
- Update: updated bullet detection framework based on Fabrizio_T's latest bDetect v0.76 framework.
- Update: tpwcas_mode = 5 (forced disable of tpwcas) will become 'tpwcas_mode = 0' ('tpwcas_mode = 5' will be deprecated*)
- Update: embedded 'tpwlos' will be disabled by default and can be switched on by changing setting in userconfig file
- Fixed: all hint commands will be optional and by request have been replaced by hintsilent
- Fixed: other really minor changes

v4.1
- New: Merger of TPWC_AI_SUPPRESS and TPWCAS_DSC version
- New: Same mod can be used for SinglePlayer, Dedicated Server, and Client-Server setup (config parameter "tpwcas_mode")
- Auto detection of SinglePlayer setup (tpwcas_mode = 1)
- Auto detection of MultiPlayer Dedicated Server setup (tpwcas_mode = 3)
- Auto disable of client if Server started in Dedicated Server mode (server tpwcas_mode = 3/client tpwcas_mode = 5)
- Manual config option to configure client/server setup (tpwcas_mode = 2)
- Manual config option to disable TPWCAS (tpwcas_mode = 5)
- Experimental config mode specifically for 'Headless Clients' (tpwcas_mode = 4)
- Update: Performance improvements and code optimizations
- Update: Bullet detection frequency (==server load) will always automatically reduce if server or SP FPS drops
- Fixed: all files names to lowercase for Linux Server compliance
- Fixed: tpwcas will work after respawn
- Fixed: Vehicle EventHandlers for vehicles will not be duplicated in case of locality change
- New: basic take cover functionality: can be disabled/enabled in config file
- New: config parameter to set radius to search for cover (recommended to keep low number)
- New: Embedded TPW LOS (Line Of Sight - slightly modified version): can be disabled/enabled in config file
- New: Embedded TPW LOS will automatically pause when (server) FPS is below (configurable) threshold value
- New: Civilians will run in random directions when bullets are close to them
- New: Handgrenades and AT/RPG will cause suppression too
- New: TPWCAS Logic Modules (F7 in editor) to allow Missionmakers to overrule (server) config file parameter settings to:
- Disable TPWCAS (if enabled in userconfig file)
- Enable TPWCAS (if disabled in userconfig file)
- Disable TPWCAS embedded TPW LOS (if enabled in userconfig file)
- Enable TPWCAS embedded TPW LOS (if disabled in userconfig file)
- Disable TPWCAS embedded Find Cover (if enabled in userconfig file)
- Enable TPWCAS embedded Find Cover (if disabled in userconfig file)



Forum topic:
- BI forums (new thread since version 4.1)
- BI forums (older version)



- Community Base Addons




Enable javascript to be able to download from Armaholic please!



Tags: Ai,   Suppression