Jump to content
genesis92x

Vcom AI V2.0 - AI Overhaul

Recommended Posts

Weapon utilization is cool, without testing too far are they able to pack weapons again after situation clear and continue their waypoints?

Also look forward to testing "Vehicle Disembarking" as I've never really seen a mod or scripts get this right and vanilla seems to get the disembark distances and behavior of disembarked troops right.

Nice work! Can't get enough AI enhancements, I'm looking forward to testing with AISS :D

Share this post


Link to post
Share on other sites

This is what I thought as well - I will need to put more research into this because I have had mixed results as well as seeing posts saying both things :/. Fortunately we can change it easily, I will have to change the default settings for the next update!

I know exactly what you mean by mixed results.

I almost feel like there is a problem where the vanilla AI will break if certain skills are set too low with setskill (resulting in a super ai - or at least a super skill for that value* maybe just a reverse case for aimingshake?).

I would be interested to hear if you (as someone who is making an advanced ai) experienced anything that would suggest this?

*I swear if these weren't floats I would suspect an unsigned int was the culprit. Maybe the weirdness comes from the inner way the value is interpolated by CfgAISkill? Maybe an adjusted negative value is interpolated to a 1? We can only guess :)

Edited by k0rd

Share this post


Link to post
Share on other sites
Sounds really interesting. It really bugs me that the Arma AI just don't use their mortars / HMGs, preferring to just lug them around the battlefield on their back, so looking forward to trying this out at some point. Really enjoy getting mortared.

You bring up something I've actually never tried. The AI will deploy/use ANY static weapon at their disposal, this could have an unusual consequence of the AI deploying mortars when the enemy is 50 M away. Hm... I will have to work on this.

Weapon utilization is cool, without testing too far are they able to pack weapons again after situation clear and continue their waypoints?

Also look forward to testing "Vehicle Disembarking" as I've never really seen a mod or scripts get this right and vanilla seems to get the disembark distances and behavior of disembarked troops right.

Nice work! Can't get enough AI enhancements, I'm looking forward to testing with AISS :D

Yeah! I hope it works decently. I am not making any promises but you should get some mixed reactions. In some of my tests I've had AI squads stop and disembark into a town 500 M away to setup an ambush. In other tests the AI would get a lot closer then disembark - or not even respond at all. It's all very random.

I know exactly what you mean by mixed results.

I almost feel like there is a problem where the vanilla AI will break if certain skills are set too low with setskill (resulting in a super ai - or at least a super skill for that value* maybe just a reverse case for aimingshake?).

I would be interested to hear if you (as someone who is making an advanced ai) experienced anything that would suggest this?

*I swear if these weren't floats I would suspect an unsigned int was the culprit. Maybe the weirdness comes from the inner way the value is interpolated by CfgAISkill? Maybe an adjusted negative value is interpolated to a 1? We can only guess :)

I'm sure it's probably a combination of all that you have listed - interestingly enough the thing I found to have the most impact was the server profile settings. The "PROFILENAME.Arma3Profile" seems to be almost like some barrier?

For example I set the AI accuracy down to like 0.0005 for all difficulties in this file. Without any modifications the AI can't shoot the side of a damn barn 5 meters away. But with the low server settings the AI actually become more dynamic and flexible in terms of accuracy settings. After applying my scripts there appears to be a significant difference now. This may just be a placebo effect but I have suggested this to many people and they say it works for them, so I'm not sure what is going on. I think I will actually do an experiment on AI behavior with different settings to try to make it into a "science"

It certainly doesn't help that the Wiki is missing this information :\

Edit : Here we go.

Each sub-skill (accuracy, shake, and etc) is used in several calculations. Value of each sub-skill is inherited from the value set by skill slider in Insert Unit dialogue or setSkill command, or directly defined by setSkill array command. This value is interpolated into ranges defined in CfgAISkill and multiplied by a value of skillFriendly/Enemy or precisionFriendly/Enemy set in player's profile (.Arma3Profile file).

In the cfgAiSkill file the variables are interpolated by these:

