Jump to content
genesis92x

Vcom AI V2.0 - AI Overhaul

Recommended Posts

Thanks for the update !

Could it be possible that this script breaks patrol scripts/behavior ?

I tried:

CBA_fnc_taskPatrol, BIS fnc taskPatrol & shk_patrol.sqf !

The problem is that with your scripts active the patrol most of the time patrol not in SAFE mode, they keep their weapons up and do that tactical movement (moving with weapon up).

If i disable your scripts i dont have this problem, units/groups patrol in SAFE mode weapons down.

Can you look into that ?

Here is my spawnInfPatrol script:

if (!isServer) exitwith {};

private ["_pos","_dis","_nr","_locPos","_loc","_spawnPos","_grp","_patrol","_spnr"];

_pos = _this select 0;
_dis = _this select 1;
_nr = _this select 2; // Array, use [1,1,1] for one group and [0,1,2] for random 0,1 or 2 groups
_locPos = [];

_name = ["OIA_InfSentry","OIA_InfTeam"] call BIS_fnc_selectRandom;
_spnr = _nr call BIS_fnc_selectRandom;
//DEBUG
/*hint format["%1",_spnr];*/

waituntil {!isnil "bis_fnc_init"};

if (_spnr > 0) then {
for "_i" from 1 to (_spnr) do
{
_loc = [_pos,_dis,[0,360],0,[0,_dis]] call SHK_pos;
_locPos = _locPos + [_loc];
};

if (count _locPos > 0) then {
	for "_i" from 1 to (count _locPos) do
	{
		_spawnPos = (_locPos select (floor random count _locPos));
		_grp = createGroup east;
		_grp = [_spawnPos, east, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> _name)] call BIS_fnc_spawnGroup;
		_patrol = [_grp] execVM "scripts\shk_patrol.sqf";
		//_patrol = [_grp, _spawnPos, _dis, 7, "MOVE", "SAFE", "YELLOW", "LIMITED", "STAG COLUMN", "", [2,5,10]] call CBA_fnc_taskPatrol;
		//DEBUG
		//[_spawnPos,"ColorRed"] call fnc_createMarker;
	}
};
};

Edited by Wiggum

Share this post


Link to post
Share on other sites

And the warn distance *shouldn't* cause anything to happen. It simply does a distance check - although you can test turning down the distance to 0. You can just put the variable in the init.sqf of a mission and it should take effect.

Warn distance is the only parameter I have played with a lot, because if I leave it at 1000 the whole AO empties and comes to the side that we are attacking, basically leaving no one in the AO including enemy that were supposed to be garrisoned in buildings, but with adjustment I am sure I find the happy medium.

You will have to let me know about any bugs you come across - the next update will include AI using mortars and artillery effectively IF the param is set. *It will be off by default

This would be fantastic, as A3 AI in general seem to be very hesitant to fire a mortar so any help in this area will be much appreciated, it most certainly creates much more immersion when those 80mm shells are dropping nearby (or on your head)

Keep up the good work mate, honestly I could just not go back to vanilla ai after this so please continue polishing this up.

Share this post


Link to post
Share on other sites
I was just curious as to if this would work with Bcombat as well or if I should keep them separate from each other.

I'm not 100% sure but it should work. They will fight here and there, but I wouldn't think it would cause too much trouble. But I have not tested it :p

Thank you!!!

Thanks for the update !

Could it be possible that this script breaks patrol scripts/behavior ?

I tried:

CBA_fnc_taskPatrol, BIS fnc taskPatrol & shk_patrol.sqf !

The problem is that with your scripts active the patrol most of the time patrol not in SAFE mode, they keep their weapons up and do that tactical movement (moving with weapon up).

If i disable your scripts i dont have this problem, units/groups patrol in SAFE mode weapons down.

Can you look into that ?

Here is my spawnInfPatrol script:

if (!isServer) exitwith {};

private ["_pos","_dis","_nr","_locPos","_loc","_spawnPos","_grp","_patrol","_spnr"];

_pos = _this select 0;
_dis = _this select 1;
_nr = _this select 2; // Array, use [1,1,1] for one group and [0,1,2] for random 0,1 or 2 groups
_locPos = [];

