Jump to content
Rydygier

HETMAN - Artificial Leader

Recommended Posts

Yep, there was few more places to adjust. Replace your file with this:

HQOrdersDef.sqf

It's a makeshift introducing new init config variable: RydHQ_DefRange (1 by default). It's just a multiplier of all values affecting range of defensive placement. Note, with very low values code may not find any positions, obviously. Tested for 0.1 and above. Should work also with numbers higher than 1, but with too high values calculations may become heavy. Not tested that though.

Share this post


Link to post
Share on other sites

I believe there is an error with BB that causes BB to teleport the LeaderHQ (both sides) to the current obj. Even with the BBrelocating turned off, it still does it. Plus, even if it was turned on I don't think it would want to be teleported to the enemy obj haha.

Also, with the known enemy thing:

I usually do it so the enemy knows that there are enemies in a certain area so it skips the recon phase. Does the Leader now ALWAYS know where that unit is, even if it moves?

Share this post


Link to post
Share on other sites

Leader's teleport in BB? Don't think so, that's just a waypoint. Unless it's some new vanilla AI issue in

kind. Just tested, and this thing works just as should - Leader doesn't go to the recently taken (not current) BB objective if turned off and goes, if turned on, but in normal waypoint way. No teleport observed either way. But if you show me reliable vanilla repro, I'll check it. Note however, RydBB_LRelocating (be sure, normal relocating for each Leader is turned off) doesn't prevent movement of reserve division, which may be present, if at least 4 Leaders are controlled by BB side, but that's necessary, because reserve maneuvers are based on this.
I usually do it so the enemy knows that there are enemies in a certain area so it skips the recon phase. Does the Leader now ALWAYS know where that unit is, even if it moves?

Specify, how exactly you make enemy know hostile presence. Reveal command gives knowledge about unit and its position, but AFAIK doesn't provide knowledge about later unit moves, unless observer has not obstructed LOS toward such revealed unit (?). Also knowledge value will decay in time unless sustained in "natural" ways or reveal refreshed.

Recon you can ommit also using:

RydHQ_NoRec = 10000;//no recon

RydHQ_RapidCapt = 10000;//no delay before first capturing missions

Difference is, your way generate attack missions, while this one - capturing missions.

Edited by Rydygier

Share this post


Link to post
Share on other sites

RydHQ_DefRange has been working wonders for me - thank you!

Managed to do something similar for your garrison script: I applied a variable to lines 56, 83, 90, and 155 of garrison.sqf. Lower values allow the garrisoned groups to find positions much closer to each other, especially for such a dense city environment.

Share this post


Link to post
Share on other sites

Rydygier, in the HAL manual, in the 'Possible Missions' section under 'Rest mission', you say:

There is an option, inactive by default, that allows for pairs of such groups, when without vehicles and under 50% of nominal strength, and if close enough, to combine together into one group.

Maybe it's just me, but I can't find any mention of this option in the config variables or anywhere else in the manual. Would you be able to shed some light?

Share this post


Link to post
Share on other sites

Hm. Looks like another, I forgot to put into the manual. Good catch. Here you go:

RydHQ_Combining = true;

The conditions of occurence are:

1. Two resting groups (exhausted);

2. Both with losses above 50% of initial number;

3. Both on foot (no vehicle assigned);

4. Not farther than 200 meters from each other.

It's pretty old and not checked long time piece of code, all under cobwebs, dust etc. I hope, it still works. :)

Share this post


Link to post
Share on other sites

I can't seem to get the defensive set leader to face the right direction. Using the set custom direction doesnt work, nor does setting always known units. I set 5 always known units, should I set more in the direction I want the leader to face?

Share this post


Link to post
Share on other sites

Indeed, I found some problems with the code supposed to direct defending groups according to "DefFront" init variables. No time now for proper HAL update with testing etc. sadly, but in the meantime you may use this Defense directions hotfix. Just paste the content into "HAL" subfolder overwriting previous files. What was corrected:

1. Now defensive perimeters set with proper direction in relation with def spot (objective's or leader's position). It means, if you've set "N" as direction for given def spot, perimeter center will be set to the north from that def spot.

2. "DefFront" init variables now will overwrite angles that may be chosen due to known enemies, so be careful with this (that may change for official update, not sure yet).

3. Fixed wrong directions passed in some circumstancies for each perimeter.

4. Fixed final facing direction calculation for each group (it was in relation with HQ, now, as should be, is taken in relation with group's TL).

Example:

defHAL.jpg

So proper directions are given now. Note however, for some mysterious (at least for now) AI reasons, TL sometimes may not face direction pointed to him via setFormDir and doWatch (some point in proper direction), or rather will do it, but sometimes very roughly. So main tendency is right, but there may be some exceptions. Also, as you can see, defense center is one thing, but final chosen positions around it is another - if all good spots are only in the one part of the perimeter, all groups may be sent there, thus "center" may be not actual center of the group positions, just central starting point of area searched for good spots.

Thanks for reporting. :)