aimingAccuracy[] = {0, 0, 1, 1}; 
aimingShake[] = {0, 0, 1, 1};
aimingSpeed[] = {0, 0.5, 1, 1};
commanding[] = {0, 0, 1, 1};
courage[] = {0, 0, 1, 1};
endurance[] = {0, 0, 1, 1};
general[] = {0, 0, 1, 1};
reloadSpeed[] = {0, 0, 1, 1};
spotDistance[] = {0, 0.2, 1, 0.4};
spotTime[] = {0, 0, 1, 0.7};

Edited by Genesis92x

Share this post


Link to post
Share on other sites

I've been testing this in SP and I have to say it's by far the best AI mod I've tried ... and I've tried them all!

The only problem that I'm having is that when I'm leading a squad or team they refuse to regroup once their 'combat instincts', i.e. the scripts, have kicked in, even if there are no enemies left alive they just keep doing their own thing. Perhaps we need a way of cancelling or overriding the script to take back the reins when necessary.

It would be great to have this as a mod though. Please do it if you can.

Thanks, Gattobuono

Share this post


Link to post
Share on other sites

thanks for the quick reply... still getting same result... after about 5 mins, that same _goingtcombat error starts again...

Error in expression <_GoingToCombat == 0;>
 Error position: <_GoingToCombat == 0;>
 Error Undefined variable in expression: _goingtocombat
Error in expression <_GoingToCombat == 0;>
 Error position: <_GoingToCombat == 0;>
 Error Undefined variable in expression: _goingtocombat
Error in expression <_GoingToCombat == 0;>
 Error position: <_GoingToCombat == 0;>
 Error Undefined variable in expression: _goingtocombat
Error in expression <_GoingToCombat == 0;>
 Error position: <_GoingToCombat == 0;>
 Error Undefined variable in expression: _goingtocombat

no other information is there..

Share this post


Link to post
Share on other sites
I've been testing this in SP and I have to say it's by far the best AI mod I've tried ... and I've tried them all!

The only problem that I'm having is that when I'm leading a squad or team they refuse to regroup once their 'combat instincts', i.e. the scripts, have kicked in, even if there are no enemies left alive they just keep doing their own thing. Perhaps we need a way of cancelling or overriding the script to take back the reins when necessary.

It would be great to have this as a mod though. Please do it if you can.

Thanks, Gattobuono

Thank you so much! It means a lot :D! As for your problem...

If you are a squad leader try pressing the following characters ~, 7, 3. This will put your AI back into aware a lot faster than the default scripts (Otherwise they will still be searching around). I just tested it and it appears to work, perhaps I can make something easier for the players to control their AI...maybe a little dialog menu with more specific commands/orders?

Share this post


Link to post
Share on other sites

very good ia behaviour The only problem i lost control of my sqad also. i will try that.

thank you

Share this post


Link to post
Share on other sites

Seems it happens after the units on the battlefield are deleted/removed... ran with no issues until I deleted the units that were dead and then the _goingtocombat error happened and will not stop...

-Raps

Share this post


Link to post
Share on other sites

Would you consider packing this in a mod style?. So people can easily activate and deactivate.

Share this post


Link to post
Share on other sites

Yes mod would be good please. That way I can compare it to bCombat and ASR_AI properly.

Share this post


Link to post
Share on other sites
You bring up something I've actually never tried. The AI will deploy/use ANY static weapon at their disposal, this could have an unusual consequence of the AI deploying mortars when the enemy is 50 M away. Hm... I will have to work on this.

I guess them mortaring themselves would probably be in the general spirit of most Arma battles my friends and I have.

But perhaps you could make them only deploy their static weapons if the enemy are above a certain distance away, or something, depending on the weapon type of course.

Share this post


Link to post
Share on other sites
Great mod but how do you turn the smoke off it kills my fps thanks...

I will add an option to disable the AI from throwing smokes

Seems it happens after the units on the battlefield are deleted/removed... ran with no issues until I deleted the units that were dead and then the _goingtocombat error happened and will not stop...

-Raps

That's strange, it should exit the FSM when they die - I added an extra check to fix this. Thank you.