_name = ["OIA_InfSentry","OIA_InfTeam"] call BIS_fnc_selectRandom;
_spnr = _nr call BIS_fnc_selectRandom;
//DEBUG
/*hint format["%1",_spnr];*/

waituntil {!isnil "bis_fnc_init"};

if (_spnr > 0) then {
for "_i" from 1 to (_spnr) do
{
_loc = [_pos,_dis,[0,360],0,[0,_dis]] call SHK_pos;
_locPos = _locPos + [_loc];
};

if (count _locPos > 0) then {
	for "_i" from 1 to (count _locPos) do
	{
		_spawnPos = (_locPos select (floor random count _locPos));
		_grp = createGroup east;
		_grp = [_spawnPos, east, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> _name)] call BIS_fnc_spawnGroup;
		_patrol = [_grp] execVM "scripts\shk_patrol.sqf";
		//_patrol = [_grp, _spawnPos, _dis, 7, "MOVE", "SAFE", "YELLOW", "LIMITED", "STAG COLUMN", "", [2,5,10]] call CBA_fnc_taskPatrol;
		//DEBUG
		//[_spawnPos,"ColorRed"] call fnc_createMarker;
	}
};
};

Currently this does break waypoint/patrol behavior. The next version will no longer do this as aggressively, as well as a host of fixes for garrisoning troops and etc. And I can take a look at the safe/aware behavior. Should be an easy fix.

Thank you for posting!

New update v1.07 available at withSIX. Download now by clicking:

http://img-cdn.withsix.com/mods/rv/@vcomai.png

Thanks! That's really awesome! :)

Warn distance is the only parameter I have played with a lot, because if I leave it at 1000 the whole AO empties and comes to the side that we are attacking, basically leaving no one in the AO including enemy that were supposed to be garrisoned in buildings, but with adjustment I am sure I find the happy medium.

Yeah - and in the next version there will be an easier way to control the AI. Garrisoned troops will NO LONGER run out of their buildings, and I will be providing extra functions for ai response distance

Thank you!!

This would be fantastic, as A3 AI in general seem to be very hesitant to fire a mortar so any help in this area will be much appreciated, it most certainly creates much more immersion when those 80mm shells are dropping nearby (or on your head)

Keep up the good work mate, honestly I could just not go back to vanilla ai after this so please continue polishing this up.

Thank you! It means a lot to get posts like these :> I hope I can continue to improve the scripts

Share this post


Link to post
Share on other sites

Thank you for posting!

Thank you for your work and all the updates you already made !

Share this post


Link to post
Share on other sites

That's great to hear about the units patrolling in actual "safe" mode. Thank you Genesis.

Edited by Lucidity

Share this post


Link to post
Share on other sites

Another thing i noticed is that group with a HOLD waypoint often dont spread out that much, sometimes you have 3 soldiers standing literally inside of each other and a fourth one standing a few meters away.

But sometimes they use buildings and the terrain very good, its a bit random.

Could you maybe add enemys screeaming and shouting commands while in battle, that would be cool. Or the enemy shooting flares (or just spawn them) during nighttime if a player is spotted ?

Share this post


Link to post
Share on other sites

Is it a bug that the AI shots captive players?

Having a Hostage mission in which this script completly destroys it by shooting the hostages.

Share this post


Link to post
Share on other sites

AI behave rather weirdly when engaged in CQB for me. Rather than clearing, they move forwards, then retreat to a nearby hillside where they get cut down. Possibly a glitch in the overwatch scripts?

---------- Post added at 06:41 AM ---------- Previous post was at 06:39 AM ----------

I was just curious as to if this would work with Bcombat as well or if I should keep them separate from each other.

Yes, the two mods work together. However as there is some overlap there are some glitches and also some parts of each mod won't work.

Share this post


Link to post
Share on other sites

Units on a Hold waypoint take up position but then they dont really do anything until they get hit.

Share this post


Link to post
Share on other sites

Genesis, first off I would like to say thanks for a great and simple AI mod that almost completely delivers on what was promised. I'm seeing some AI movement and tactics that completely blows some of my group's new guys out of the water in comparison. Some of the fights between just four to six squads of AI have become fantastic tug of war battles across valleys, or fierce firefights in forests. The AI downing looks and feels great, making it feel as though you're fighting against other players at times. If anyone reading this is wondering if you should give this a try, please, please, please do.

