Jump to content
Rydygier

HETMAN - Artificial Leader

Recommended Posts

1.22 released. Changelog:

- fixed code error when Leader enters defensive mode before any enemy was spot;

- fixed radio chatter for defensive mode;

- minor code fix;

- manual updated with corrected descriptions of RydHQ_AlwaysKnownU and RydHQ_AlwaysUnKnownU init variables (should hold units, not groups).

Thanks to Acoustic for feedback allowing me to deal with those bugs.

Share this post


Link to post
Share on other sites
Guest

Thank you very much for informing us about the updated version :cool:

Release frontpaged on the Armaholic homepage.

==================================================

We have also "connected" these pages to your account on Armaholic.

This means soon you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Running into another issue.

How do I delay the running of HQA so that HQB can get his units into defensive mode positions. Or would you recommend placing them in certain positions myself and disabling defensive mode all together?

Share this post


Link to post
Share on other sites

Delaying not possible without additional scripting. HAL, the more in BB mode is meant to be highly autonomous, thus you can't so strictly control, what he is doing and when with his groups - if the Leader set as defender is BB controlled, most likely BB will set it offensive back, right away, basing on own judgement. The worse, each group has to reach its position on its own, timing of this is out of control completely, so you can only wait via additional script, till all are ready on place. This may take even minutes.

I suggest place them manually out of Leader/BB control (as excluded completely from Hetman's control), if you want them be on the positions and stay on the positions. Of course, that mean, the groups will stay static, cut off from benefits of HAL's dynamic defense. Hetman means autonomy, so as long group is under his control, you can't be sure, what will happen with it, you can only roughly limit possibilities.

You also can set one, separate Leader out of BB control meant to be HQ for defending forces. Still, one way or another, they need a time to take positions. Simpliest way may be to locate such defensive position far enough from any opposing forces to get enough time.

Edited by Rydygier

Share this post


Link to post
Share on other sites

Anyway to get the garrison groups to garrison all the units instead of just one?

Share this post


Link to post
Share on other sites

You can manually pick, which group should be used for garrisoning, rest depends, where the group is (any buildings/statics around).

First, for each unit except TL, snipers, AT and AA is checked, if there is some empty static weaponry in 300 meters aroud. If so, unit has 90% chance to man it.

As for the rest, all except TL may be randomly sent to garrison buildings in 300 meters radius. Each has 80% chance to do so. TL and the rest will perform looped patrol between garrisoned building. There's nothing, user could change here without manual code editing.

Share this post


Link to post
Share on other sites

I wonder how easily one could setup HETMAN as a "reinforcement only" module? Instead of capturing AOs, HETMAN controlled AI idle/garrison around leader and are sent as quick reactionary force as detected by non HETMAN controlled AI. I am aware of the knowsabout for non included AI but how to disable objectives.

Any input Rydygier before I start digging into the code?

EDIT:

I suppose what I could do is set RydHQ_RapidCapt = 0 and create one custom objective where I'd like them to idle.

Edited by zorrobyte

Share this post


Link to post
Share on other sites

Hmm... You may convince him, all objectives are taken. That may keep him in place without "defend" order. Eg this way:

RydHQ_Taken = [RydHQ_Obj1,RydHQ_Obj2,RydHQ_Obj3,RydHQ_Obj4];
RydHQ_ForceAAO = true;

And to get intel about enemy from non controlled groups:

RydHQ_ExcludedG = [[i]list of all such groups[/i]];
RydHQ_NoWayD = [[i]same list here[/i]];
RydHQ_ExInfo = true;

Objectives still may be lost due to enemy presence near, so you should place them near Leader's position, unless you want to trigger offensive toward certain area, when enemy was present there (may be not detected and still will make objective lost though).

If Leader should send troops only in certain area - use Front (eg HET_FA) trigger to mark that area.

Still, you can't put Leader's army in forced defensive mode, if they should be sent as reinforcements. You can though mark as many of them you want as garrison, if there is anything to garrison around them, as garrisoned groups should have limited ability to respond on near threats (how near - you set radius around them for it):

RydHQ_Garrison = [[i]garrisoning groups[/i]];
RydHQ_GarrR = [i]radius here[/i];

and/or rest/all may be just left for idling.

All this not tested of course. :)

Share this post


Link to post
Share on other sites

Hmm seems to work perfectly except for one thing, excluded units are not triggering attack missions for HAL. Let me explain a little.

I have 5 groups and a leaderHQ (all synced and using RydHQ_SubAll = false; RydHQ_SubSynchro = true;). I have RydHQ_ExInfo = true; and the other recommended options on, such as taken and ForceAAO. I have enemy groups across the map, not controlled my HAL.

