Jump to content
Mosshadow

Creating an elite AI unit?

Recommended Posts

I am trying to think of a way to create an elite AI controlled fireteam or squad in some of the missions I am making for my milsim unit. I want them to be significantly better and for this difference to be very noticeable to players but at the same time not make them too powerful. 

 

Our server uses both ACE and MCC. In order to make units more unique I have tried increasing their accuracy and other skills but there is little difference and I think MCC may be overwriting any changes I make. In addition I have tried giving some squads the heavy russian armor however the wound system of ACE means that the difference is not very significant, especially at close range.

 

Are there any AI scripts I could put into the mission file that will only activate on specific units and make them significantly more deadly to players? I have considered using Vcom but It seems to work on all units and makes the AI a bit hyperactive.

Share this post


Link to post
Share on other sites

Use CBA Extended Init Eventhandlers to setUP a UNIVERSAL SOLDIER.

  • Like 1

Share this post


Link to post
Share on other sites

I would wait for the Difficulty overhaul BIS has been talking about : we will most likely have new script commands regarding AI skills and such. ;)

  • Like 2

Share this post


Link to post
Share on other sites

Put this into .sqf file called "ouch.sqf":

params ["_grp"];
{

    _x setskill 1;
    _x setUnitAbility 1;
    _x allowFleeing 0;
    _x setskill ["aimingAccuracy", 1];
    _x setskill ["aimingShake", 1];
    _x setskill ["aimingSpeed", 1];
    _x setskill ["spotDistance", 1];
    _x setskill ["spotTime", 1];
    _x setskill ["commanding", 1];
    _x setskill ["courage", 1];
    _x setskill ["general", 1];
    _x setskill ["reloadSpeed", 1];

    _x addEventHandler ["HandleDamage",{

            params ["_unit","_selection","_damage"];
            _damage = _damage * 0.1;
            _damage

    }];

} foreach units _grp;

_reveal = [_grp] spawn {

    params ["_grp"];

    while {{alive _x} count units _grp > 0} do {

    _leaderPos = getposatl leader _grp;

        {


            if (getposWorld _x distanceSqr _leaderPos < 1500^2) then {

                _grp reveal [_x,4];

            };

        } foreach allUnits;


    sleep 3;

    };

true
};

In an units init field put this:

nul = [group this] execVM "ouch.sqf";

Units will only take on tenth of damage and be ultra accurate.

On a sidenote, be careful on using this with units that are equipped with scoped rifles, they will one shot every infantry unit within their range, better use weapons without a scope or remove it via script.

Enjoy your nightmare.

 

Cheers

Share this post


Link to post
Share on other sites

That's a bit over-powered for what the OP is asking. ^^

 

...But I might use that for cyborg units on a little sci-fi project of mine! ;)

Share this post


Link to post
Share on other sites

https://community.bistudio.com/wiki/AI_Sub-skills

Try to obtain data on "human accuracy with rifles" As the distance increases with a rifle to target effective range is limited to a certain point. So an AI with an MX > 600M is likely to have some loss in accuracy, an accuracy of 1.0 is 100% No human can do this, robots can such as the one tested by South Korea but humans can not.

 

http://www.bbc.com/future/story/20150715-killer-robots-the-soldiers-that-never-sleep

 