Since I frequently play as zeus during sessions, I've picked up on a few things that I've noticed or that I thought you could consider.

- AI should never ignore a Zeus-placed waypoint or formation. As the curator of a game session most of the time I need to look after the players' experience. While having AI move around based on their own smarts is really great and helps me work on other things in the background, sometimes I need to purposely retreat or ease off on the players, whether it's because they are getting destroyed (again) or as part of the story. The AI has a habit of either ignoring my waypoints or deleting them and returning to fight, making it extremely hard to control them at times. Please consider either giving an option to toggle the AI's waypointing behaviour on and off (creating a sort of 'lite' version where the suppression, cover, wounding and skill settings remain) or prioritizing player-set waypoints. If either suggestion doesn't seem good, it'd be nice if AI at least returned to their original positions after fighting.

- AI do tend to split up and go their separate ways. This isn't a problem when dealing with large groups of infantry, since it looks as though they are still in their groups, but when dealing with a single squad you end up fighting them piecemeal. Maybe a restriction on how far apart members of a squad can be from each other?

- The AI still pick funny places to set up their static weapons. It's not a big issue, since the fact that they set it up in the first place is nothing short of a miracle.

- My group uses a dedicated server to run zeus sessions. The addon version didn't seem to work, but the scripts do. FYI.

Apart from that, I want to say thanks for helping me have some of the most fun with arma's AI since A3 launched. Thank you!

Share this post


Link to post
Share on other sites

Hey guys,

I usually like to respond to each comment individually but for the third time in a row when I went to go click post I get asked to log in again and all my responses just get wiped.

I thought the forums saved the info but I was wrong...that's what I get for assuming that and not backing up my responses before I click on anything! Convenience is not what we are known for ;)

Anyway, I have thread all the recent posts and I just wanted to put a few things out there that came up commonly

-Hold waypoint is currently a place-holder until the next version one comes out. AI work much better with HOLD waypoints. All of the complaints about the HOLD waypoint are now fixed, HOLD AI also get an extra layer of love added to them to help them be more effective in close-quarters.

-Addon version does not work on dedicated servers - script bug

waitUntil {!isNil "BIS_fnc_init"};
waitUntil {!(isnull (findDisplay 46))};

Does not work on a dedicated machine - for anyone who was curious.

-Zeus control over AI is limited right now and not at a massive priority. The "best" you can do is delete their waypoints and set them back into SAFE or AWARE stance and then tell them to move. There are functions you can use on the first page, wayyyy at the bottom in the spoiler which can disable the AI waypoint pathing. Of course this is not easy to do in Zeus. I will see if there is a happy medium.

-AI will split up a bit more than people want right now. I am going to try to make them "move" better in an upcoming version but it is by design choice rather than a bug. I hate how the vanilla AI will stay in formations until they die. At the end of the day it is a debatable thing but either way has consequences. There have been many situations where a single AI somehow managed to weasel around a group of players and kill a good chunk of them because the players were too busy firing at the rest of the AI group. I love the interesting scenarios that splitting the AI can produce. I still want to make changes to their movement.

-Static weapon scripts is still a place holder. I have encountered crazy weirdness with static weapons and physics. I saw an AI deploy a static MG, get in the MG, fire once and kill himself by rolling down a hill. This issue is a bit more complicated because it requires me to take into account the variations of all static weapons, even mod static weapons. Finding the size of static weapons before they deploy is something I am unaware of right now. Even more-so, designing a script that finds the size, a proper place to deploy, building considerations, effective range, and line of sight that does not cause significant FPS drops will be hard to get.

-The next update will have addon and script version with more description of what they do.

Really quickly:

ADDON VERSION: Only works with units local to the machine. A dedi-server will not execute these scripts on a group of AI that another player owns. Each client can also have their own PERSONALIZED AI settings - as long as they are not globally broadcasted.

SCRIPTS VERSION: Since everyone is running the scripts, all units will be running the scripts by default. Each client can also have their own PERSONALIZED AI settings - as long as they are not globally broadcasted.

-I have used these scripts and this setcaptive true many times with these scripts without any consequence. The scripts only use this command when an AI goes down in that weird "Perma-downed" state.