Only units synced to leaderHQ can "trigger" attack missions (as in reinforcements). If I sync my player unit to leaderHQ and teleport to enemy, HAL sends reinforcements. If I am not synced to HAL and teleport to enemy, HAL doesn't care.

I may have the wrong idea as for how RydHQ_ExInfo = true; works and if it is designed to account for enemy threat from units not controlled by HAL. As I love donating to you Rydygier, I am offering $20USD bounty for this functionality in some manner if feasible. I am happy to upload repro mission and document requested functionality if you desire.

Share this post


Link to post
Share on other sites

Did you made this:

RydHQ_ExcludedG =
  1. ;

Because ExInfo works only with groups actually excluded - means in that array. Group just not synced will not send his intel to the Leader if not in this array.

Share this post


Link to post
Share on other sites
Did you made this:

Because ExInfo works only with groups actually excluded - means in that array. Group just not synced will not send his intel to the Leader if not in this array.

Interesting, I did not and will try here shortly. Thank you.

Share this post


Link to post
Share on other sites

Since I know I can't exactly do a map wide campaign with Hetman (even with Caching, frames take too much of a hit with that many units). Now, I've thought of a way to do half a map setting with some dynamic spawning:

1. Reinforcements spawning in. IE, when blufor's numbers reach below set number then AI units would spawn in at a set location (at the main base with other reserves) and the leader would take control of these units if only one leader was present. I need a script that does this, any suggestions? And would this actually work as expected?

Side questions:

1. How do I get Hetman to actually leave units in objectives to defend? Mainly just infantry. I know garrison works, but that is only for objectives taken at the start. Secondary objectives sounds like it does the job, but there is only 2. Any way to up the limit on that?

2. What AI mod is best with this? I would assume one that doesn't add waypoints but from experience which ones work best?

Share this post


Link to post
Share on other sites
And would this actually work as expected?

Should. New group should be controlled by Leader of its side with his new cycle. As for the spawning script, I would suggest writing the own solution, fit perfectly to your needs. How exactly it would look like, depends on details. To make it simplier, you may base it on vanilla spawnGroup function.

1. How do I get Hetman to actually leave units in objectives to defend? Mainly just infantry. I know garrison works, but that is only for objectives taken at the start.

No, garrison isn't only for objectives taken at the start, BB may allocate such groups also for objectivers taken later. If decide, he has any to spare, which isn't obvious. But understand, it's wrong thinking: "How do I get Hetman to do some exact thing". Hetman is meant as autonomous beeing, not designed for such strict control. Secondary objectives are ignored in BB and shouldn't be used in BB mode. Their effect is randomized and not permanent anyway. What you want, need separate script for group out of Hetman control. Or exclude chosen group at chosen point, send it toward chosen objective, then add to garrison groups array and include back. This anyway need separate scripting.

2. What AI mod is best with this? I would assume one that doesn't add waypoints but from experience which ones work best?

I haven't such experience to point the best one. It's matter of taste and situation anyway. AFAIK bCombat is fancy, but at a cost of more CPU load. ASR_AI seems more lightweight, but less fancy. I do not know well enough any other AI mods. Others may though.

Share this post


Link to post
Share on other sites

I run HETMAN with bCombat and ZBE_Cache and find them all to work perfectly together (in fact I refuse to run any mission without bCombat and ZBE_Cache now!)

Share this post


Link to post
Share on other sites

Ry, I am trying to avoid using BB (extra CPU usage). But I need more then 4 objectives per side for the size of the area I am using. Would it work if I just set the radius really big to cover 2 cities or would the commander weird out with such a big obj?

Share this post


Link to post
Share on other sites

You can increase radius, but Leader will anyway send troops around the central point of it only. Radius is for setting, how close to the spot groups must be to be counted during capturing check. If you need more objectives, you have to substitute with external scripting, what BB does with objectives - moves them across the map (simple setpos or setPosATL on objective triggers) and resets progress for the Leader by:

_leaderGroup setVariable ["RydHQ_NObj",1];
_leaderGroup ["RydHQ_Taken",[]]; 

BB will not use any additional CPU power - sqf are scheduled, what means, only hardcoded fraction of CPU power may be used for scripts. So if you're after FPS gain, you'll gain nothing this way. It may help, if you run many parallel scripts and exec delays occurs.

Share this post


Link to post
Share on other sites

1. Reinforcements spawning in. IE, when blufor's numbers reach below set number then AI units would spawn in at a set location (at the main base with other reserves) and the leader would take control of these units if only one leader was present. I need a script that does this, any suggestions? And would this actually work as expected?

