Jump to content
genesis92x

Vcom AI V2.0 - AI Overhaul

Recommended Posts

I just think it does not make sense to give lower rank soldiers less skill in accuracy or endurance.

The only thing where that would make sense is with the commanding skill but i doubt a human player will notice that at all.

Giving each soldier some kind of randomized skill (0.3 + random 0.2) is ok but even with this im sure player will not notice that, its most likely some kind of placebo effect...

What would make sense is to use a Variable for the mission designer to determine if the enemy's are untrained militia/highly trained militia/3rd world regular army/1st world regular army/special forces or something similar and just make all units generally higher or lower skilled.

And Genesis92x, i still dont understand why the script needs to run on clients and server, i think in a mp coop mission all enemy AI's are always local to the server and you can get (and add eventhandler) to players via BIS_fnc_listPlayers for example.

I think that's where he misunderstanding comes from. Enemy AI are not always local to the server. One example is when a player spawns AI using Zeus. Those AI are local to the player and not local to the server. Another example is AI that are in a player's group. The player's computer then controls the thinking part of these AI, not the server. This is the idea behind headless clients, I believe. If you can take all the AI from the server to another computer, it really saves a lot of CPU.

So if the server attempts to control these AI, half of the scripts will not work because the server does not own locality to these units. So the player that owns the AI must execute all the scripts on the AI for them to act in a reasonable manner. This also allows for properly implemented headless clients and etc.

I don't see how BIS_fnc_listPlayers would do any good here because it adds more coding than necessary. The only thing that the players have done to them is having a fired event handler on them and then an occasional check for any AI under their control.

Players do not run ANY scripts for AI not under their control, player's machines simply cache the files necessary to do so, just in case. So really, players never really run any AI scripts in a traditional game.

The old checking loop is the following. It does need to be redone to be more efficient, but it might help.

[] spawn {
if (!(isDedicated)) then {
waitUntil {!isNil "BIS_fnc_init"};
waitUntil {!(isnull (findDisplay 46))};
};

while {true} do {
sleep 0.25;
{
if (local _x) then {
_CheckVariable = _x getVariable "FSMRunning";
if (isNil ("_CheckVariable")) then {_CheckVariable = 0;};
if (!(isplayer _x) && (_CheckVariable == 0)) then {null = [_x] execFSM "AIBEHAVIORNEW.fsm";};
if ((isPlayer _x)  && (_CheckVariable == 0)) then {
player setVariable ["FiredTime", 0];
player setVariable ["PLAYERCOMMANDER", 1];
player addEventHandler ["Fired",{null = [_this] call FiredAtTarget;}];
player setVariable ["FSMRunning",1,true];
};
};
} forEach allUnits;
sleep 5;
};
};

Genesis92x, love that you are working on this again and are looking for input. I've always wanted a script that tries to model the behavior of a unit based on the type of weapon they carry. An FSM for MG, snipers, assault weapons, AT, AA, Medics, Static MG, pistol as primary weapon, etc from the ground up.

The scope upfront will be something like...in most situation,

If a sniper rifle wielding, unit will likely do:

1. If x, y, then z, etc

2. If a, b then c, etc

Etc..

I would think a unit's behavior, depends heavily on what firepower they poses.

So unit use elevation, windows, covers, overwatch, etc all differently based on what heat they are packing?

What do you think?

I like that idea. I have some things like this implemented already as well. Units with explosives will use them to take down buildings if enemy units are being too stubborn to leave and etc. Units with static weapons will deploy and use them and etc.

I plan on having a special sniper FSM that keeps them actually AWAY from the enemy if possible. Instead of charging in. They would have to be in a group of 1-2 max for the effect to occur however.

Share this post


Link to post
Share on other sites

@ Genesis92x

Oh, ok.

I was only thinking about classic coop blue vs. red without friendly ai in the players group... ;)

Anyway, be careful with those eventhandlers. I noticed that the lag started as soon as those went off, there was a noticeable 1sec delay after first enemy contact.

I dont know what exactly caused the performance issues with your scripts but it had something to do with the eventhandlers.

And be extra careful with the "killed" eventhandlers...you had those alarming all ai of the same (enemy) side in warn-distance once the players killed a enemy unit, that made stealth missions impossible.

Share this post


Link to post
Share on other sites

hi Genesis92x, also i found that the AA soldiers doesn't fire AA missiles while they detected the choppers(the vanilla AI will fire AA missiles from long distance ), maybe you missed those soldiers with launchers? :rolleyes:

Edited by benw

Share this post


Link to post
Share on other sites

Hey Genesis92x. Excited to hear about the redesign of this script. Good luck. If you need testers please PM me.

You mentioned this was HC ready a while ago. Is that on hold now? You also mentioned having the script on the DS. Is that the best way to run the script??

Share this post


Link to post
Share on other sites
That is awesome news!

Thanks!

@ Genesis92x

Oh, ok.

I was only thinking about classic coop blue vs. red without friendly ai in the players group... ;)

Anyway, be careful with those eventhandlers. I noticed that the lag started as soon as those went off, there was a noticeable 1sec delay after first enemy contact.

I dont know what exactly caused the performance issues with your scripts but it had something to do with the eventhandlers.

And be extra careful with the "killed" eventhandlers...you had those alarming all ai of the same (enemy) side in warn-distance once the players killed a enemy unit, that made stealth missions impossible.

Yeah, I agree fully. The new scripts should be much more optimized! At least, that's the hope. The warning distance will also be changed a little bit as well. I have to find a happy solution for stealth missions...

hi Genesis92x, also i found that the AA soldiers doesn't fire AA missiles while they detected the choppers(the vanilla AI will fire AA missiles from long distance ), maybe you missed those soldiers with launchers? :rolleyes:

This is an interesting behavior...I will have to look into this

Hey Genesis92x. Excited to hear about the redesign of this script. Good luck. If you need testers please PM me.

You mentioned this was HC ready a while ago. Is that on hold now? You also mentioned having the script on the DS. Is that the best way to run the script??

Yeah! I am about to enter the testing stage soon. I will PM you then.

Headless client's should work just fine with the upcoming version, and the scripts/addons will work for any environment as well. (DS, LS, etc). I would recommend a DS for best performance.

Progress1.jpg

Edited by Genesis92x

Share this post


Link to post
Share on other sites

ok. I am toying with ALiVE again since the update and wonder if this script in current state does fine or fine its broken with ALiVE? I know others have used this with ALiVE so does it still work ok?

Share this post


Link to post
Share on other sites

I would like to know about Alive support too?

Are we any close to a release?

Share this post


Link to post
Share on other sites
ok. I am toying with ALiVE again since the update and wonder if this script in current state does fine or fine its broken with ALiVE? I know others have used this with ALiVE so does it still work ok?

According to other users this works with ALIVE pretty well. I think some of the functions in VcomAI are currently busted due to the update. (They cause more lag than is needed and etc).

I would like to know about Alive support too?

Are we any close to a release?

Should work with Alive! However, can't validate that with Alive & and the last A3 patch.

We are close to a basic release, quick update:

Sorry about the audio being too loud in the beginning. First video in awhile :< Headset users, you have been warned.

Edited by Genesis92x

Share this post


Link to post
Share on other sites

Thanks Genesis92x. You da man. Cant wait for the release until then I will use the most recent version. Thanks. Cant wait to have the AI waste my friends. They wont know what to do!:)

Share this post


Link to post
Share on other sites

Progress.jpg

Current Task: Optimization

Most of the AI pathing issues have been resolved and the AI are acting much smarter now. I just need to work out a few minor bugs and put a little more polish on...Another update soon.

If you want a test version for any reason, PM me.

Share this post


Link to post
Share on other sites

Hey guys, sorry for the delay! I hope everything is going well for everyone :> Here's just a quick video update I threw together today (was a little sick of just coding).

Everything is getting very close!

Share this post


Link to post
Share on other sites

Amazingn how much work and effort goes into this man. Appreciate all the work you have been doing! Submit it for MANW!

Share this post


Link to post
Share on other sites
Amazingn how much work and effort goes into this man. Appreciate all the work you have been doing! Submit it for MANW!

Thank you!

Like always, I really appreciate the time you guys put into just posting on the forums haha.

great. Thanks for update.

Thank you for posting!

Cool video :)

Thanks! It's pretty silly...but I need a reason to use my aging Adobe Premiere Pro from time to time... :p

Share this post


Link to post
Share on other sites
I think that's where he misunderstanding comes from. Enemy AI are not always local to the server. One example is when a player spawns AI using Zeus. Those AI are local to the player and not local to the server. Another example is AI that are in a player's group. The player's computer then controls the thinking part of these AI, not the server. This is the idea behind headless clients, I believe. If you can take all the AI from the server to another computer, it really saves a lot of CPU.

