Jump to content

Recommended Posts

Alpha 2.0 Released:  Updated demo mission link at top post.  Change log:

  • Added Phronk's flashbangs.
  • Added player control of teams to execute building paths (including synchronized multiple team entry).
  • Fixed bugs and many small improvements.

Here's a video explaining how to create paths. 

Advice when creating paths:

  • See the written instruction in top post.  And download the demo mission and follow these instructions and follow the video.
  • Open doors and stand just outside door when creating a position.   This guarantees position close enough to door that path execution code will tell AI to open the door.
  • Make sure each position has line of sight to next position.  That is the path the AI will walk, and you want to guarantee they don't ghost through a wall to get from point A to point B.
  • Once a path is working well, put in some enemy and watch the fun!

 

  • Like 5
  • Thanks 1

Share this post


Link to post
Share on other sites

Any tips on getting your AI to quickly orient themselves into the direction you want once they cross a door threshold? Its hard getting the Room Clearers their proper advantage when they enter a room with a recently gasses/flashbanged enemy when they just wont orient on the enemy before the enemy regains their senses and kills the intruders. Ive tried huge disparity in  subSkills (like .0001 vs .9) but even then not so much luck.

Share this post


Link to post
Share on other sites
6 minutes ago, froggyluv said:

Any tips on getting your AI to quickly orient themselves into the direction you want once they cross a door threshold?

Thanks for trying it.  I think I added code to reveal guys in a room before lead breacher enters the room to counter this, but they still suck.  Try putting the first inside room position not far from the breacher's door position.  They can't shoot while moving,, but can shoot at each position they stop at.  So the sooner they stop in the room, the sooner they can shoot.  You can also add "arcLeft" and "arcRight" to _special parameter for positions.  This will be used by the first 2 followers to orient left or right 45 degrees.  It makes sense to arcLeft if there is a wall to the right, and open to the left. Without arcRight or arcLeft specified, the default is #2 looks 45 left, and #3 looks 45 right.  4th guy watches your six.

 

I'm going to try and improve how fast they enter after bang or breach .    I've also set the entry team's skill to the max.  And the breach and bang code, have a slow skill recovery even after their initial stunned animation is over (Beno's cool idea).  So when breaching charge or bang hits them their skill goes to zero along with stun animation.  Then after they recover from stun animation, their original skill comes back after a delay.

 

Any and all suggestions welcomed.  Note that single unit seems to go faster and is deadlier when not burdened with his team.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

@froggyluv: You can also shave a second off of entry time by setting the 5th parameter in the position array to zero (it was defaulted to 1 second).  You want to do that on the row immediately after the row flagged as "door".  Example:

_path2 = 
[
[[2878.39,6000.53,0.00143647],[""],"amovpercmtacsraswrfldf",117.957,"UP",1,false,2],
[[2881.39,5998.85,0.261654],["door","","benobreach","","waitForOrder"],"amovpercmtacsraswrfldf",114.774,"UP",1,false,2], // entry door
[[2885.87,5995.64,0.235818],["arcLeft"],"amovpercmtacsraswrfldf",7.70691,"UP",0,false,2], // 5th parameter set to zero second wait

 

  • Like 1

Share this post


Link to post
Share on other sites

Interesting ill try shaving that second off. Definitely adding the extra arrow right after the entry one seems to have helped gain advantage in the door entry. Its pretty fun just playing around with it -sometimes you can really see the future of an Arma Swat4 blend,  other times the Arma engine punches you in the brain for even having the gall to think that.

 

Right now im tryna figue out how to give an AI Entry team advantage when taking the stairs against camping enemy AI (2nd story) -it seems if you're able to get the exact height (stepwise)  of line of sight to enemy AND give a Reveal command they have somewhat of a fair shot. Having fun with it anywise 😄

  • Like 1

Share this post


Link to post
Share on other sites
33 minutes ago, froggyluv said:

Right now im tryna figue out how to give an AI Entry team advantage when taking the stairs against camping AI -it seems if you're able to get the exact height (stepwise)  of line of sight to enemy AND give a Reveal command they have somewhat of a fair shot. Having fun with it anywise 😄

Right on, glad you're having fun with it.  I get stoked when I seem them ruthlessly take a room down, pissed when they bang themselves (wish I had that talent) and tard out.

 

Regarding stairs, put a "flash" or "grenade" marked move-point on the staircase before their head would clear the floor (in UP stance).  That has worked well for me.  They toss the nade/flash, crouch, then come up to clear.

 

33 minutes ago, froggyluv said:

how to give an AI Entry team advantage when taking the stairs against camping AI

I can try that on "stairs" marked positions, where I find near enemies and reveal them.  It will still be true that they can't fire until they reach next position.  Although I do stop them if they take fire damage mid-run, and they can then defend themselves.

 

Per your feedback, I double checked that I am revealing AI in room prior to entry after flash or breaching charge, and it was true for breach but not flash.  So I just added that to the flash code.  And I extended the low-skill recovery post flash by 5 seconds.  And I trimmed a few unneeded sleep seconds that delayed entry post breach entry.   So I've hopefully improved this some. 

 

The only other thing I can think of is to force immediate entry post-breach/bang without going through the entire big movement loop again.  (the movement loop has to get next position, turn unit toward position, check for near enemies he can see before moving and wait a bit allowing him to engage them, do any special action (open door/breach/bang/nade/hang BA),  move to next position).  So I'll try that.

  • Like 2

Share this post


Link to post
Share on other sites
On 6/23/2019 at 10:49 PM, zagor64bz said:

PS: something went through my mind.....how difficult will be to get a "stack SIDE" and/or "stack FRONT" option work? Sometimes a bad guy is just behind the entry door pointing out his weapon, and if AI opens for flashbang (thank you and phronk for that, BTW) it gets blasted...

Hey buddy.  That is really hard actually.  Its difficult to get that level of control over these whacky ai dudes.

  • Like 1

Share this post


Link to post
Share on other sites
8 hours ago, johnnyboy said:

Its difficult to get that level of control over these whacky ai dudes.

Yap..on a second thought, I figure that out...

...geez...it's already difficult having them WALK correctly where you want....go figure stacking them correctly. Thanks for the response, tho.

Share this post


Link to post
Share on other sites
12 hours ago, johnnyboy said:

Hey buddy.  That is really hard actually.  Its difficult to get that level of control over these whacky ai dudes.

you could use buildingexit to find all the door to breach. 

_eh = nearestObjects [player, ["house"], 20];
_he = _eh select 0 buildingExit 0;
arrow = "Sign_Arrow_F" createVehicle _he;

use this in the debug console to find the doors

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
3 hours ago, sabot10.5mm said:

you could use buildingexit to find all the door to breach. 


_eh = nearestObjects [player, ["house"], 20];
_he = _eh select 0 buildingExit 0;
arrow = "Sign_Arrow_F" createVehicle _he;

use this in the debug console to find the doors

better yet 

_eh = nearestObjects [player, ["house"], 200];  
{{arrow = "Sign_Arrow_F" createVehicle [0,0,0];  arrow setPos _x}foreach  (_x buildingPos -1);  
_he = _x buildingExit 0;  arrow = "Sign_Arrow_F" createVehicle _he;  } foreach _eh;

 

Share this post


Link to post
Share on other sites
18 minutes ago, sabot10.5mm said:

better yet 


_eh = nearestObjects [player, ["house"], 200];  
{{arrow = "Sign_Arrow_F" createVehicle [0,0,0];  arrow setPos _x}foreach  (_x buildingPos -1);  
_he = _x buildingExit 0;  arrow = "Sign_Arrow_F" createVehicle _he;  } foreach _eh;

 

Thanks man.  Love your avatar btw.  I have a picture of Bill wearing a Wutang Clan hat in my office!  🙂

  • Thanks 1
  • Haha 1

Share this post


Link to post
Share on other sites

In my quick tests, the buildingExit command returns several exterior positions stacked up. Does not reliably find doors. My way of finding doors is by filtering through the selectionNames that match "door_" and collect those, then find their positions through magic. The problem is that the position of the doors is different for each door and depends on the door LOD you're looking for. In my code, the door position is actually by where the door knob would be if the door is open (regardless if the door is open/closed) or it's slightly inside the door frame either to the left or right. It does not return the central position of the door.

 

WIP function I made for my breaching charge script.

_B = Building (object)

_C = Charge (object)

Example: [ building1, player] call CRS_findDoor;

 

Spoiler

CRS_findDoor = {

params["_b","_c"];private["_d","_dPos","_door"];
_d=selectionNames _b;
_d=_d select{["door",_x,false]call BIS_fnc_inString};

_dPos=[];
{_dPos pushBack(_b modelToWorld(_b selectionPosition _x));}forEach _d;
if(count _dPos==0)exitWith{hint"No valid doors";};
_dPos=_dPos apply{[_x distance _c,_x]};_dPos sort true;
_dPos=_dPos#0;
_dPos=_dPos#1;
_door=(selectionNames _b)select{(_b modelToWorld(_b selectionPosition _x))isEqualTo _dPos};
_door=_door#0;
//_dbug=createVehicle["Sign_Sphere200cm_F",[0,0,0],[],0,"can_collide"];
//_dbug setPos[(_dPos select 0),(_dPos select 1),(_dPos select 2)-0.1];
_b animate[(format["%1_rot",_door]),1,true];
};

 

 

Figured this may help find doors or even windows if you change up the code a little. Uncomment the "_dbug" lines to see the debug object on the position it finds.

  • Thanks 1

Share this post


Link to post
Share on other sites

Hi there,

 

I haven't had any luck with trying to get this script to work with a custom composition. It's a tunnel/cave. 

 

1. First, I placed my marker on an object as though its a house. (I have checked, there is no vertical axis to modify).

2. Facing the object, I then recorded the path (relative to world position), copied and pasted them into the init.


However, when executing the mission again (be it SP/MP), I am unable to get it to project the addaction to execute the custom path when aiming at the orientation of the marker.

 

Am I doing something wrong with the above (Assuming I did everything right)? I followed jBoy's instructions to the tee. 

 

Further to the above, if I am designing an MP mission scenario, would there be an easy workflow for the AI to automatically execute the custom path? I'm really keen to get this working for my communtiy missions as it unlocks a whole new level of gameplay. Having AI within custom compositions can be a thing now. Even if its simply having them work from waypoint A and B, strictly.

 

Cheers.

Share this post


Link to post
Share on other sites
15 hours ago, GingerAsianBond said:

I haven't had any luck with trying to get this script to work with a custom composition. It's a tunnel/cave. 

 

1. First, I placed my marker on an object as though its a house. (I have checked, there is no vertical axis to modify).

2. Facing the object, I then recorded the path (relative to world position), copied and pasted them into the init.

hey man thx for trying this.  for the addactions to work you need to be looking at a building object that the path was created relative to.  you can also create your own calls to start some ai on a path--there is probably a commented out example of that call in test mission's init.sqf.  the start path call could be called from anywhere--trigger, waypoint or script.

 

post your init.sqf and i will take a look.   I have a work deadline and am also leaving for weekend, so may not be able to help much until Wednesday next week.  i am confident we can make it work for your custom composition though.

 

Share this post


Link to post
Share on other sites

Fascinating project Jonnyboy, I love how you're willing to tackle such a difficult problem/limitation of the AI. Hell, I'm working on a singleplayer mission assaulting an oil rig, and I just resorted to using the unit capture function by TedHo to script most of it, which has it's own limitations. 

 

Anyway, I just wanted to say good luck with the project, keep up the good work.  

  • Thanks 1

Share this post


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

Hell, I'm working on a singleplayer mission assaulting an oil rig,

My script should work for the oil rig.  thx for the kind words.

Share this post


Link to post
Share on other sites
On 7/4/2019 at 2:10 PM, phronk said:

Figured this may help find doors or even windows if you change up the code a little. Uncomment the "_dbug" lines to see the debug object on the position it finds.

thx phronk.  i already have similar code for finding the doors.  and your right that door position is in door jamb, not center of door, so i calculate an offset to get door center.

On 7/4/2019 at 2:10 PM, phronk said:

the door position is actually by where the door knob would be if the door is open (regardless if the door is open/closed) or it's slightly inside the door frame either to the left or right

true, unfortunately its not consistent with door knob.  most buildings its where door knob is, and with a few like big 2 story barracks,  door pos is opposite of knob.

Share this post


Link to post
Share on other sites

Hi @johnnyboy

i am trying your path script.

I have a problem with the replay of the path i have made, i can record one but when i want to play it in game tru editor i don't have the option to do so.

i have used a map called Pulau by Temppa. the path is made relativ to house, but i did not use the front door but a side door. 

The building i have used is this one "Land_Hotel_02_F" and i have used the entry on the left side (looking at the frontdoor)

If you have the map it is the house at Grid 050062.

MyPath :

Spoiler

_newPath = // RECORD YOUR OWN PATH AND REPLACE THIS ONE WITH IT!
[
[[-185.717,-87.9819,-12.6259],[""],"amovpercmtacsraswrfldf",125.287,"UP",1,false,2],
[[-183.316,-102.386,-13.9964],[""],"amovpercmtacsraswrfldf",126.796,"UP",1,false,2],
[[-193.16,76.4434,-13.7836],[""],"amovpercmtacsraswrfldf",74.7794,"UP",1,false,2],
[[-59.9868,-200.742,-14.9215],[""],"amovpercmtacsraswrfldf",169.433,"UP",1,false,2],
[[-72.293,-198.11,-15.0763],[""],"amovpercmtacsraswrfldf",165.892,"UP",1,false,2],
[[-55.0435,-213.877,-15.0763],[""],"amovpercmtacsraswrfldf",170.684,"UP",1,false,2],
[[213.103,-68.481,-15.0763],[""],"amovpercmtacsraswrfldf",258.105,"UP",1,false,2],
[[188.94,-122.65,-15.0763],[""],"amovpercmtacsraswrfldf",244.012,"UP",1,false,2],
[[-223.386,-18.5933,-15.0763],[""],"amovpercmtacsraswrfldf",101.01,"UP",1,false,2],
[[-225.51,10.4219,-15.0763],[""],"amovpercmtacsraswrfldf",93.4349,"UP",1,false,2],
[[-216.598,61.3169,-15.0763],[""],"amovpercmtacsraswrfldf",79.7058,"UP",1,false,2],
[[-217.914,53.3247,-16.6381],[""],"amovpercmtacsraswrfldf",81.1354,"UP",1,false,2],
[[-215,61.9097,-18.5218],[""],"amovpercmtacsraswrfldf",78.0987,"UP",1,false,2],
[[-222.261,29.7109,-18.5725],[""],"amovpercmtacsraswrfldf",85.8287,"UP",1,false,2],
[[41.7651,217.866,-18.5725],[""],"amovpercmtacsraswrfldf",352.705,"UP",1,false,2],
[[213.691,-67.187,-18.5725],[""],"amovpercmtacsraswrfldf",258.414,"UP",1,false,2],
[[-45.8516,-222.741,-18.5725],[""],"amovpercmtacsraswrfldf",174.034,"UP",1,false,2],
[[-215.189,66.249,-18.5725],[""],"amovpercmtacsraswrfldf",76.6722,"UP",1,false,2],
[[56.1206,216.362,-18.5725],[""],"amovpercmtacsraswrfldf",349.349,"UP",1,false,2],
[[203.612,-94.6836,-16.6865],[""],"amovpercmtacsraswrfldf",249.912,"UP",1,false,2],
[[215.862,-65.4648,-15.0763],[""],"amovpercmtacsraswrfldf",258.622,"UP",1,false,2],
[[-90.0303,-208.971,-15.0763],[""],"amovpercmtacsraswrfldf",162.045,"UP",1,false,2],
[[-223.58,-41.8889,-15.0763],[""],"amovpercmtacsraswrfldf",105.551,"UP",1,false,2],
[[-63.1128,-219.288,-15.0763],[""],"amovpercmtacsraswrfldf",168.576,"UP",1,false,2],
[[-76.2231,-224.52,-15.0763],[""],"amovpercmtacsraswrfldf",165.231,"UP",1,false,2],
[[60.605,218.797,-15.0763],[""],"amovpercmtacsraswrfldf",349.147,"UP",1,false,2],
[[-213.895,67.9941,-15.0763],[""],"amovpercmtacsraswrfldf",75.6399,"UP",1,false,2],
[[-218.363,48.4043,-15.0718],[""],"amovpercmtacsraswrfldf",80.2578,"UP",1,false,2],
[[-219.071,42.6206,-14.126],[""],"amovpercmtacsraswrfldf",81.1603,"UP",1,false,2],
[[-62.1396,-227.438,-14.2286],[""],"amovpercmtacsraswrfldf",166.741,"UP",1,false,2]
];

i have watched your video a lot of times and i cant make the AI use the path.

 

Share this post


Link to post
Share on other sites
On 8/25/2019 at 11:26 AM, Play3r said:

i have used a map called Pulau by Temppa

Hey Play3r, zip up your mission directory and send me a lin,k and tell me all mods you are using, and I will try and look at it tomorrow or the day after.

Share this post


Link to post
Share on other sites
On 8/25/2019 at 11:26 AM, Play3r said:

I have a problem with the replay of the path i have made, i can record one but when i want to play it in game tru editor i don't have the option to do so.

i have used a map called Pulau by Temppa. the path is made relativ to house, but i did not use the front door but a side door. 

Hi Play3r.  I looked at your init.sqf and it looks clean.  Questions:

 

1.  Did you name your marker near the building "Marker"?  (i.e., the same name you reference in the code?).

_house = nearestBuilding getMarkerPos "Marker";

2, When you recorded building positions, did you choose "relative to building" option for recording?   You want relative to building, as the other option is untested.

 

3.  Do you have ai units grouped to player with player being the leader?  To order your ai units to execute the path, the player needs to look at building associated with "Marker", and then the actions to order ai units will appear.  You must have subordinate ai units in your squad.

 

For some reason the Pulau mod is not loading for me, so I am unable to try your test mission.

Share this post


Link to post
Share on other sites

This is amazing! I caught up a previous discussion here and it was fascinating to follow. I see that this script solves at least partially some of the problems that were mentioned there. But I have two questions:

 

Are you keeping up a list of building paths that can be augmented by everybody? 

 

Can this script be incorporated in general AI behaviour like every time an AI squad gets a hold waypoint near a building it checks if the building has custom paths defined in a list of recorded path arrays and searches/occupies it? I'm thinking of a few squads moving in and occupying window positions to provide cover for a squad advancing towards enemy. And I'm also thinking of RSO buildings which are often discarded by map makers for not having AI paths. I mean this could be the basis of an alternative building pathfinding system right?

 

 

Share this post


Link to post
Share on other sites
13 minutes ago, b3lx said:

Are you keeping up a list of building paths that can be augmented by everybody? 

Not really.  I have some paths for my testing. But if this gains momentum we could have a library of paths for buildings.  Its time consuming to create the paths, so I will only do paths for certain buildings as examples while developing the script, or for specific usage in a mission.  But if mission makers start using the script they could contribute paths that they create.

14 minutes ago, b3lx said:

Can this script be incorporated in general AI behaviour like every time an AI squad gets a hold waypoint near a building it checks if the building has custom paths defined in a list of recorded path arrays and searches/occupies it? I'm thinking of a few squads moving in and occupying window positions to provide cover for a squad advancing towards enemy. And I'm also thinking of RSO buildings which are often discarded by map makers for not having AI paths. I mean this could be the basis of an alternative building pathfinding system right?

Yes this could be used for all of the above.  The dream is to have a library of paths per building, or to even generate paths on the fly if we have nodes defined per building (per MadRussian's work).  But with Leapord's All-In-One Super AI project coming along, people may be less interested in my approach.  However I think it can still be quite useful, and plan to use it in missions.  Its great for inventive cut-scenes or triggered scripted actions within a mission.

 

Example:  I'm starting work on Episode 3 of my Last Tango in Tanoa series.  I'm not sure of setting yet, but plan to use my script for AI take downs of a few buildings.  To make it more replayable and interesting, I plan to record multiple paths for the buildings, and randomly choose one at play-time (makes the mission less predictable for player).  I can also use it for enemy patrols of places not normally accessible like rooftops.

 

In my current dev version, I have added support for ladder climbing and Enhanced Movement mod (so AI can climb walls, low structures, through windows, etc.).  I should be releasing this new version soon.

 

Thanks for you interest.

  • Like 4

Share this post


Link to post
Share on other sites
5 minutes ago, johnnyboy said:

In my current dev version, I have added support for ladder climbing and Enhanced Movement mod (so AI can climb walls, low structures, through windows, etc.)

Haha, this is more than I could hope for! I imagine a player doing a boring patrol mission and enemies shooting from totally unexpected positions. You better start taking patrols seriously, soldier!

 

Could it be possible or desirable to add a "hold" or "sentry" action (where you put "door", "grenade", etc) to make the AI hold positions there until some trigger puts them on their way again? This is maybe too complicated but for instance if enemy is detected and is in line of sight stay and shoot, if not in line of sight then exit building and do your thing.

Share this post


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

Haha, this is more than I could hope for! I imagine a player doing a boring patrol mission and enemies shooting from totally unexpected positions. You better start taking patrols seriously, soldier!

That, and dudes swarming the walls of a compound, haha.

1 hour ago, b3lx said:

Could it be possible or desirable to add a "hold" or "sentry" action (where you put "door", "grenade", etc) to make the AI hold positions there until some trigger puts them on their way again? This is maybe too complicated but for instance if enemy is detected and is in line of sight stay and shoot, if not in line of sight then exit building and do your thing.

That's possible now.  Make a path up to the door where you want them to hold.  And a second path from that point to where you want to go when triggered by some condition.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
50 minutes ago, johnnyboy said:

That's possible now.  Make a path up to the door where you want them to hold.  And a second path from that point to where you want to go when triggered by some condition

Obvious🤦‍♂️. Didn't think that one through. Thanks!! I'm going to make some experiments

  • 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

×