-AI behavior will never be "text-book" definition of what is right. Some odd results may happen. I am no military expert - my intention is to just get the AI to react in a way that feels more alive. It's not perfect, and never will be, but hey I'm trying.

Thanks to these people for the posts that I did not get to say thank you to my usual way:

Wiggum

FatalCrash

Lucidity

ESUSSanchez

FortUN

SQB-SMA

Thanks!!!

Edited by Genesis92x

Share this post


Link to post
Share on other sites

Sounds great Genesis92x !

I hope you can fix the behavior with patrol scripts, i just noticed that sometimes the spawned ai group will also not use the formation the patrol script tells them to use, instead they use the "default" one (wedge).

(the whole thing about patrol behavior is really just a cosmetic one but i think its important for mission designers)

And i dont know if this is already fixed but whith the current version i never saw the ai use smoke grenades.

Im very excited about the new Hold waypoint behavior, that sounds cool !

Share this post


Link to post
Share on other sites

Has anyone tested this mod fully with EOS (Enemy Occupation System)? EOS is not just another AI script. The beauty of it is that the mission maker does not have to place any units on the map. Units are spawned by trigger and markers when needed, saving cache and preventing lag. I've posted this question on Bangabob's EOS forum, but he hasn't visited the forum for months now. I would test it myself but my mission isn't done yet. If this mod and EOS could coexist, that would be ultimate. Better yet, if VcomAI had its own dynamic AI spawn system.....

Share this post


Link to post
Share on other sites

A search within the thread yields this from the script's developer:

I'm not aware to the full extent what EOS does, so I can not give you a 100% accurate response. With that said, my scripts only take over once combat starts - and I can almost guarantee it would cause some silly results depending on what EOS does. Would it break the engine? Probably not. Would it break your mission? Maybe. Would the AI be very confused? Yeah - but what's new?

You could always test and see ha ha!

Share this post


Link to post
Share on other sites

That was why I asked "Has anyone tested this mod fully with EOS". The modder has not tested his script with EOS, hence, my question is germane and your sarcasm unnecessary.

Share this post


Link to post
Share on other sites
That was why I asked "Has anyone tested this mod fully with EOS". The modder has not tested his script with EOS, hence, my question is germane and your sarcasm unnecessary.

He did help answer your question, which you haven't thanked him for.

To Genesis, thanks for the reply! If you don't mind, I'm wondering if I could my problem with the AI running all over the place by changing the sequence of commands in the AIWAYPOINT file? From my layman's understanding of the file, would I be wrong to say that it not only handles the AI flanking behaviour but also the cover-seeking and skill settings?

Share this post


Link to post
Share on other sites

I guess I am dealing with a bunch of guys who cannot read unless is it spelled out for them verbatim. To the original question at hand. After conducting a lot of tests on a hosted multiplayer with friends, we did not notice any issues running EOS with VcomAI. The tracking worked well even when units were spawned in dynamically. This script is very nicely done. Much gratitude to Genesis

Edited by chondo999

Share this post


Link to post
Share on other sites

Just some update on the setcaptive.

Seems i had seen wrong about that they were it. However, they are civilians.

It works well without the vcomai, then they are not shoot by their "keeper".

But

Having a soldier that has "dowatch" on one of the hostages and is like 1500m away.

I have VCOM_AIWarnDistance = 500;

But then when i shoot some enemies futher away than those 500, after some minute, they start shooting the hostage that is Civilian. Why is that?

_Is testing the vcomAI on my mission now, looking for some bugs to report that i might find, so maybe updating this reply later with more if i find._

However, vcomAI seems a step closer to better AI, well done!

Bug 1: AI shooting civilian hostage, that the player in the mission is to save and extract. This has happend to me 3/3 times now. Further away than the AIwarndistance. Happens a little after im detected. Never happens with original AI. ///This MIGHT have been caused of another unit that somehow unlucky was hitting the Hostage/Civilian with bad aiming, checking it out further

*Update on this one again.

Did watch this one again with Camera and a friendly AI getting detected while i was watching the hostage the whole time.

So. I have one Hostage that is Civilian placed (no setcaptive since its not needed with civilian). Guarding the hostage i have one enemy (OPFOR) that has "dowatch" on the hostage. The hostage is also placed in "Surrender" animation.