So if the server attempts to control these AI, half of the scripts will not work because the server does not own locality to these units. So the player that owns the AI must execute all the scripts on the AI for them to act in a reasonable manner. This also allows for properly implemented headless clients and etc.

I have a group of friends that prefer using Zeus/MCC on my dedicated server. Does this mean they will need Vcom installed on their systems to control AI they spawn?

Share this post


Link to post
Share on other sites
I have a group of friends that prefer using Zeus/MCC on my dedicated server. Does this mean they will need Vcom installed on their systems to control AI they spawn?

If you are using the addon, your friends will only need Vcom if they want the AI they spawn to have the VcomAI scripts applied to them. This will be true with the next version as well.

If you insert the script version into the mission, your friends will not need anything at all

Share this post


Link to post
Share on other sites

To confirm, as we are about to use this in our weekly operation, I have put the stuff in the mission. It will functional properly with zeus and other maps correct?

And if there is stuff on the map without waypoints or anything in init, they will still utilize the ai scripts if friendlies are attacked or they are attacked?

Share this post


Link to post
Share on other sites
To confirm, as we are about to use this in our weekly operation, I have put the stuff in the mission. It will functional properly with zeus and other maps correct?

And if there is stuff on the map without waypoints or anything in init, they will still utilize the ai scripts if friendlies are attacked or they are attacked?

This will function properly with Zeus and any map! And yes, if you turn up the warning distance (in the INIT.sqf) they AI will respond to any group being attacked in that range.

Share this post


Link to post
Share on other sites

Thank you for the great AI MOD!

However, this is MOD will conduct how unintended movement of the mission creator any AI.

Why not get it to modularize this wonderful MOD please. Thank you very much in advance.

Share this post


Link to post
Share on other sites

hi love this script keep getting error has mine im using caf_ag and audio patch on sangin_public_a3 using EOS script any advice how to fix

my eos unit pool

};
// insurgents
if (_faction==5) then {
_InfPool=	["CAF_AG_ME_T_AK47","CAF_AG_ME_T_AK74","CAF_AG_ME_T_GL","CAF_AG_ME_T_PKM","CAF_AG_ME_T_RPG","CAF_AG_ME_T_RPK74","CAF_AG_ME_T_SVD"];	
_ArmPool=	["O_APC_Tracked_02_AA_F","O_APC_Tracked_02_cannon_F","O_APC_Wheeled_02_rcws_F","O_MBT_02_arty_F","O_MBT_02_cannon_F"];
_MotPool=	["CAF_AG_ME_T_van_01","CAF_AG_ME_T_Offroad","CAF_AG_ME_T_Offroad_armed_01"];
_ACHPool=	["O_Heli_Attack_02_black_F","O_Heli_Attack_02_F"];
_CHPool=	["O_Heli_Light_02_F"];
_uavPool=	[];
_stPool=	["O_Mortar_01_F","O_HMG_01_high_F","O_static_AT_F","O_static_AA_F"];
_shipPool=	[];
_diverPool=	[];
_crewPool=	["CAF_AG_ME_T_AK47"];
_heliCrew=	["CAF_AG_ME_T_RPG","CAF_AG_ME_T_GL"];
};

thanks alot

Edited by Blitzer134

Share this post


Link to post
Share on other sites

Hey all,

Here is a release of my newer version of Vcom AI.

To be honest you won't see any major differences besides the AI tend to stick together a lot better now. I re-did all the background scripts and design so I have much more control over every unit of an AI group.

I tried to optimize the heavy-hitter scripts/functions and even implemented checks for low FPS so that certain non-essential scripts will simply skip if FPS gets too low.

These scripts will still drain a server more than just default AI - so beware of that. I had a 8 group on 8 groups battle (192 AI) and the FPS dropped down to 25-30with all the smoke and etc.

Addon Link V 1.09

Script Link V 1.09

Changelog

-Reconstructed the scripts completely. I know have a much better system that allows for easier changes to individual AI.

-AI units no longer try to control their leader.

-Fixed the scripts executing on players sometimes

-AI personality framework is beginning now. AI can get "Surprised" when ambushed. An AI with low control/low rank may accidently discharge their weapon and etc.

-New cover system. AI will now consider slopes as cover if possible

-New debug system to allow easier bug fixing

-Much more that I'm too tired to remember

Share this post


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

×