This example might help

[] spawn {

while {true} do {
Sleep 3;
_god_countUnits = (count allUnits );	
while {_god_countUnits  < 500 } do {
		_grp = [getmarkerpos "SpawnatBase", EAST, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad")] call BIS_fnc_spawnGroup;

		_god_countUnits = (count allUnits );
		sleep 30;
	};
};
};

Share this post


Link to post
Share on other sites

Question for Rydygier, or for anyone who's familiar enough with HETMAN:

Is there a simple way to reduce the radius at which leaders construct their defensive perimeters in custom defense mode? Or can this only be achieved by editing lots of values in a script (I'm assuming something like hqordersdef.sqf would be the script in question?)?

I'm finding that, by default, HAL will send sentries too far afield for scenarios where I'd like the defending army - or at least, what's left of them - to be much more boxed in. Here's an example:

http://i.imgur.com/mzvHErG.jpg

In this scenario, BLUFOR has Zargabad surrounded, with forward positions set up thoroughly throughout the outskirts. Strategic points such as The Villa, Yarum, the airfield, are to be considered under BLUFOR control. Basically, BLUFOR is setting up for a final push, with OPFOR staging a last-ditch defense from the mosque compound and surrounding city blocks.

I'll keep trying to figure out an answer myself, but in the meantime, does anybody know a way to change the size of the leader's defensive AO?

Share this post


Link to post
Share on other sites

Simplifying, dimensions/size of each defensive perimeter are proportional to amount of groups designated to defend it (designated are those, for which this defensive point is the closest one). So the most dense perimeter you can get by placing all objectives on the Leader's position - all will overlap. It's not customizable really apart from that. Could be, so I'll put it into my to do list. All is decided in HQOrdersDef.sqf. The general formula is:

	_Lenght1 = 50 * _cl;
_Width1 = 100 + (5*_cl);

(lines 248-261)

where _cl is the number of designated for given defense point groups.

If however this point is close enough to the "middle of the army" spot, then this looks more square-like:

		_Lenght2 = 50 * _cl;
	_Width2 = 50 * _cl;

(lines 266-269)

It's separately calculated for regular and recon groups. In fact it's a bit more complex, as HAL each time chooses semi-randomly one of two positioning modes. In the first regular groups are located in such way, so optimally not visible for enemy approaching from predicted direction (reverse slope tactics allowing to strike passing by hostiles from closer ranges by surprise). Opposite for recon groups. Second mode is about manning semi-randomly chosen suitable/important spots - so vehicles in the open, infantry opposite, some at roads as likely spots of hostile movements. If this second mode is chosen, then formula looks like:

_radius = 50 + (50 * _ct);

(lines 597, 683)

Chance for the first mode raises with Leader's Fineness.

And some groups may be chosen as reserve. Those are located randomly around Leader's position in the square area of 400 meteres edge (lines 794-795).

Of course, until I'll add custimization of this (not soon, I'm affraid) you could mess with these formulas and this way limit range of defensive deployment. Just a note - it's not dense, because dense placement makes forces more vulnerable on artillery fire - more people may die by one boom. And again, it's not designed with close quarter battle in mind. In such case I would suggest also put some groups into Garrison array to man near buildings (such groups will be excluded from regular placement).

Edited by Rydygier

Share this post


Link to post
Share on other sites

Many thanks for your response, Rydygier. I especially appreciate the detail you've gone into; the insight will help me a lot with playing around with this.

...it's not dense, because dense placement makes forces more vulnerable on artillery fire - more people may die by one boom.

That makes sense. I'm designing this scenario mainly as an infantry brawl, and as a testing platform for various infantry AI enhancements. With this in mind, I'm using BIS_fnc_destroyCity with a random seed to simulate the work the artillery's already done in paving the way for the infantry push ;) Additionally, this also means that you get a slightly different battlefield every time you boot it up... but I digress!

And again, it's not designed with close quarter battle in mind. In such case I would suggest also put some groups into Garrison array to man near buildings (such groups will be excluded from regular placement).

Thanks for the tip :thumbsup:

I can definitely see that it's designed really well for more open, conventional warfare. I realised somewhere along the line that I was going to have to bend HAL a little for this type of scenario :p Really keen to see what it adds, though.

Thanks again for the help, and the prompt reply!

Share this post


Link to post
Share on other sites

Just to update you on how I went, changing values in HQOrdersDef.sqf didn't seem to change anything as far as creating defense points went - no matter how small I made the numbers. The reserve groups were much simpler to rein in, but I must still be missing something with the defending groups. Will keep looking.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×