This seems to work until i or my friendly unit (BLUFOR) gets shot by the enemy. Even though they are much further away than the "AIWarnDistance" they still react when one of their own OPFOR forces starts to shot. Even though they not in same group or is within "AIWarnDistance" (Look Bug 3 also). So when one of their own starts shooting a BLUFOR (Still further away than the "AIWarnDistance") it takes some secounds and then the "Guard" to the hostage starts to kill the hostage with some slowly placed shots on him. This breaking the mission completly.

So, in short, When BLUFOR is detected and shot at by OPFOR, even if it is further away than "AIWarnDistance", the Guard (OPFOR) that watches the Hostage/Civilian and has "This Dowatch Hostage" start firing on the hostage after a short amount of time.

This breaks the mission. However. It works perfect with Vanilla AI which is kind of sad since this AI mod seems great otherwise.

Bug 2: AI seem to be alerted even if im one hitting a enemy with a SILENCED weapon with one shot within "AIWarnDistance". Also if they survive 2 shots for max 2-3 sec and the rest doesen't, enemies 200 meters away start running towards me that is behind hills, even though they have not heard or seen a bullet.

Bug 3: "AIWarnDistance" doesen't seem to apply when enemy starts shoot. When the enemy starts shooting at you (even with AIWarnDistance 100) is alerted even though they are like 20x that away from you they start running towards your position. Ignoring the "AIWarnDistance"

Bug 4: This seems also to do other weird things with the Civilians that is hostage when OPFOR detects or starts shoting BLUFOR. They could for example start from being "Enablesimulation off" to be "on" and start to run around, roll around and acting like a soldier, doing weird animations with weapon even though they don't have one.

I think its when the Enemy starts shooting at you, when all this weirdness starts. Have tested it like 50 times with vanilla AI. Everything in the mission works. But with this, it seem to interfere with more things.

As i said, the Hostage can suddenly start to run around even if they have "simulation off" and is set into a "surrender" animation. The Opfor could also start shooting them randomly when any Blufor on the map is detected. As i said, even if they further away than "AiWarnDistance". That doesen't matter it seems.

So somehow, when enemy starts to fireing at me or another BLUFOR, things starts to go into madness

Edited by FortuN

Share this post


Link to post
Share on other sites

Just another idea:

Maybe you can add the option to disable the AI Warn Distance and other scripts on a unit/group but still use the reduced accuracy settings !

Because noone likes to play with this arma3 aimbot ai anyway... ;)

Share this post


Link to post
Share on other sites
Just another idea:

Maybe you can add the option to disable the AI Warn Distance and other scripts on a unit/group but still use the reduced accuracy settings !

Because noone likes to play with this arma3 aimbot ai anyway... ;)

I believe you can reduce the AI warn distance, normal is 1000m. look init.sqf. Try a lower distance and see if that helps. Set it to 0 and please post results, I had wondered if its possible to change this in game with trigger and unfortunately not yet.:(

Edited by JAndrews1

Share this post


Link to post
Share on other sites

@ JAndrews1

No, you misunderstood what i meant.

Its about "disable the AI Warn Distance and other scripts for a (specific) unit/group but still use the reduced accuracy settings".

Share this post


Link to post
Share on other sites

Hey, has anyone got this working smoothly with ALIVE mod?

Heres what i am seeing:

I create multiple playable groups. I have used the INIT command (this setVariable ["NOAI",1,false];) also the HOLD waypoints so the groups stay where they are. However when a battle is happening all those groups go running. I confirmed this is from this MOD because if i use bCombat it works just fine.

Edited by JCae2798

Share this post


Link to post
Share on other sites
Hey, has anyone got this working smoothly with ALIVE mod?

Heres what i am seeing:

I create multiple playable groups. I have used the INIT command (this setVariable ["NOAI",1,false];) also the HOLD waypoints so the groups stay where they are. However when a battle is happening all those groups go running. I confirmed this is from this MOD because if i use bCombat it works just fine.

Do you have the units synced to Alive module to not respond to Alive? I forget which module it is, I think profile and drop window to synced units not react to Alive or something to that.

Share this post


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

×