Jump to content
nkenny

LAMBS Improved Danger.fsm

Recommended Posts

Hi and thank You for improving the boring AI! Together with LOGIC FSM this mod has a lot of potential
Couple of questions.
How can these FSM mods be compatible? Is the FSM somehow merged or what happens there

No CBA/userconfig settings yet?
The AI detect the shooter instantly (knowsabout 4) when firing a supressed weapon from 600m 

Share this post


Link to post
Share on other sites

@b0s
Thanks man. To answer your questions:  
1. The LOGIC FSM mod doesn't alter the danger.fsm like mine does. Much like VCOM, it instead it adds an extra FSM layer on top.  It does this in a pretty neat and compact fashion too. 
2. Coming in version 2.0.0
3. Now this is closer to what I can answer.  I suggest checking my long range shooting clip on YouTube for more detail. The shortest answer to this is: AI do not detect you instantly! There are many variables.  Some weapons, even when suppressed are simply louder than others. Shooting multiple rounds also makes it considerably easier for the AI to home in on your location. Shooting a perfect headshot will also keep the AI completely unaware of your location.  Finally, the danger.fsm attempts to mitigate the general effect by introducing a surprise reaction phase to the AI.  When this triggers, the AI seeks cover and attempts to go to ground (instead of shooting). 

-k 

Share this post


Link to post
Share on other sites

There are new releases for LAMBS_RPG and LAMBS_Turret and LAMBS_Danger.fsmCheck the relevant steam page for the changelogs for the first two. 

LAMBS Danger.fsm
New release: Current version 1.4.3 *HOTFIX*

Change notes

- Added increased CQC aggression and use of suppression for machine guns
- Added Wheeled APCs to 'armoured vehicle' AI
- Added configurable parameters for share information ranges*
- Added Unique reaction to nearby explosions**
- Fixed bugs related to AI artillery (Virtual and actual) 
- Fixed Players will no longer play gestures
- Tweaked Investigate dead body ranges
- Improved WP text descriptions 
- Minor WP tweaks (generally increased default ranges)
- Misc. Performance tweaks

*This tweaks introduces configurable Share information radio ranges. This feature will be handled by CBA user interface in the next full version. Variable names may change for version 2.0

** @Jester504

Relevant variables are: 
lambs_danger_radio_shout = 50; 
lambs_danger_radio_WEST = 1000; 
lambs_danger_radio_EAST = 1000; 
lambs_danger_radio_GUER = 1000; 
lambs_danger_radio_backpack = 2000; 

Range is modified by height above sea level. (Higher means longer comms). Shout and backpack variables are universal. Backpack is added to default range. When a share information check is called the group leader will check all team members. He will pick the best suitable unit to share information: 

A unit qualifies as wearing a backpack if: 
- The unit has the variable "dangerRadio" is set to TRUE (i.e., <this> setVariable ["dangerRadio",true];)
- The unit is wearing any vanilla radio backpack
- The unit is seated aboard a vehicle
- The unit is wearing any TFAR configured backpack. 

The configurable radio ranges make it easy to set up a variety of scenarios. For mission makers that want instantly broadcast information about enemy forces-- simply set Shout range to something extreme. The system will be hooked into the dynamic artillery system in version 2.0. Together with CBA eventHandlers this system can easily accommodate unique scripting. More on that when 2.0 releases. 

Cheers, 
nkenny

 

--- 

Steam Workshop 

---

 

---

~ Here is a closer look at AI reactions and grenade and some under the hood commentary about 1.4.3 and the upcoming 2.0.0

 

 

  • Like 6
  • Thanks 4

Share this post


Link to post
Share on other sites

As promised the taskRush, taskCreep and taskHunt scripts have been released standalone. Just follow this link.   TaskCQB is in the same repository, but will get closer look at a later date. 

-k 

  • Thanks 1

Share this post


Link to post
Share on other sites

@nkenny

Here is the video. Mods used were. 3CB forces, Achilles, C2, 3den, AIS, LAMBS Danger & RPG. All Latest Versions. As you can see the AI spam Negative continuously. And take a long time to regroup despite putting them to aware. I feel as if as soon as they're told to regroup they should snap out of combat mode and regroup

 

Share this post


Link to post
Share on other sites

Cool stuff.  Look forward to using this in the future.

Share this post