Now think about this, how courageous? Are the worlds most Elite soldiers?
command how good is their commanding? Or do they operate alone? (Ungrouped won't share info with surrounding group)

What is a realistic spotting distance an AI could do with an MX and no scope? But Binoculars? or Range finders?
How fast can they reload? Do they have a change of for example if no courageous enough dropping a magazine under fear?
How fast can they find a target and begin engagement?

How much training to they have with the weapons recoil properties?

All these questions must be asked if you want an "elite team" but no a super-soldier team.

Share this post


Link to post
Share on other sites

https://community.bistudio.com/wiki/AI_Sub-skills

Try to obtain data on "human accuracy with rifles" As the distance increases with a rifle to target effective range is limited to a certain point. So an AI with an MX > 600M is likely to have some loss in accuracy, an accuracy of 1.0 is 100% No human can do this, robots can such as the one tested by South Korea but humans can not.

 

http://www.bbc.com/future/story/20150715-killer-robots-the-soldiers-that-never-sleep

 

Now think about this, how courageous? Are the worlds most Elite soldiers?

command how good is their commanding? Or do they operate alone? (Ungrouped won't share info with surrounding group)

What is a realistic spotting distance an AI could do with an MX and no scope? But Binoculars? or Range finders?

How fast can they reload? Do they have a change of for example if no courageous enough dropping a magazine under fear?

How fast can they find a target and begin engagement?

How much training to they have with the weapons recoil properties?

All these questions must be asked if you want an "elite team" but no a super-soldier team.

 

 

So if you know the answer, then help the guy!

 

You're obviously thinking about it so why not give him some practical examples?

Share this post


Link to post
Share on other sites


ArmA 3 is a very much testing, so my best advice for him is to create 1 AI, Put in his init

params ["_grp"];

{

    _x allowFleeing 0; //Set AI's likely hood to flee, possibly regroup

    _x setskill ["aimingAccuracy",0.5]; // Find yourself getting aimboted impossibly. lower it

    _x setskill ["aimingShake", 0.5]; // Find the AI too accurate running / jumping etc lower it

    _x setskill ["aimingSpeed", 0.5]; // Find the AI whip around to shoot you in the head lower it.

    _x setskill ["spotDistance",0.5]; //Same as spot time

    _x setskill ["spotTime", 0.5]; //AI found you 900M or some other ridiculous distance lower it

    _x setskill ["commanding", 0.5]; // Find the AI too skillful with commanding it's units lower it

    _x setskill ["courage", 0.5]; /* Find the AI running away raise it generally SAS are "elite" so assumption is they've been conditioned over and over, the whole honour etc leave-no man behind. (Ballsy) */

    _x setskill ["general", 0.5]; //Find the AI do stupid stuff raise it

    _x setskill ["reloadSpeed", 0.5]; //Find they can reload way too fast and start hosing you in cover lower it.

} foreach units _grp;

// Play with the values experiment but 0.5 is normally a good place to start. Generally higher values == more elite

Share this post


Link to post
Share on other sites

ArmA 3 is a very much testing, so my best advice for him is to create 1 AI, Put in his init

params ["_grp"];

{

    _x setskill 0.2;

    _x setUnitAbility 1;

    _x allowFleeing 0;

    _x setskill ["aimingAccuracy",0.2];

    _x setskill ["aimingShake", 0.2];

    _x setskill ["aimingSpeed", 0.2];

    _x setskill ["spotDistance",0.4];

    _x setskill ["spotTime", 0.5];

    _x setskill ["commanding", 0.8];

    _x setskill ["courage", 0.7];

    _x setskill ["general", 0.8];

    _x setskill ["reloadSpeed", 0.5];

} foreach units _grp;

Play with the values experiment but 0.5 is normally a good place to start. Generally higher values == more elite

 

 

Who or what is _grp?

Share this post


Link to post
Share on other sites

You guys should re-read the first post again. Thread starter ask us how to set unique ("only activate on specific units and make them significantly more deadly to players") Rambo ai unit using ACE 3 and MCC.

Share this post


Link to post
Share on other sites

You guys should re-read the first post again. Thread starter ask us how to set unique ("only activate on specific units and make them significantly more deadly to players") Rambo ai unit using ACE 3 and MCC.

He actually only says he uses ace and Mcc on the server and thinks Mcc is changing skill value so he is wondering about the external scripts that might help accomplish that...

  • Like 3

Share this post


Link to post
Share on other sites

The problem is that the AIs are created and cached by MCC. There are less other reason to use MCC

Share this post


Link to post
Share on other sites

So the better question becomes. ..

What was the op using to attempt to change the ai skill (method) and how is that interacting with Mcc. He already said he tried it but didn't see a result.

He also wants to change specific units so are those units being spawned by Mcc or preplaced and is Mcc is being used for one of its other functions.

Share this post


Link to post
Share on other sites

So the better question becomes. ..

What was the op using to attempt to change the ai skill (method) and how is that interacting with Mcc. He already said he tried it but didn't see a result.

He also wants to change specific units so are those units being spawned by Mcc or preplaced and is Mcc is being used for one of its other functions.

 

I am unfamiliar with MCC, I know of it have used it, I actually didn't like it. Don't ask why.

Share this post


Link to post
Share on other sites

https://community.bistudio.com/wiki/AI_Sub-skills

Try to obtain data on "human accuracy with rifles" As the distance increases with a rifle to target effective range is limited to a certain point. So an AI with an MX > 600M is likely to have some loss in accuracy, an accuracy of 1.0 is 100% No human can do this, robots can such as the one tested by South Korea but humans can not.

 

http://www.bbc.com/future/story/20150715-killer-robots-the-soldiers-that-never-sleep

 

Now think about this, how courageous? Are the worlds most Elite soldiers?

command how good is their commanding? Or do they operate alone? (Ungrouped won't share info with surrounding group)

What is a realistic spotting distance an AI could do with an MX and no scope? But Binoculars? or Range finders?

How fast can they reload? Do they have a change of for example if no courageous enough dropping a magazine under fear?

How fast can they find a target and begin engagement?

How much training to they have with the weapons recoil properties?

All these questions must be asked if you want an "elite team" but no a super-soldier team.

I appreciate your response but I am not trying to ask about real life or anything. I just want a group of enemies that would be a step up from the usual because normally the infantry portion of the unit will easily cut down entire squads of enemies with minor injuries unless fired upon by static weapons.

 

 

 

 

You guys should re-read the first post again. Thread starter ask us how to set unique ("only activate on specific units and make them significantly more deadly to players") Rambo ai unit using ACE 3 and MCC.

 

So the better question becomes. ..

What was the op using to attempt to change the ai skill (method) and how is that interacting with Mcc. He already said he tried it but didn't see a result.

He also wants to change specific units so are those units being spawned by Mcc or preplaced and is Mcc is being used for one of its other functions.

Well the thing about MCC is that it comes with GAIA which I use on AI squads. MCC has a seperate set of soldier traits which I think are set globally. Whenever I try setting the individual skills with sliders (via Eden enhanced) it does not create a major difference so I think it is overwritten. If I set "disable aim error" soldiers do become very accurate. 

 

Put this into .sqf file called "ouch.sqf":

params ["_grp"];
{

    _x setskill 1;
    _x setUnitAbility 1;
    _x allowFleeing 0;
    _x setskill ["aimingAccuracy", 1];
    _x setskill ["aimingShake", 1];
    _x setskill ["aimingSpeed", 1];
    _x setskill ["spotDistance", 1];
    _x setskill ["spotTime", 1];
    _x setskill ["commanding", 1];
    _x setskill ["courage", 1];
    _x setskill ["general", 1];
    _x setskill ["reloadSpeed", 1];

    _x addEventHandler ["HandleDamage",{

            params ["_unit","_selection","_damage"];
            _damage = _damage * 0.1;
            _damage

    }];

} foreach units _grp;

_reveal = [_grp] spawn {

    params ["_grp"];

    while {{alive _x} count units _grp > 0} do {

    _leaderPos = getposatl leader _grp;

        {


            if (getposWorld _x distanceSqr _leaderPos < 1500^2) then {

                _grp reveal [_x,4];

            };

        } foreach allUnits;


    sleep 3;

    };

true
};

In an units init field put this:

nul = [group this] execVM "ouch.sqf";

Units will only take on tenth of damage and be ultra accurate.

On a sidenote, be careful on using this with units that are equipped with scoped rifles, they will one shot every infantry unit within their range, better use weapons without a scope or remove it via script.

Enjoy your nightmare.

 

Cheers

Thanks for this script. While I'm not sure it is what I want for a unit, It definitely looks good for a single commander or officer in order to make him tougher since high officers have an annoying habbit of standing up and getting mowed down with M4s. 

 

However this won't make them act differently other than accuracy and not dying. If I gave it to a squad the players might think they are bugged.

Share this post


Link to post
Share on other sites

Afaik Gaia is a high level ai commander and does not set skills altho admittedly it has been awhile since I used it.

In my own efforts for a more human like ai or at least less robotic, froggyluv and I have found that once you get above about 0.2 or 0.25 aiming accuracy, it becomes very hard to see any difference.

I have also found that setting custom skill very low in main menu or even in the slider still does not seem to reduce it below 0.31 aim Acc.

We are using a script similar to the one grumpy posted and this does allow you to custom set it very low.

I can't remember if ace changes subskills but I seem to remember it not doing that.

I guess what I'm getting at is that it may be affecting the skill but it isn't noticable be cause all the ai are above .30 and seem... shall we say... expert marksman so in order to see the difference and have it be noticable... it may make more of a difference to lower other units skill to a conscription level rather then trying to find the difference between .50 skill aim acc and 0.65 aim acc.

Your mileage may vary ;)

  • Like 1

Share this post


Link to post
Share on other sites

Afaik Gaia is a high level ai commander and does not set skills altho admittedly it has been awhile since I used it.

In my own efforts for a more human like ai or at least less robotic, froggyluv and I have found that once you get above about 0.2 or 0.25 aiming accuracy, it becomes very hard to see any difference.

I have also found that setting custom skill very low in main menu or even in the slider still does not seem to reduce it below 0.31 aim Acc.

We are using a script similar to the one grumpy posted and this does allow you to custom set it very low.

I can't remember if ace changes subskills but I seem to remember it not doing that.

I guess what I'm getting at is that it may be affecting the skill but it isn't noticable be cause all the ai are above .30 and seem... shall we say... expert marksman so in order to see the difference and have it be noticable... it may make more of a difference to lower other units skill to a conscription level rather then trying to find the difference between .50 skill aim acc and 0.65 aim acc.

Your mileage may vary ;)

Oh I see. So directly editing the accuracy with scripting is much more effective.

 

Outside of custom scripts, would you recommend any Vcom or ASR style scripts as long as they can be only placed on certain squads?

Share this post


Link to post
Share on other sites

Oh I see. So directly editing the accuracy with scripting is much more effective.

 

Outside of custom scripts, would you recommend any Vcom or ASR style scripts as long as they can be only placed on certain squads?

 

Yes... from what our tests have shown is that setting the ai to the level you want is much more effective through setskill in scripts then through the menu or slider in edtior. This is largely due to the fact you can tailor the AI a little more then the other ways. That goes for subskills though, so keep in mind ASR and Vcom affect behaviour. I'm not sure that ASR and Vcom setskills although they may. You may find that a combination of AI mod and setskill will give you the desired effect. All the AI mods are worth a try IMO because each one presents a different take on AI and you may find your desired outcome there.

 

Plus its a pita working with getting the AI where one wants it, and all the AI modders deserve some love... and oukej too :)

  • Like 1

