The addon ”HAC” is intended to enliven the battlefield in the same way that having a human leader would do. HAC does not deal with the manner in which orders are executed (unit level), but deals with the issuing of orders. In other words, this addon gives one or both sides of a conflict a field-commander level AI.
One of most important goals of this addon is to keep high compatibility level with other addons, in particular those that extend the possibilities of AI for units and groups. HAC control is mostly based on issuing waypoints, and as far as possible HAC avoids interfering with low-level AI. In other words, HAC focuses on giving orders, rather than on the way in which orders will be executed.
HAC gives new, higher level AI, rather than changing the existing AI. There are only a very few exceptions to this rule. HAC should therefore enrich the gaming experience with new features, without conflicts with other addons. HAC is intended to complement their effects rather than to compete with them for control over units (at least for those addons that do not mess with waypoints).
HAC can serve as an instant battle generator as well as a general player opponent, or as base for complex missions and/or gameplay modes.
1.4 and above versions needs OA (CO) 1.62 or higher.
To activate HAC for one side, one of the units of that side must be named LeaderHQ. Essential also is the placement on the map of any object (for example, an empty trigger) named RydHQ_Obj1. The location is entirely your choice. Its position will designate a target point which the Artificial Commander will try to conquer at first (for example, a spot near the leader of the opposing side).
Analogously, there should be placed in freely chosen areas (eg in cities, strategic positions or simply nearby opposite Leader) three other objectives (RydHQ_Obj2, RydHQ_Obj3, RydHQ_Obj4), which will be conquered in numerical order. If the mission designer wants less than four objectives, then simply place the unneeded objectives at same position as the ultimate objective.
For the script version only, to initialize HAC the following code should also be executed in some way, e.g., by placing the following script in the init field of any object (for example, in the activation field of an empty trigger or waypoint):
nul = [] execVM "RydHQInit.sqf";
Alternatively, that line may be placed at the end of a mission's init.sqf. Init.sqf is recommended place for init config variables (beacuse of better readability), especially for bigger configs, eg containing RHQ arrays.
For MP client-side compatibility (script is run only on server, but client-side players should have visible tasks assignd by Leader) needed is always function module on map, and, for BB only, RydHQ_MC trigger (customized battlefield area).
See included manual for all details, and there is lots of them.
-----
RHQ CONFIGS THREAD
For easy copy&paste at once all RHQ array sets with class names of new units. Use RHQ array as any other HAC's init config variable. Best: paste needed RHQ as is into init.sqf file (before nul = [] execVM "RydHQInit.sqf"; line, if HAC script version is used, same as for any other init config). Note, that for big arrays as RHQ can be, good practice is additional syntax check. Errors do happen.
"My ultimate goal is to simply get working as much as the A2 code possible in A3 while providing bug reports and documentation along the way to help development of official version."
TO DO (closed for new ideas - HAC enters maintenance stage)
Spoiler:
- fix problems with Recon air usage (shouldn't be treated as recon reserve); - fix problems with assigning empty vehicles; - fix limited control mode by TL's naming; - improve capturing; - add more demos for latest features; - battle radio ambient chatter. - mechanized groups return into APC after the recon mission (other missions too);
- to fix: HAC's tasks overwrite pre-made briefing tasks;
- a way to exclude chosen empty vehicle from cargo usage;
- debug/comm active for MP dedicated (experimental);
- Ammo chute drops from special chosen air support units;
- new sniper mission behavior;
- SpecFor category with own mission kind to eliminate most valuable enemy or guard own HQ if idle or chosen by user for it;
- Optional invisible LZ helipad for cargo choppers to help them not crash in difficult terrain;
- Include optional RHQ arrays for OA, BAF, PMC and ACR that can be used with single boolean variable;
- improved capturing objectives handling, that will speed up conquering objectives;
- customizable main BB cycle interval;
- "CargoOnly" and "NoCargo" arrays;
- optional repositioning for air units, that's landing became too far from current leader's position - can be useful for BB on big maps to keep air support close of whole army;
- improved defense reinforcements behavior;
- optional "dynamic formation" feature, that changes on the fly group's formation and behavior if in possible danger (experimental). - optional simplified BB debug - movement arrows and markings for current/past firefights (?); dynamic markings, that will show real BB's divisions movement as a whole with arrows, and spotted enemy concentrations/fights with special markers (BETA) - weather & daytime factors impact on issuing CAS, arty, recon orders... (?); - optional "attractors" to have control, where should concentrate idle and exhausted; - optional time manipulating and pause before new order for human player. - invisible helipads for air cargo (?); - to correct morale calculation when new group is included; - fix some issues with CFF execution that occurs in certain circumstancies; - surface check for idle patrol waypoints. - incorporation of modernized FAW script for full internal AI arty handling (?); - distance factor in risk calculations for AA and AT; - further development of infantry waypoint level path finding; - to correct influence of recon/FO/sniper units on garrisoned group behavior; - to enhance reserve activity; - enhance manual content; - better attack coordination (?); (experimental - implemented, but not quite reliable, may cause problems. Disabled by default. Used variable shared for all Leaders: RydHQ_SynchroAttack = (true/false)); - improve Leader's relocating, so he will not continue march towards objective, if objective was rapidly lost (currently checked every reset) (?); - allow the Leader's group to do more "stuff", as garrisoning(?); (I do not know, what reasonable this would be); - add flare/smoke grenades handling also for OPFOR weaponry; - investigate and eliminate cause of sometimes spotted doubled orders for human controlled TL; - fix issues with "custom objectives only" mode; - custom map center point and area (?) - (used RydBB_MC - this may be global init variable that contain coordinates of custom map center (then another variable, number, RydBB_MapLng, contains width of the square area) or name of a trigger. In this case width will be equal to trigger's width. Width should be in both cases divisible by 500). This can be useful for quickening of BB initialization, when not whole map will be used (eg to exclude water). If not used - whole map will be sectorized; - morale report on screen for debug mode. - HAC should not take control over formations, smoke usage and vehicle engine for groups led by human controlled units. (following wasn't HAC issue) Engines shouldn't be turned off for planes in air (probably cause: HAC issuing idle order for air groups while shouldn't?); - adding RydHQ_Smoke variable to manual content; - RHQs arrays for subtraction default classnames from given category; - to fix disembarking crew issue for grouped cargo vehicles; - to fix rev.sqf code; - to fix "blindness issue" (?); (for 90% not HAC issue, same problem without HAC for newest OA patch found described on forum... - cyclical comparing forces routine during fight and withdrawning when to big enemy advantage (?); - big boss; - to make speed of groups movement adjustable; - new manual content (internal variables documantation); - to make "idle" orders optional;Added new config variable: RydHQ_IdleOrd; if true (default) idle orders will be issued, otherwise reserve units will do nothing - better defensive bahaviour - usage of objectives as perimeters centers; - to exclude infantry manning static weaponry from taking orders; - HAC should take into account assigned to group vehicle even, if all group is outside, when categorizing groups;(now assigned vehicle is checked, but learned, that editor placed mechanized group's (eg USMC inf with AAV) units, except crew, aren't assigned to group's vehicle until get in, then are assigned even, if later will get out back) - civilians friendly to opponent shouldn't be considered as known enemy unit; (ignored as enemies and allies are now by default "CIV","CIV_RU","BIS_TK_CIV","BIS_CIV_special" factions, but this list, holded by RydHQ_CivF config array may be changed by manipulating with the content of this variable (ignored will be default factions, OR only included in this config array, if defined - defined Array will be repacement, not suplement for default list), so user can set any list of ignored by Leader of given side factions ("ignored", means that Leader of this side will not take into account the existence of units of listed in this array faction in his decisions, however, of course, if units of this Leader will encounter units of "ignored" faction, still will act accordingly to realtions between both factions); - captives should be ignored; - rebalance for morale calculations;(new formula, now morale will slowly grow with time. Is also more important - implemented system of flee/panic due to low morale. Chance for panic is very low, but the more groups "in panic" and the lower is morale, the more chance for panic to others. Panic group will loose all waypoints and is unavailable for HAC. Also will have greatest possible fleeing parameter. There is very small chance to calm down for panicked unit, all this is tested every cycle. Not panicked group also may flee from battle if morale is low enough and casaulties high enough. New config variable, RydHQ_Muu (don't ask...), by default equal to 1, may be used to manually change of "determination" of given side. This is multiplier of allowFleeing parameter. This parameter is randomized in dependency of army morale. Set to 0 will make side's groups totally invulnerable on morale drop. Regardless of multiplier's value, value of this parameter will be never bigger than 1) - new overall army behavior - chance for flee in panic, when morale is broken (instead of surrender?), chance for fleeing dependant on morale and on some feedback loop (more groups in panic/fleeing means more chance for panic/fleeing for each other); see above, optional, may be turned off and on by variable RydHQ_Flee, default set as "true"; - scripted help for withdrawal and air cargo transport by temporary allowFleeing or courage skill manipulating?; - repair&improve or removal of surrendering functionality; - more complex situational judgement, when AA and AT enemy weapons should be ignored and aerial/armor units sent regardless of presence of such weaponry on map (out of range and desperate situations - enemy close to Leader's position perhaps). Currently "desperate situations" implemented. If too many known enemies are closer than allies to Leader's unit, and if average distance is small enough, and when any enemy is very close to Leader, Reclessness attribute of Leader temporary and rapidly increases, so there is big chance for orders, that in other circumstancies would be considered by HAC too risky; - optional flare usage; - integrated artillery handling (proper usage of HE, smoke and illum) (?); - morale drop when current leader unit dies (?); - additional pause before next cycle, if new leader is replacing killed previous; - distinction between aerial and land support vehicles for choosing apriopriate kind depending on distance and terrain; - to add optional hint info about Leader's staff death (when HAC's control ends); - try to make bombers drop bomb via lasertarget method; - operational, but empty (without crew) enemy vehicle shouldn't be counted as enemy when status of objective is checked; - fix syntax error in "combining groups" routine (wip4); - fix addon version from earlier wips (wip4).
-----
SAMPLE MISSIONS
Created any kind of mission utilizes Hetman? Let me know, so I could link it here.
Kind: SP
Map: Chernarus
Required game version: A2 CO 1.62
Addons needed: none
Addons recommended: JSRS
Estimated play time: 10-30 minutes
Author: Rydygier
Description:
Spoiler:
Short mission. You are a MTVR truck driver. Your task is to evacuate Gorka village before OPFOR break our defenses. Civilians to rescue is more, than room in your truck. Time is short and valuable - bought with currency of blood by defending soldiers of B company, known also as Black Company. Enemy is overwhelming and constantly pushes forward. It is only up to you, if you risk own life and return for more people once again, or not. The only judge of that decision would be your conscience. Number of saved civilians is the only important mission factor. Doesn't matter, if you survive. Read the briefing for more details.
When off the truck, you have two custom actions available: gather nearby people, to make near civilians board your truck (present as long there is empty cargo space in yours vehicle), and disembark to unload passangers - do it inside marked LZ area to complete their evacuation.
Civilians are controlled by some exprimental code, that gives them independence and situation awareness, some may refuse follow your call (may help, if you wait with another call, until all currently called are boarded), some, if in panic, may run. There are also old, slow moving persons, that will slow down the process. Truck can hold up to 12 civilians. Save as many, as you can.
Do not leave mission area.
Battle raging on the south is controlled by HAC, so it is fully dynamic.
To finish the mission enter small red circle marked as "end mission" area. After that, or if you die, there will be no typical debriefing. Instead, thanks to another experimental piece of code, you can spectate further evacuation process and/or interesting spots of the whole battlefield chosen dynamically by the camera, as long, as you wish. To end - use "esc" menu.
-----
MY THANKS
Spoiler:
For HAC in MSO module: Tupolov, Wollfy.au, friznit2 and anyone else involved.
For HAC in demo of HC extensions addon: DomZ;
For HAC in COWarMod: Günter Severloh;
For HAC in EBSS: subroc;
For help with kbTell code: gammadust.
For mirrors: Foxhound, Old Bear.
For video tutorial: Hobbesy.
For language corrections: Orcinus and Lucidity.
For voice acting: DuddBudda, SiC_Disaster, nettrucker;
For motivation and interest: All above mentioned and: stubs, thearies, Munger, KeyCat, Neopas, zwobot, colosso, froggyluv, postman84, dcal, Big Morgan, and to all, I forgot (sorry, if so).
I do not presume to have any "copyright" for this project. Addon was created "by player for players", source scripts you can freely modify, copy, "cannibalize", to use in your projects. Addon can be without asking for permission (which is here and now given once for all (well... until I change my mind )) at the discretion used and publicized in any way and anywhere as part of any other projects or as separate file.
I will be grateful for bug reports.
Enjoy being under control.
Rydygier
Last edited by Rydygier; Jun 17 2013 at 21:33.
Reason: sample missions section
Edit* Hey Rydygier, i gave it a quick spin before work, this is really great, i always wanted to be able to place what ever units i wanted on a map and let them sort them selves out, and i think this does just that, does the leaderHQ join the battle? maybe need to hide them away somewhere.
I havent tested a lot but what i did see looked fkn awesome!
I'm glad you like it, Katipo66. LeaderHQ will hold its position if is AI-controlled (script assigns him a waypoint "hold" on his position). Yes, you better hide him somewhere behind and keep well guarded.
I'm glad you like it, Katipo66. LeaderHQ will hold its position if is AI-controlled (script assigns him a waypoint "hold" on his position). Yes, you better hide him somewhere behind and keep well guarded.
Yeah, great gameplay options for player just in that.
Just a couple more questions, sorry bro... ive only skimmed through the PDF, if the answers are their no prob, i check it later.
- If RydHQ_Obj is moved during a game, would that have any influence on leaderHQ?
- and i think that RydHQ_Obj has no influence on leaderHQB?
- would either leader recognize and use spawned or respawned units
there is a good chance, that Artificial Commander will not send to attack armored units, if he knows about presence of enemy anti-tank weapons (such as ATGM units). Similarly rather not send air units in the area in which presence of AA weapons was found...
This sounds like great stuff and something sorely missing from Arma, nice work
Yeah, great gameplay options for player just in that.
- If RydHQ_Obj is moved during a game, would that have any influence on leaderHQ?
Addon itself does not change position of "RydHQ_Obj" but mission maker can do it via script (and it may be mobile object). Addon will "notice" this change and take it into account with next cycle.
- and i think that RydHQ_Obj has no influence on leaderHQB?
Yes, leaderHQB knows nothing about "RydHQ_Obj". His interest in his own objective - object named "RydHQB_Obj".
- would either leader recognize and use spawned or respawned units
Yes, units that appear on the map during the game will be taken into consideration during next cycle.
This sounds like great stuff and something sorely missing from Arma, nice work
EDIT: It should be noted that because almost every team has infantry anti-tank weapons, tanks will be sent with care. I hope that not too carefully. I really wanted to do something like that for Arma. Ambitions nearly outgrown me, code is not perfect and certainly not optimal, but it does its job. I'm also going to use it often.
EDIT: It should be noted that because almost every team has infantry anti-tank weapons, tanks will be sent with care. I hope that not too carefully....
Too carefully is great im thinking, because theres dynamic sub missions etc for the player, for example if the commander will not send armour into an area until AT is cleared, maybe if that was broadcast to the player somehow.
Originally Posted by Rydygier
I really wanted to do something like that for Arma. Ambitions nearly outgrown me, code is not perfect and certainly not optimal, but it does its job. I'm also going to use it often.
This is incredable. I throw down some units, add in a couple of lines of code, an objective, and I have an awesome mission with an intelligent enemy all ready. And the differences between the AIs are pretty good too. I hope it works in MP too. The it would be a quick and easy to use dynamic enemy for Coop.
I hope it works in MP too. The it would be a quick and easy to use dynamic enemy for Coop.
I wish I could say that it works in MP, but I can not. I know not enough to design scripts to make them work in MP. You can try, but I have no idea whether the addon will work in multiplayer. Even if one day I will know the ins and outs of this knowledge, I have virtually no possibility of testing scripts in MP. Sorry. For patient and ambitious remains possibility of adapting scripts on their own, but it's in total several thousands lines of code.
---------- Post added at 23:43 ---------- Previous post was at 23:35 ----------
Originally Posted by Katipo66
Too carefully is great im thinking, because theres dynamic sub missions etc for the player, for example if the commander will not send armour into an area until AT is cleared
I think addon creates many interesting possibilities. Beginning with mission "the hunt for an enemy commander." I am counting on unlimited imagination of Arma maniacs.