Edited by Rydygier

Share this post


Link to post
Share on other sites

No problem, thanks. I am also getting an issue with the helicopter transport system. It seems to go and pick the up the infantry, but not actually do anything after that. It then disembarks them there and returns to base. In general acting very weird.

Share this post


Link to post
Share on other sites

I've been looking for a good AI/Commander mod.

Can this work together with ASR AI? MCC Gaia? DAC? I know each of these I mentioned is totally different, which is why I'm asking. :p

Share this post


Link to post
Share on other sites
I am also getting an issue with the helicopter transport system. It seems to go and pick the up the infantry, but not actually do anything after that. It then disembarks them there and returns to base. In general acting very weird.

Many things may go wrong here for very various reasons, including some recent AI changes/flaws, other mods etc. Without extensive testing can't tell anything specific, and still no time for that. :(

Can this work together with ASR AI? MCC Gaia? DAC? I know each of these I mentioned is totally different, which is why I'm asking.

Hetman manipulates AI mainly on group level via setting behavior, combat mode, waypoints and that sort of things. With some exceptions. When picking mods to play with general rule is to avoid using more, than one mod doing certain thing (like two sound mods), similar is here. If you want to use it with another mod, working on the same basis, as easy to predict, you'll get weird interferences due to two mods "fighting" for control over the group. Otherwise should be fine. Amongst mentioned mods I was using only ASR in th past, and this one should work fine with Hetman. Didn't used Gaia or DAC, but IIRC both are messing with same stuff, as Hetman, thus both will collide - consider them as alternative, not supplement, if so.

Share this post


Link to post
Share on other sites

Ryd, do you have any tips on using the commander as sort of an insurgent commander? Ie, the objectives being weapon caches and having the commander act a little more stealthy and... well... insurgent like? lol. Appreciate it.

Share this post


Link to post
Share on other sites

Not really, I'm affraid. Leaders are to the very bone "regular" type of commanders. There was old plans to make special insurgent mode for Hetman, but it never happened - determined, so easier is to make separate script for that, than trying to "bend" Hetman toward such behaviors.

You can try something though...

There are more stealthy kinds of tasks, HAL assigns: recon, sniping, specfor. So you could try to tailor HAL's army such a way, so those tasks will be the only used. Eg. Recon to spot enemies, then HAL will use sniper teams to engage or SF attacks, if target is valuable (arty, statics, HQ)

1. Recon

Of course you can put used units classnames into Recon RHQ, also you can put chosen groups into RydHQ_ROnly array.

2. Sniping

Group has to consist at most 2 men, of which at least one has to be from snipers category (use RHQ for making chosen classes "snipers")

3. Specfor

Use SF RHQ category for classes, that should be treated that way.

4. If all groups will be stored in either ROnly or AOnly arrays or if SF category - no one should be used for capturing missions, which should prevent objective to objective progress, which may be useful to avoid regulart shape of battle leading to its end. Recon, which is crucial, still will be sent around objectives though (use ForceAAO mode to enable recon around not only first, but also subsequent objectives simultanously - use objectives to mark points of interest of insurgent activity).

5. Other init variables may be useful too, like Berserk to avoid defensive stance, MARatio to set custom ratio of sniping missions against single spotted enemy, Leader's personality variables, decoys, AlwaysKnownU, Pathfinding etc.

Edited by Rydygier

Share this post


Link to post
Share on other sites

Perfect idea, thanks Ryd. I didn't think about the sniper thing. They frequently do hit and runs which is perfect. All that is great.

Share this post


Link to post
Share on other sites

What would happen if the objective is a weapon ammo crate, and its destroyed? Does the commander just not recognize that as an objective anymore or would it break things?

Share this post


Link to post
Share on other sites

Objectives should be not removed from the map - it likely will break things. Better place usual trigger as objective on the box position.

Share this post


Link to post
Share on other sites

Ok. 2 more questions after testing:

Easier way to disable capture orders? I'd rather not have to have a set of recon units and a seperate attack set. Prefer to have them do both.

And I added the 4 classes I am using to the sniper class list in the init, but they're still assigning sniper missions. 2 units in each squad and INF attack is all that comes up.

Other then that, its going great. Set up civilian spotters in each town so the enemy commander knows where the blufor is at all times. The pathfinding and dyn formations really make the AI smart as well. Thanks again for this great mod!

Share this post