Share this post


Link to post
Share on other sites

Put this into .sqf file called "ouch.sqf":

params ["_grp"];
{

    _x setskill 1;
    _x setUnitAbility 1;
    _x allowFleeing 0;
    _x setskill ["aimingAccuracy", 1];
    _x setskill ["aimingShake", 1];
    _x setskill ["aimingSpeed", 1];
    _x setskill ["spotDistance", 1];
    _x setskill ["spotTime", 1];
    _x setskill ["commanding", 1];
    _x setskill ["courage", 1];
    _x setskill ["general", 1];
    _x setskill ["reloadSpeed", 1];

    _x addEventHandler ["HandleDamage",{

            params ["_unit","_selection","_damage"];
            _damage = _damage * 0.1;
            _damage

    }];

} foreach units _grp;

_reveal = [_grp] spawn {

    params ["_grp"];

    while {{alive _x} count units _grp > 0} do {

    _leaderPos = getposatl leader _grp;

        {


            if (getposWorld _x distanceSqr _leaderPos < 1500^2) then {

                _grp reveal [_x,4];

            };

        } foreach allUnits;


    sleep 3;

    };

true
};

In an units init field put this:

nul = [group this] execVM "ouch.sqf";

Units will only take on tenth of damage and be ultra accurate.

On a sidenote, be careful on using this with units that are equipped with scoped rifles, they will one shot every infantry unit within their range, better use weapons without a scope or remove it via script.