Yes mod would be good please. That way I can compare it to bCombat and ASR_AI properly.

I can work on getting that into a mod form - but you should still be able to compare :>

I guess them mortaring themselves would probably be in the general spirit of most Arma battles my friends and I have.

But perhaps you could make them only deploy their static weapons if the enemy are above a certain distance away, or something, depending on the weapon type of course.

Yeah - this is something that will have to be expanded in future versions.

Share this post


Link to post
Share on other sites
Great mod but how do you turn the smoke off it kills my fps thanks...

I agree with that, right now I'm doing a Domination style mission and the AI is just great.. except for that, the mission ended with a server crash cause almost every unit threw a smoke which ended up with a total of 14 smokes or something and 5 FPS on the Players end :D

Share this post


Link to post
Share on other sites
I agree with that, right now I'm doing a Domination style mission and the AI is just great.. except for that, the mission ended with a server crash cause almost every unit threw a smoke which ended up with a total of 14 smokes or something and 5 FPS on the Players end :D

Hah, yeah - I will release a version that you can disable/enable smoke dynamically as well.

Share this post


Link to post
Share on other sites
Thank you so much! It means a lot :D! As for your problem...

If you are a squad leader try pressing the following characters ~, 7, 3. This will put your AI back into aware a lot faster than the default scripts (Otherwise they will still be searching around). I just tested it and it appears to work, perhaps I can make something easier for the players to control their AI...maybe a little dialog menu with more specific commands/orders?

Okay, I'll try that. A simple intuitive command dialog menu would be great, perhaps like a scaled down version of Drongo's Toolkit. I like the Toolkit but it still has too many variants on commands for quick intuitive use in the heat of battle. Something scaled back to the bare essentials would be fantastic. :-)

Edit: just did a bit more testing and unfortunately there's no way (that I've found) to regain control over my team. Once the scripts have triggered they obstinately continue to do their own thing and I can hear them being given orders continuously. e.g. 8 move 100m, 6 move 100m, 3 move 200m left ... and so on. I have zero control over what they do.

However, combat is still way better with this mod, and I seem to get no frame rate hit, unlike all other AI mods that I've used. If you can resolve the command mode problem this will definitely be a must have mod.

Edited by Gattobuono

Share this post


Link to post
Share on other sites

Just tried it out. Fair so far in comparison with other AI mods. My main gripe was that AI REFUSED to use AA and AT against targets. This is a serious problem.

Could you look into it please?

Share this post


Link to post
Share on other sites
Just tried it out. Fair so far in comparison with other AI mods. My main gripe was that AI REFUSED to use AA and AT against targets. This is a serious problem.

Could you look into it please?

I can look into this as well - I haven't had any issues on my end...although I have witnessed default AI doing this.

Share this post


Link to post
Share on other sites

Can I make only friendly AI or those in player group use Vcom AI?

Share this post


Link to post
Share on other sites

I have been toying with this so far, I have found not only do they use AT but they make sure they get you, I was making a water insertion for beach attack and they sank me before I got close to land. lol they shot 3 rockets at me, I was in 3rd person and saw all three, 1 after another and then I started to swim.

I like this script, when loading several scripts init.sqf, I have an establishing shot, I have found this loads best after shot is done. Of course, I load several scripts, parameters and intro so its probably me own fault due to my "older" pc. :)

nice job with script thus far. I have played with DC using this and the AI flank and shoot you up good, so stay cool and look around.

Share this post


Link to post
Share on other sites

the feature list does sound promising! How did you achieve the AI suppression effect?

Share this post


Link to post
Share on other sites
Can I make only friendly AI or those in player group use Vcom AI?

You can, but not super easily. For every AI that you DO NOT want the scripts to run on - put this in their init:

this setVariable ["NOAI",1,false];

I have been toying with this so far, I have found not only do they use AT but they make sure they get you, I was making a water insertion for beach attack and they sank me before I got close to land. lol they shot 3 rockets at me, I was in 3rd person and saw all three, 1 after another and then I started to swim.