Link to post
Share on other sites
Easier way to disable capture orders? I'd rather not have to have a set of recon units and a seperate attack set. Prefer to have them do both.

There isn't simple exclusion from capturing variable (although could be in thge future). One way is to convince Hetman, all objectives are taken (RydHQ_NObj = 5), but then also recon missions will be disabled. Otherwise you can only try to convince Hetman, none of his groups are suitable for this job, but then these groups will be not assigned also for other tasks, so this is no go.

2 units in each squad and INF attack is all that comes up.

If all is set properly snipers should be send before Hetman is looking for regular infantry, but maybe I'm forgetting something. Anyway, you can either use:

[b]RydxHQ_MARatio[/b] = [-1,-1,-1,-1] –  shared by all Leaders. By default HAL will send against each enemy group up to three infantry/soft, two armored, one air and two sniper groups. Each number in this array is corresponding to one of that kinds of forces in same order. Setting any of that numbers with not negative value will replace for that kind described default allocation with alternative one: total number of non-reserve and not busy groups of that kind will be multiplied by set corresponding value. Result rounded up means maximal number of groups of given kind, that HAL will try to send against one enemy group. So for example, if there are 6 infantry groups and 8 armored groups not set as reserve and currently idle, for [0.15,0.5,-1,-1] against next spotted enemy group in that cycle HAL will send up to 6 * 0.15 = 1 infantry group and 8 * 0.5 = 4 armored groups. Air and sniper groups will be allocated in default way;

for example: RydxHQ_MARatio = [0,0,0,3]; should make, so Hetman will react on known enemies only with sniper attacks. I hope, this works, wasn't tested too much.

or try to empty all infantry RHQ arrays using "RHQs" arrays, to convince Hetman, there is no infantry. Of course auto RHQ filler must be disabled (Ryd_RHQAutoFill = false).

Share this post


Link to post
Share on other sites

still can't get them to act as snipers. When I disable the filler, then Hetmans doesn't recognize them. no matter if I put them into infantry and sniper, or just sniper. Here is my init.sqf:

RydHQ_Wait = 2;
RydHQ_Debug = true;
RydHQ_CargoFind = 1;
RydHQ_GroupMarks = [west,independent,0];
RydHQ_DynForm = true;
RydxHQ_NEAware = 700;
RydHQ_ForceAAO = true;  
RydHQ_NObj = 5;
RHQ_Snipers = ["rhs_g_Soldier_F","rhs_g_Soldier_AR_F","rhs_g_Soldier_AT_F","rhs_g_Soldier_M_F","I_G_Soldier_F","rhs_g_Soldier_M_F","I_G_Soldier_AR_F"];
RydHQ_Berserk = true;
RydHQ_PathFinding = 200;
RydHQ_MAtt = true;
RydHQ_Personality = "SCHEMER";
RydxHQ_MARatio = [0,0,0,3];



and i've double checked the classnames, all good.

Share this post


Link to post
Share on other sites

It's likely, I'm forgetting something about using snipers by Hetman - not tested my advices. Sadly, I have no time for Arma these days, or even weeks, so it will take a while before I'll be able to look into this - till then all my Arma activity is put on hold due to really consuming RL job...

---------- Post added at 23:08 ---------- Previous post was at 22:45 ----------

Errata: I think, I know, what's the problem. I forgot to remind - for RHQ arrays classnames must be all lowercase. When I tried with this in mind, I got with similar config sniper missions against single enemy with basic infantry set as "snipers" all right. In fact more, than three, which is disturbing... :) Anyway, even without MARatio, that may not function properly if so (I'll fix this ASAP, means not so soon), you may get up to two sniper missions per target (standard number) using that kind of config:

RHQ_Snipers = ["b_soldier_f"];
RHQs_Inf = ["b_soldier_f"];

(That makes a rifleman sniper ONLY (no longer infantry, so no longer "Inf" tasks)). Auto RHQ filler after all makes no difference, I think, because RHQ/RHQs are applied after auto fill.

Edited by Rydygier

Share this post


Link to post
Share on other sites

Awesome deal. Do you know if the snipers use transportation?

Share this post


Link to post
Share on other sites

External transportation shouldn't be assigned by Hetman for sniper missions - stealthy approach is a priority here.

Share this post


Link to post
Share on other sites

Just a heads up (future reference, as you said you are busy with RL now). Garrison appears to not be working well. Even with attack mission distance increased for it, most of the time they never do anything. A squad can literally roll 100 m from them and they wont do anything.

Share this post


Link to post
Share on other sites

Thanks. Still busy, but some day I'll approach Hetman once more, and your input will be invaluable guidance then. You're exploring some more exotic parts of HAL, thus still not proven/tested well enough also by me.

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

×