Jump to content
genesis92x

Vcom AI V2.0 - AI Overhaul

Recommended Posts

Hi, a few quick questions;

I've added the script version to the Liberation mission from Zbug, that we run on our dedicated server.

1. Do I have to enable file patching on server/client/both?

2. Where do I need to put the userconfig folder on the server?

3. Do all clients also need vcomai in userconfig folder?

4. *quote from my question in liberation thread*: Hi,

I have just tried to add the script version of vcom ai to your mission.

One thing happened: The Captured enemy troops could not be commanded after capturing them.

In the vcom ai description it reads: this setVariable ["NOAI",1,false];

- This will turn off the VCOM AI on the given unit

So i suppose I should add this line to the prisonner_ai.sqf file in server\ai folder of your mission.

Do you think it should work like this (see last line):

if ( ( random 100 ) > GRLIB_surrender_chance ) exitWith {};params [ "_unit" ];if ( (_unit isKindOf "Man") && ( alive _unit ) && (side group _unit == EAST) ) then {	if ( vehicle _unit != _unit ) then { deleteVehicle _unit };	sleep (random 5);	if ( alive _unit ) then {		removeAllWeapons _unit;		removeHeadgear _unit;		removeBackpack _unit;		removeVest _unit;		_unit unassignItem "NVGoggles_OPFOR";		_unit removeItem "NVGoggles_OPFOR";		_unit unassignItem "NVGoggles_INDEP";		_unit removeItem "NVGoggles_INDEP";		_unit setUnitPos "UP";		sleep 1;		_unit disableAI "ANIM";		_unit disableAI "MOVE";		_unit playmove "AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon" ;		sleep 2;		_unit setCaptive true;		waitUntil { sleep 1;			!alive _unit || side group _unit == WEST					};		if ( alive _unit ) then {			_unit enableAI "ANIM";			_unit enableAI "MOVE";			sleep 1;			[ [ _unit ], "remote_call_prisonner", _unit ] call bis_fnc_mp;			_unit setVariable ["NOAI",1,false];		};	};};

Share this post


Link to post
Share on other sites

Hi, a few quick questions; *snip*

 

As far as I know:

1) Wherever VCOM is running, filepatching must be enabled.

2) Same place as where it is in your local pc, root of arma

3) Wherever AI needs to be spawned, there vcom must be in the userconfig and filepatching enabled i.e. Gamemasters etc.

4) "this setVariable ["NOAI",1,false];" is the incorrect syntax and gives rpt error spam of "Integer detected, bool expected" and will not work. Change it to "this setVariable ["NOAI",true,false];" and it should work. 

  • Like 1

Share this post


Link to post
Share on other sites

As far as I know:

1) Wherever VCOM is running, filepatching must be enabled.

2) Same place as where it is in your local pc, root of arma

3) Wherever AI needs to be spawned, there vcom must be in the userconfig and filepatching enabled i.e. Gamemasters etc.

4) "this setVariable ["NOAI",1,false];" is the incorrect syntax and gives rpt error spam of "Integer detected, bool expected" and will not work. Change it to "this setVariable ["NOAI",true,false];" and it should work.

Thanks a lot for clarifying this twakkie.

So, since I suppose that ai is only spawned by the server (as long as no hc is c connected), only the server needs the userconfig and file patching enabled. This would be good since the players do not have to setup a lot of stuff. That's also why I preferred the script version over Mod version.

Share this post


Link to post
Share on other sites

Hi again,

we still have the VCOM_AI script version added to the Liberation mission from zbug (link). When I host the exact same pbo locally (with same vcom ai settings in "userconfig" folder, it works like a charm.

I assume all the AI that defends towns or attacks our FOBs should be spawned on the server.

After adding "-filepatching" to the server startup parameters and adding the  VCOM_AI Folder to our Userconfig Folder in "C:\Games\ArmA3\A3Server\userconfig" (there we also have the config for TFAR, which is working), we still have some issues.

The VCOM_AI is not isntalled on any client. So far we did not add "allowedFilePatching = 2;" to the config_server.cfg. So clients cannot enable file patching. 

 

But we encounter some issues:

 

1. AI has more or less no aim...you can stand 10m in front of them and they spray 2 mags at you and hit you maybe once.

This are our accuracy settings in "AISettingsV2.hpp" in "userconfig" folder: 
 

_Unit setSkill ["aimingAccuracy",(0.6 + (random 0.1))];
_Unit setSkill ["aimingShake",(0.6 + (random 0.1))];
_Unit setSkill ["spotDistance",1];
_Unit setSkill ["spotTime",1];
_Unit setSkill ["courage",(0.7 + (random 0.3))];
_Unit setSkill ["commanding",1.0];
_Unit setSkill ["aimingSpeed",1];
_Unit setSkill ["general",1.0];
_Unit setSkill ["endurance",1.0];
_Unit setSkill ["reloadSpeed",(0.2 + (random 0.3))];

Also we have some weird rpt errors related to vcom:

19:01:11 Error in expression <VCOM_HasMine",true,false];
};
} forEach _magazinesAmmo;