I like this script, when loading several scripts init.sqf, I have an establishing shot, I have found this loads best after shot is done. Of course, I load several scripts, parameters and intro so its probably me own fault due to my "older" pc. :)

nice job with script thus far. I have played with DC using this and the AI flank and shoot you up good, so stay cool and look around.

I appreciate the post :> Thank you. And there are optimizations that need to be made for sure - this will happen as time goes on hopefully.

the feature list does sound promising! How did you achieve the AI suppression effect?

Thank you! And the AI suppression uses a "fired" event handler that tracks the bullet. It does not track EVERY bullet from somebody shooting (for performance sake). If the bullet hits within a certain range of the closest enemy, it sets them as suppressed. If the bullet hits within a further range, it sets the AI to combat stance.

Messy code below.

Hitnear.sqf

 
_unit = (_this select 0) select 0;

//Hint format ["_unit %1",_unit];
_bullet = (_this select 0) select 6;
_TimeShot = _unit getVariable "FiredTime";
_SideUnit = side _unit;
if(_TimeShot == 0) then {
_unit setVariable ["FiredTime",1,true];
_hitPos = [0,0,0];
_done = false;
	while {(!_done )} do
	{
	   //sleep .005;
	   _pos = getpos _bullet;
	   if (_pos select 0 > 0) 
	   then 
	   {
			_hitPos = _pos;
	   }
		else
	   {
			_done = true;
	   };
	};   // end while
_Array2 = allUnits;
_Array2 = _Array2 - [_unit];
{
if ((side _x) == _SideUnit) then {_Array2 = _Array2 - [_x]};
} forEach _Array2;
{
_CheckDistance = (_hitPos distance _x);
if ((_CheckDistance >= 46) && (_CheckDistance <= 200)) then {_x setVariable["MOVINGTOCOVER",0,true];};
} forEach _Array2;
_Point = [_Array2,_hitPos] call BIS_fnc_nearestPosition;
_CheckDistance = (_hitPos distance _Point);
//Hint format ["_CheckDistance %1 _Point %2",_CheckDistance,_Point];
if (_CheckDistance <= 45) then {_Point setVariable ["Suppressed",1,true];};
[_unit] spawn {
_unit = _this select 0;
sleep 10;
_unit setVariable ["FiredTime",0,true];
};
//if ((_CheckDistance >= 31) && (_CheckDistance <= 500)) then {_Unit setVariable["MOVINGTOCOVER",0,true];};
};

Edited by Genesis92x

Share this post


Link to post
Share on other sites

Thanks for the explanation. So bullets passing by the AI, that don't actually hit anything will not suppress it?

Also, what happens to a suppressed AI, do you force it to go prone, for example?

Share this post


Link to post
Share on other sites

Nice mod, it definitely has great potential. When I was trying it just now , i noticed that the mod was giving commands to my subordinates when i was the leader, thats bug i assume, because i cant apply any tactic this way :).

Share this post


Link to post
Share on other sites
Thanks for the explanation. So bullets passing by the AI, that don't actually hit anything will not suppress it?

Also, what happens to a suppressed AI, do you force it to go prone, for example?

Technically they will. What I do is wait for the bullet to "die" OR wait x amount of time and then get the bullets position. The theory (although can be buggy at times) is that even passing bullets have a chance to suppress an AI. I find it rather difficult to track objects that move so fast and can act so unpredictable. You would be amazed at the percentage of bullets that just riochet for KM's.

I do a few things with the FSM's. Being suppressed instantly forces them to drop to the ground, then it spawns an AI check to throw smoke or a grenade if close enough, then it tells them to run to cover.

Nice mod, it definitely has great potential. When I was trying it just now , i noticed that the mod was giving commands to my subordinates when i was the leader, thats bug i assume, because i cant apply any tactic this way :).

Yeah, I wouldn't say this is a bug per se. Pressing ~, 0, 7 (I think) will put them back into aware and give you normal control again. You can disable the scripts on specific AI by putting

this setVariable ["NOAI",1,false];

in their init lines. I think I will work on a cute little dialog that allows for greater control over AI squads soon.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×