Link to post
Share on other sites
1 hour ago, Unleashthepain said:

@nkenny

Here is the video. Mods used were. 3CB forces, Achilles, C2, 3den, AIS, LAMBS Danger & RPG. All Latest Versions. As you can see the AI spam Negative continuously. And take a long time to regroup despite putting them to aware. I feel as if as soon as they're told to regroup they should snap out of combat mode and regroup

 

Does that happen without C2 mod?

Share this post


Link to post
Share on other sites

Yeah Ive seen that alot with my own AI force Suppression scripts. They tend to just wanna say "No" sometimes when they dont have a clear shot rather than maybe take a couple steps to their right/left to get a clear Line Of Sight. Certain Pathfinding issues can give that same sort of spam feedback. Its the price of trying to force AI to do something somewhat autonomous it seems at this point anyways

Share this post


Link to post
Share on other sites
11 hours ago, Unleashthepain said:

Yes

After reviewing the thread the op did say this mod is made for coop mode.  So I'd go forward with that intent.  Also, do you need to hear the ai response?  I guess when I made missions the first thing I did was turn there responses to silent.  But that's me.

  • Like 1

Share this post


Link to post
Share on other sites
14 hours ago, Unleashthepain said:

@nkenny

Here is the video. Mods used were. 3CB forces, Achilles, C2, 3den, AIS, LAMBS Danger & RPG. All Latest Versions. As you can see the AI spam Negative continuously. And take a long time to regroup despite putting them to aware. I feel as if as soon as they're told to regroup they should snap out of combat mode and regroup

 

 

This negative spam persists amongst all AI groups regardless of whether their part of the player squad or not. 

 

For me personally, I just use the variable that nKenny helpfully provided to disable danger.fsm solely in my squad so that I can control them how I like. That way I can both have full control of my teammates, and have the added benefit of having an enemy AI that is generally more dangerous and varied than before.

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

is it possible to add an option to disable danger.fsm for players group via CBA or something, im also using that script... frequently 

Share this post


Link to post
Share on other sites

Planned for version 2.0. I do generally agree. This mod was not aimed at the single player experience. We will however endeavour to create a seamlessly improved experience. 🙂

  • Like 2
  • Thanks 2

Share this post


Link to post
Share on other sites
2 hours ago, nkenny said:

This mod was not aimed at the single player experience

oh I was using this in co-op as well. Same thing was happening if we had any AI in our squad. Do look forward to the updates as I thoroughly enjoy the mod. 

  • Like 1

Share this post


Link to post
Share on other sites

Dont know if doable but a 'Qualifier' key for Squad Stay Tight/Loose which could turn On/Off the danger.fsm would be great. Personally i really like seeing them independent but obviously there are times you just needs your guys to move. Having AI is like being a parent all over again

  • Like 2
  • Haha 1

Share this post


Link to post
Share on other sites

Your work is impressive! I mostly do SP and script my own missions. ive done a lot of patching trying to make AI more dynamic and smart, like making AI fire rocket at AIR and infantry, raising max ai skill values...always ended up with AI aimbots who insist to act like an idiot in combat.

This mod is exactly what i wanted. It dramatically revitalises gameplay.

While some may be bothered by how the modded AI teammates are irresponsive to orders, I am more than excited to see my AI teammates actually act like they want to survive. One big suprise is to see that AIs sometimes roll when firing in prone position. Nice touch!

Its a shame though i once experienced huge performance loss when 50+ AI try to pathfind their way into buildings near my position. Arma 3 AI just dont like buildings. I ended up having to tweak one of the mod functions to always empty the array of searchable _houses. Hope you dont mind!

Really appreciate how neatly your fsm and functions are packed in the mod, and, above all, how much you are willing to elaborate in detail your mod and your insights here.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
11 hours ago, froggyluv said:

Dont know if doable but a 'Qualifier' key for Squad Stay Tight/Loose which could turn On/Off the danger.fsm would be great. Personally i really like seeing them independent but obviously there are times you just needs your guys to move. Having AI is like being a parent all over again

i am already thinking of making a radio trigger to toggle on/off the danger.fsm for this purpose actually.

  • Like 1

Share this post


Link to post
Share on other sites

CBA configurable key is already implemented in 2.0 🙂

 

-k 

  • Thanks 1

Share this post


Link to post
Share on other sites
On 10/9/2019 at 10:51 AM, nkenny said:

------



~ Here is a closer look at AI reactions and grenade and some under the hood commentary about 1.4.3 and the upcoming 2.0.0

 

Love your work man.  For AI controlled groups, maybe adding some chatter would be good.  In your video, you show the AI initial reaction to contact is to retreat first.  If he had team mates, the leader could say "move back".  During grenade reactions, if they sense grenade (thrower to the front  of their position?) they could shout "incoming grenade".  After getting hit with a grenade they can swear or grunt in pain.

 

In my CQB AI script I'm working on, I have a function you can call that uses the unit's in-game voice (i.e., english, french, persian, etc.) to say the voice files.  Here's the function if you want to use it:

 

Spoiler

//JBOY_StackSpeak.sqf
// [player, "Halt"] call JBOY_StackSpeak;
if (!isServer)  exitwith {};
params["_unit","_soundFileName"];
if (isNull _unit or !alive _unit) exitWith {};
// If only one guy in stack, then don't say anything.
//if (count ((_unit getVariable "JBOY_stack") getVariable "JBOY_stackMembers") <= 1 and !isPlayer _unit) exitWith {};

if (_soundFileName == "Grunt") then
{
	[_unit] call JBOY_PainGrunt;  // Randomly play 1 of a 100 pain grunts, and exit this script
} else
{
	_speaker = "";
	if (isNull _unit) exitwith {};
	_speaker = speaker _unit;
	//if (isNil _speaker) exitWith{};
	_behaviour = behaviour _unit;
	if (["CARELESS","AWARE"] find _behaviour >= 0) then {_behaviour = "NORMAL";}; // No sound file path exists for "CARELESS","AWARE"
	//_behaviour = "STEALTH";
	_s = format["JBOY_StackSpeak: No match found for _soundFileName %1",_soundFileName];

	_lastSubDir = "100_Commands"; // most stack related commands are in this subdirectory
	switch (true) do 
	{ 	
		case (_soundFileName find "Sitrep" >= 0):{_lastSubDir = "120_Com_Ask"; };
		case (_soundFileName find "Confirmation" >= 0):{_lastSubDir = "130_Com_Reply"; };
		case (_soundFileName find "OnTheWay_1" >= 0):{_lastSubDir = "130_Com_Reply"; };
		case (_soundFileName find "Engage" >= 0):{_lastSubDir = "015_Targeting"; };
		case (_soundFileName find "Attack" >= 0):{_lastSubDir = "015_Targeting"; };
		case (_soundFileName find "CancelTarget" >= 0):{_lastSubDir = "015_Targeting"; };
		case (_soundFileName find "moveUp" >= 0):{_lastSubDir = "070_MoveDirectionRelative1"; };
		case (_soundFileName find "moveBack" >= 0):{_lastSubDir = "070_MoveDirectionRelative1"; };
		case (_soundFileName find "Team" >= 0):{_lastSubDir = "030_Teams"; }; // redTeam, blueTeam, greenTeam, yellowTeam, whiteTeam
		case (_soundFileName find "TakingCommand" >= 0):{_lastSubDir = "110_Com_Announce"; _behaviour = "Normal";};
		case (_soundFileName find "AwaitingOrders" >= 0):{_lastSubDir = "110_Com_Announce"; _behaviour = "Normal";};
		case (_soundFileName find "ReadyForOrders" >= 0):{_lastSubDir = "110_Com_Announce"; _behaviour = "Normal";};	
		case (_soundFileName find "Throwing" >= 0):{_lastSubDir = "200_CombatShouts"; _behaviour = "COMBAT";};
		case (_soundFileName find "IncomingGren" >= 0):{_lastSubDir = "200_CombatShouts"; _behaviour = "COMBAT";};
		case (_soundFileName find "Reloading" >= 0):{_lastSubDir = "200_CombatShouts"; _behaviour = "COMBAT";};
		case (_soundFileName find "Cheering" >= 0):{_lastSubDir = "200_CombatShouts"; _behaviour = "COMBAT";};
		case (_soundFileName find "Endangered" >= 0):{_lastSubDir = "200_CombatShouts"; _behaviour = "COMBAT";};
		case (_soundFileName find "SetCharge" >= 0):{ _behaviour = "Stealth";};
		case (_soundFileName find "DetonateCharge" >= 0):{ _behaviour = "Stealth";};
		case (_soundFileName find "ThrowingGrenadeE_1" >= 0):{ _behaviour = "Stealth";}; // Fire in the hole!
		case (_soundFileName find "OpenThatDoor" >= 0):{ _behaviour = "Stealth";}; // 
		//case (_soundFileName find "SetCharge" >= 0):{_lastSubDir = "015_Targeting"; };
	};
	switch (alive _unit) do 
	{ 	
		// hardcoded sounds for certain languages and sounds
		case (_speaker find "eng" >= 0 and _soundFileName == 'Clear'): {_s = "a3\dubbing_f_bootcamp\boot_m04\85_All_Clear\boot_m04_85_all_clear_LAC_0.ogg";};
		// sounds per language
		case (_speaker find "pervr" >= 0): {_s = "A3\Dubbing_Radio_F\data\VR\"+_speaker+"\RadioProtocolPER\"+_behaviour+"\"+_lastSubDir+"\" + _soundFileName + ".ogg";};
		case (_speaker find "grevr" >= 0): {_s = "A3\Dubbing_Radio_F\data\VR\"+_speaker+"\RadioProtocolGRE\"+_behaviour+"\"+_lastSubDir+"\" + _soundFileName + ".ogg";};
		case (_speaker find "engvr" >= 0): {_s = "A3\Dubbing_Radio_F\data\VR\"+_speaker+"\RadioProtocolENG\"+_behaviour+"\"+_lastSubDir+"\" + _soundFileName + ".ogg";};
		case (_speaker find "engb" >= 0): {_s = "A3\Dubbing_Radio_F\data\ENGB\"+_speaker+"\RadioProtocolENG\"+_behaviour+"\"+_lastSubDir+"\" + _soundFileName + ".ogg";};
		case (_speaker find "engfre" >= 0): {_s = "A3\Dubbing_Radio_F_EXP\data\ENGFRE\"+_speaker+"\RadioProtocolENG\"+_behaviour+"\"+_lastSubDir+"\" + _soundFileName + ".ogg";};
		case (_speaker find "eng" >= 0): {_s = "A3\Dubbing_Radio_F\data\ENG\"+_speaker+"\RadioProtocolENG\"+_behaviour+"\"+_lastSubDir+"\" + _soundFileName + ".ogg";};
		case (_speaker find "gre" >= 0): {_s = "A3\Dubbing_Radio_F\data\GRE\"+_speaker+"\RadioProtocolGRE\"+_behaviour+"\"+_lastSubDir+"\" + _soundFileName + ".ogg";};
		case (_speaker find "per" >= 0): {_s = "A3\Dubbing_Radio_F\data\PER\"+_speaker+"\RadioProtocolPER\"+_behaviour+"\"+_lastSubDir+"\" + _soundFileName + ".ogg";};
		case (_speaker find "fre" >= 0): {_s = "A3\Dubbing_Radio_F_EXP\data\FRE\"+_speaker+"\RadioProtocolFRE\"+_behaviour+"\"+_lastSubDir+"\" + _soundFileName + ".ogg";};
		case (_speaker find "chi" >= 0): {_s = "A3\Dubbing_Radio_F_EXP\data\CHI\"+_speaker+"\RadioProtocolCHI\"+_behaviour+"\"+_lastSubDir+"\" + _soundFileName + ".ogg";};
	};
		//diag_log _s;
	//player sidechat _s;
	diag_log ["JOY_StackSpeak",_unit,_soundFileName,_s];
	//copyToClipboard _s;
	//player sidechat _speaker;
	if (!isNull _unit and alive _unit) then
	{
		playSound3D [_s, _unit];
		//[_s, _unit] remoteExec ["playSound3D",-2];
	};
};

Here's some sample calls you might want to use in different AI situations;

Spoiler


[_unit, selectRandom ["IncomingGrenadeE_1","IncomingGrenadeE_2","IncomingGrenadeE_3","TakeCover"]] call JBOY_StackSpeak; // if ai spots incoming grenade
[_unit,selectRandom ["EndangeredE_1","EndangeredE_2","EndangeredE_3","Grunt","Grunt","Grunt"]] call JBOY_StackSpeak; // react after grenade explodes
[_unit,selectRandom ["moveUp_1","moveUp_2","advance"]] call JBOY_StackSpeak;
[player,selectRandom ["moveBack_1","moveBack_2"]] call JBOY_StackSpeak; [_leader, selectRandom ["FormOnMe","RallyUp"]] call JBOY_StackSpeak;
[_unit, selectRandom ["AwaitingOrders","ReadyForOrders"]] call JBOY_StackSpeak;
[player,selectRandom ["CombatOpenFire_4","Attack_1"]] call JBOY_StackSpeak;
[_unit,selectRandom ["Stop","Halt"]] call JBOY_StackSpeak;
[_unit, selectRandom ["GoProne_1","GoProne_2","TakeCover"]] call JBOY_StackSpeak;
[selectRandom _stackMembers,selectRandom ["CheeringE_1","CheeringE_2","CheeringE_3"]] call JBOY_StackSpeak;

 

The function also calls my "grunt in pain" function, which you are welcome to use also.

 

  • Like 5

Share this post


Link to post
Share on other sites

Hi,

I am still having issues with LAMBS interfering with the orders to my AI squad mates. Perhaps one solution would be that only Combat and Silent mode trigger LAMBS. This would allow to issue precise orders if they are in Aware mode. Many mods like C2 give you the option to set the state for your squad. 
 

Otherwise love the mod. Would be awesome if this could be implemented. 

  • Like 1

Share this post


Link to post
Share on other sites

@johnnyboy
Thank you! That is a wonderful resource. I have been looking with horror at navigating the web of AI comms line; these functions solve nearly all of my worries. I will definitely be looking at an implementation of on the next development cycle. 

 

@rainbow47

Version 2.0 comes with a few more controls to toggle the danger.fsm.  Only running it while combat-mode is available is frankly an enlightened take on it. I will experiment a little to see if that solution integrates seamlessly. 

  • Like 1

Share this post


Link to post
Share on other sites

I didnt have issue with player controlled AI and Lamb, don't orientate Nkenny in a false direction please, you just have no idea on how work the vanilla AI.

The AI always stay in combat mode if there a known enemy or 1 minutes after ending combat if there not other spotted enemy in the area, its a vanilla behavior so nothing related to Lamb.

 

If the AI say negative in a firefight its just because they can't suppress, mostly because they didn't have a clean shot.

So they spam negative because Lamb force the AI to use the vanilla suppressive fire when an enemy is spotted and has a right range of fire, so there is always few men in the squad that will say negative because they didn't had a clean shot all the time.

 

"Negative" has nothing to do with the fact that they don’t want to follow you or execute orders.

Share this post


Link to post
Share on other sites
On 10/9/2019 at 5:24 PM, Unleashthepain said:

As you can see the AI spam Negative continuously.

 

On 10/9/2019 at 7:30 PM, froggyluv said:

They tend to just wanna say "No" sometimes when they dont have a clear shot

You can cure the "Negative"/"No can do" spam by temporarily disabling speaker. 

Replace code like this:

p1 doSuppressiveFire t2;

With this spawned code:

_nul= [p1,t2] spawn  
{ 
 params["_shooter","_target"]; 
 _speaker = speaker _shooter; 
 _shooter setSpeaker "NoVoice"; 
 _shooter doSuppressiveFire _target; 
 sleep 1; 
 _shooter setSpeaker _speaker; 
};

I just tested this and it works for me!  Hope that helps.

  • Like 1

Share this post


Link to post
Share on other sites
On 10/9/2019 at 7:30 PM, froggyluv said:

They tend to just wanna say "No" sometimes when they dont have a clear shot rather than maybe take a couple steps to their right/left to get a clear Line Of Sight.

Also note that if you want to test if unit is refusing to suppress, use the currentCommand command after doSuppressiveFire.  If unit successfully did some suppressive fire, then currentCommand returns "suppress" for some time.  If unit did not successfully do suppressive fire, then currentCommand returns "".  Maybe this can be tested to determine if unit should move to a better shooting position?

  • Thanks 1

Share this post


Link to post
Share on other sites

Nice thinking JohnnyRingo on the NoVoice during suppression. currentCommand looks really useful tho only for an indicator as far as my limited talents will go as id have no idea how to help an AI better determine a more suitable firing zone. ill leave that to you and the big dawgs like MadRUsskies and Leopard, nkenny -

 

Ill be yah hucklberries..

  • Like 1

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

×