>
19:01:11   Error position: <_magazinesAmmo;



>
19:01:11   Error Undefined variable in expression: _magazinesammo
19:01:11 File mpmissions\__cur_mp.Altis\VCOMAI\Functions\VCOMAI_HasMine.sqf, line 39
19:01:11 Error in expression < getvariable "VCOM_AssignedEnemy";

if (_TargetPosition isEqualTo [0,0,0]) then
>
19:01:11   Error position: <_TargetPosition isEqualTo [0,0,0]) then
>
19:01:11   Error Undefined variable in expression: _targetposition
19:01:11 File mpmissions\__cur_mp.Altis\VCOMAI\Functions\VCOMAI_FocusedAccuracy.sqf, line 9

This is the first part of our "AISettingsV2.hpp":

VCOMAI_Func = 
{
//Variable for finding out which config was loaded.
VCOM_AIConfig = "Userconfig folder";
//Turn this on to see certain debug messages
VCOM_AIDEBUG = 1;
//Turn on map markers that track AI movement
VCOM_UseMarkers = false;
//Turns off VCOMAI for AI units in a players squad
NOAI_FOR_PLAYERLEADERS = 1;
//Will AI garrison static weapons nearby?
VCOM_STATICGARRISON = 1;
//How far can the AI hear gunshots from?
VCOM_HEARINGDISTANCE = 400;
//Should AI be able to call for artillery. 1 = YES 0 = NO
VCOM_Artillery = 0;
//Should we let AI use flanking manuevers? false means they can flank
VCOM_NOPATHING = false;
//Should AI use smoke grenades? Besides default A3 behavior?
VCOM_USESMOKE = true;
//Chance of AI using grenades
VCOM_GRENADECHANCE = 30;
//Should the AI lay mines?
VCOM_MineLaying = true;
//Chance of AI to lay a mine.
VCOM_MineLayChance = 40;

//The longer an AI's target stays in 1 location, the more accurate and aware of the target the AI becomes.DEFAULT = [WEST,EAST,CIVILIAN,RESISTANCE];
VCOM_IncreasingAccuracy = true;
//VCOM_SideBasedMovement- Remove sides from the array below to force that specific AI side to not execute any advance movement code. (I.E. Moving to reinforce allies, being alerted by distant gunshots and etc). AI with this will still react normally in combat. DEFAULT = [WEST,EAST,CIVILIAN,RESISTANCE];
VCOM_SideBasedMovement = [EAST, RESISTANCE];
//VCOM_SideBasedExecution- Remove sides from the array below to remove that specific AI side from executing any of the VCOMAI scripts at all. DEFAULT = [WEST,EAST,CIVILIAN,RESISTANCE];
VCOM_SideBasedExecution = [EAST,RESISTANCE];
//Distance AI will respond to call of help from each other
VCOM_Unit_AIWarnDistance = 600;

Can someone help me to find out where I made the mistake?

 

@twakkie:

To make the prisoners respond to orders, I've just removed WEST completely from VCOM_AI SideBasedExecution to make sure it works. 

I will try to see if your tweak works as well if we get vcom_ai running at all.

Share this post


Link to post
Share on other sites

Hi again,

*snip*

 

Dont know what to tell you dude. We never had any problems like that but we were running the mod version of VCOM. Also since we are a closed community we had allowedFilePatching = 2; in the server.cfg. 

The rpt error I have also never seen before.

Share this post


Link to post
Share on other sites

Anyone got a problem when an AI dies they becomes a wall? Cant pick up there items can walk through the bodies.

 

Edit*

 

Found the problem, try every mod with it and its working but with ACE mod the AI becomes a wall when they die cant get past them or through the. Cant tell what part of ace mod is making it happen.

 

Edit 2*

 

Found the problem causing it, It is ACE MEDICAL PBO. I don't know how it happens because i have 0 knowledge in scripting

Share this post


Link to post
Share on other sites

Anyone got a problem when an AI dies they becomes a wall? Cant pick up there items can walk through the bodies.

 

Edit*

 

Found the problem, try every mod with it and its working but with ACE mod the AI becomes a wall when they die cant get past them or through the. Cant tell what part of ace mod is making it happen.

 

Edit 2*

 

Found the problem causing it, It is ACE MEDICAL PBO. I don't know how it happens because i have 0 knowledge in scripting

 

I found the wall issue too and I've never used ACE. After a period of a few minutes the wall goes away though.

I stopped using Vcom because I could not get to Configure in the main menu.

Share this post


Link to post
Share on other sites

I found the wall issue too and I've never used ACE. After a period of a few minutes the wall goes away though.

I stopped using Vcom because I could not get to Configure in the main menu.

I can't stop using it myself because of the AI movement and features is very good. What I did is take the medical pbo of ace to the optionals, now it works fine

Share this post


Link to post
Share on other sites

The player squad AI need to be baby sit, they don't get to cover on there on when in combat mode :(

Share this post


Link to post
Share on other sites

Is it possible that there is any issue with the server .bikey?

I am using the same .bikey on our dedicated and the client, but i get kicked and steam also shows me some mods not loaded/unidentified. Even TFAR, which is working fine.

Share this post


Link to post
Share on other sites

I like your mods! Excellent job! ;)