Enjoy your nightmare.

 

Cheers

So I tested out your script and it doesn't seem to be working as well as I hoped. They seem more accurate at first but then they stop being accurate soon after. In addition they die as easily as before. I tried changed the script to make it so they only took 1% damage but they still die quickly. 

 

Maybe your script doesnt work with ACE? I think its because ACE has individual limb damage and bloodloss while vanilla has HP.

Share this post


Link to post
Share on other sites

Use CBA Extended Init Eventhandlers to setUP a UNIVERSAL SOLDIER.

 

How do you do that?

Share this post


Link to post
Share on other sites

For example:

class Extended_Init_EventHandlers    {

                  class O_soldier_AR_F {
    
                     init = "(_this select 0) call some_function";

                 };
};

You are passing that unit to the function and you can make there what you need with your supermachine unit.

Share this post


Link to post
Share on other sites

Thanks for this script. While I'm not sure it is what I want for a unit, It definitely looks good for a single commander or officer in order to make him tougher since high officers have an annoying habbit of standing up and getting mowed down with M4s. 

 

However this won't make them act differently other than accuracy and not dying. If I gave it to a squad the players might think they are bugged.

 

Well what exactly do you want that AI to do to be "more lethal to players" as you stated in the first post?

Your request was a bit vague, do you want them to do stuff vanilla AI doesn't?

 

Cheers

Share this post


Link to post
Share on other sites

For example:

class Extended_Init_EventHandlers    {

                  class O_soldier_AR_F {
    
                     init = "(_this select 0) call some_function";

                 };
};

You are passing that unit to the function and you can make there what you need with your supermachine unit.

 

A bit of topic, but can this be used when calling a gear function on multiple units?

Share this post


Link to post
Share on other sites

may be just go into the init of each unit whose is "super soldier" and adjust the slider bar. simple enough.... well may be

Share this post


Link to post
Share on other sites

Well what exactly do you want that AI to do to be "more lethal to players" as you stated in the first post?

Your request was a bit vague, do you want them to do stuff vanilla AI doesn't?

 

Cheers

Well I would like them to be a bit more active in taking cover and returning fire. Also using MGs a bit more effectively. I would be ok with making them more resistant to damage. Mainly I just want a certain group of enemies to be stronger than other AI units .

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

×