I hope your own clinic will do well as well as your patients!

Share this post


Link to post
Share on other sites

So I just downloaded this, installed as normal, installed the userconfig folder, started up the mission I'm working on and I get the error message "script userconfig\VCOM_AI\AISettingsV2.sqf not found" yet when I look in said folder, there's the file staring right at me.

 

Anyone know what's going on?

Share this post


Link to post
Share on other sites

So I just downloaded this, installed as normal, installed the userconfig folder, started up the mission I'm working on and I get the error message "script userconfig\VCOM_AI\AISettingsV2.sqf not found" yet when I look in said folder, there's the file staring right at me.

Anyone know what's going on?

There is a script and an addon version. Maybe you mixed them up?
  • Like 1

Share this post


Link to post
Share on other sites

There is a script and an addon version. Maybe you mixed them up?

 

Yep that was it exactly, thanks for that 

Share this post


Link to post
Share on other sites

  Somebody Tell me how to use "call"  for vcomAi. (use server side exec) instead of "execVM"  (clientside exec)   Why would this be difficult? 

Share this post


Link to post
Share on other sites

Is there a way to use this without modifying the server and have everything inside the mission file ?

Share this post


Link to post
Share on other sites

i've noticed that the AI is very blind at night when i walk (sneak) in front of a AI-unit, first reactions 4 or 5 meters near the unit

Share this post


Link to post
Share on other sites

Sorry if this has been answered, I searched through several pages but couldn't find what I was looking for.

 

In regard to the modified difficulty variants on the front page - Do these change the "behaviors" of the AI, or is it tweaking the "skills"? For example, is the "insane" difficulty more accurate, or just more aggressive?

 

I wouldn't mind seeing the AI more aggressively flank, sprint to cover, and suppress the hell out of us. However, I would want to turn down the "aimbot" a bit.

 

I also plan to use this with alive. Could I put down Alive's skills module and make the AI a little less "360 noscope" but maintain all the "duck and cover"?

Share this post


Link to post
Share on other sites

I've noticed some issues in some missions (Combined Arms showcase and the Resist 3rd party mission) with helicopters not wanting to land or move. In Combined Arms the helo you ride in on spots one of the Marids and stops, refusing to move anywhere, and in Resist, in the first mission the helo that comes to get you refuses to land. I'm guessing they noticed a enemy and go into combat mode and then sit and wait. Is there anyway to prevent this?

Share this post


Link to post
Share on other sites

So I've done some testing on this, and it seems like the vehicle behaviors combined with an ALiVE combined arms style mission don't work very well together. Trucks, cars, and APC type units will roll up, then everyone including the driver and gunner will pile out and abandon the vehicle. I can understand the behavior with a truck, but that's just plain unacceptable for an IFV like a Bradley...

 

Tested with latest versions of ALiVE and using RHS factions.

Share this post


Link to post
Share on other sites

Would it be possible to make AI skill settings an optional thing? I dont want VCOM AI to fight ASR AI on that front. I tried hacking up the VCOM AI code in order to remove the AI skill changes, but I couldnt do that right.

 

EDIT: Word of advice: I discovered an issue between AI skills and UAV's and remotely controlled units (like when you use Zeus remote control).

 

UAV and remotely controlled units (at least one in vehicles) are affected by aimingspeed AI skill, to the point if you put a number like 0.005 you can barely move the camera on UAV's.

 

Did quite a lot of testing and its definitely aimingspeed. This is more of an issue with ARMA, but it should be taken into consideration. Maybe some script that sets all AI skill to 1 for the duration of the remote control.

Share this post


Link to post
Share on other sites

Quick update:

 

I am working on optimizing the scripts/mod currently! It's slow because it's tedious and involves a lot of boring framework changes... This is my current progress so far. (I am converting the majority of the scripts/mods into local variables instead of private variables)

//Default Setup stuff here
_VCOM_CHANGEDFORMATION = false; //Converted
_VCOM_MOVINGTOSUPPORT = false; //Converted
_VCOM_GARRISONED = false; //Converted
_VCOM_SubLeader = false; //Converted
_VCOM_GroupLeader = false; //Converted
_VCOM_FLANKING = false; //Converted
_VCOM_MovedRecently = false; //Converted
_VCOM_MovedRecentlyCover = false; //Converted
_VCOM_GRENADETHROWN = false; //Converted

_VCOM_FiredTime = diag_ticktime; //Can't Convert fully
_Unit setvariable [VCOM_FiredTime,_VCOM_FiredTime];
_VCOM_FiredTimeHearing = diag_ticktime; //Can't Convert fully
_Unit setvariable [VCOM_FiredTimeHearing,_VCOM_FiredTimeHearing];

_VCOM_HASDEPLOYED = false; //Converted
_VCOM_HASSTATIC = false; //Converted
_VCOM_DiagLastCheck = diag_ticktime; //Converted
_VCOM_HASSATCHEL = false; //Converted
_VCOM_SATCHELRECENTLY = false; //Converted
_VCOM_CALLEDARTILLERY = false; //Converted
_VCOM_ISARTILLERY = false; //Converted
_VCOM_AssignedEnemy = [0,0,0]; //Converted
_Vcom_MineObject = []; //Converted
_Vcom_MineObjectMagazine = []; //Converted
_VCOM_HasMine = false; //Converted
_VCOM_PlantedMineRecently = false; //Converted
_Unit setVariable ["VCOMAI_ShotsFired",false,true]; //Can't Convert fully
_VCOM_InCover = false; //Converted
_VCOMAI_StaticNearby = false; //Converted
_VCOM_VisuallyCanSee = false; //Converted
_VCOM_HASUAV = false;
_VCOMAI_ActivelyClearing= false;
_VCOMAI_StartedInside = false;
_VCOMAI_LastCStance = (behaviour _Unit); 
_VCOM_Unit_AIWarnDistance = VCOM_Unit_AIWarnDistance;

After this, it will be testing/fixing bugs caused from changing the foundation of the code. After that I hope to implement requested ideas and etc.

 

  • Like 5

Share this post


Link to post
Share on other sites

Just chiming in as someone who almost exclusively uses ALiVE for our small groups missions.

We have to remove VCOM AI from our server unfortunately. The infantry AI is amazing, and we use VCOM driving and that's awesome too.

 

The problem we had was at a random point in the mission (not long after start) all our support helos (which are AI controlled and respond to orders from the ALiVE tablet) would spool up and fly to the edge of the map and hover until they ran out of fuel. 

I tried adding this setVariable ["NOAI",1,false]; to the spawning module which should have turned off VCOM AI for the units but to no avail.

Share this post


Link to post
Share on other sites

I have been running tests of various setups for a few days now, I and I could use some insight into how to make this mod produce noticeable differences:

 

I have enable file patching and altered the difficulty settings from enemies that should be completely inept (all settings 0.1) to unbeatable (all settings 1.0) and with little variance I see the same results over and over.  

 

I also have Eden Enhance installed to offer myself more options, but then I tried unloading it and I am still seeing the same results over and over.

 

Result:  The enemies eventually will shoot me if I stand still long enough, but even with basic evasion and cover they have no chance against me.  

 

I want to believe I am not making this mod function correctly.  Between the default game, Eden Enhanced, and VCOM, how does Arma know which difficulty settings to accept?  How might I prevent any one of those items from clobbering the other?  That is what feels like is going on given I cannot seem to produce AI that change in any noticeable way.  Do I have to set one of the difficulty presets to 1 instead of 0 so it takes effect?

 

I would appreciate some insight if anyone can offer some.

Share this post


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

×