Jump to content

Recommended Posts

I've built a compound that is required as part of the mission to have a narrow entrance coridoor.

It's probably a little over 2m in width, maybe 2.5m - and should be perfectly navigable by an infantryman.

 

However, the AI can't seem to make sense of how to use the route to get into the deeper pats of the compound.

 

Is there any way of specifying a 'safe route' that AI will automatically follow?

In the same sort of way that when driving the AI recognise a road and follow it in most cases.

 

Thanks.

Law

Share this post


Link to post
Share on other sites

Of course they can't. It's ArmA - AI. :smileee:

You could try creating strict pathways with SQF/FSM for your AI but, if you are ordering them to move somewhere (inside the compound) via your group/squad commands, I don't think you can override it. Though, I haven't looked tbh.

  • Like 1

Share this post


Link to post
Share on other sites
On 14/11/2017 at 5:03 PM, HazJ said:

You could try creating strict pathways with SQF/FSM

 

How do you mean?

I could create a set of waypoints showing the exact route, but I think they would still run into whatever they think is blocking them from finding the path normally.

 

Unless you can make the AI ignore all collisions at certain points on the path?

Share this post


Link to post
Share on other sites

Experiment with putting waypoints at either end of the narrow corridor, and do the following on the unit that you want to pass through:

_dude disableAI "FSM";
_dude disableAI "AUTOCOMBAT";

In my Property of Mabunga mission, I wanted AI to move directly to next position without considering terrain, roads, etc., and the above worked.  However, they weren't threading the needle like in your case, but it might work.  If that doesn't work, add this:

_dude disableai "PATH";

For my JBOY Dog, I disabled PATH sometimes so dog moves directly from one position to another and ignores objects in his path (and clips).  The dog is an "Agent" though, so I don't know if the AI will perform the same way as the Dog Agent.

 

If one of the above works, then you may have to script funneling multiple units through the corridfor somehow (stack up at entrance using FILE formation, sending them through the corridor one at a time using MoveTo commands maybe).  Maybe just waypoints would work if you are lucky, but don't start a group through the corridor until the entire group is stacked behind  leader facing toward the corridor in FILE formation (script a way to know when all in line behind leader).  Its work to get it done.

 

Another possibility is set one of those narrow wooden walking bridges just below the surface.  The bridges have building positions that AI can move from/to.   You make your waypoints to a bridge  position outside corridor, then order him to next position on bridge that is inside the compound, and he will walk the wooden bridge without deviating.  If bridge is just below surface it would look good.  You might be able to use a dock object for this also.

 

Worst case, you can move unit(s) to entry point, set their direction toward corridor,  and play an animation loop on them to get them through.

Its doable, but work.  Sad that we have go to these lengths...  Good luck.

  • Like 2

Share this post


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

Another possibility is set one of those narrow wooden walking bridges just below the surface.  The bridges have building positions that AI can move from/to.   You make your waypoints to a bridge  position outside corridor, then order him to next position on bridge that is inside the compound, and he will walk the wooden bridge without deviating.  If bridge is just below surface it would look good.  You might be able to use a dock object for this also.

 

Worst case, you can move unit(s) to entry point, set their direction toward corridor,  and play an animation loop on them to get them through.

Its doable, but work.  Sad that we have go to these lengths...  Good luck.

 

Thanks Johnny, nice response.

 

I wasn't sure if disabling AI aspects would work like this but glad to know it has done in similar scenarios before.

 

Funny you should mention about the wooden bridges though - I just yesterday discovered (by accident) that you can use buildings that have been hidden as invisible entry points through walls.

If you place the door of the hidden building just sticking out of the wall and parallel to it, the AI count this as an entry point (even though it's hidden) and will happily pass through a completely solid surface to get to the other side even if no AI aspects have been disabled.

 

I guess clipping is automatically disabled when AI pass through doors because there's no parameter to open the door if it's closed.

 

 

Anyway, I'll get working on that and let you know how it goes.

Thanks again!

Share this post


Link to post
Share on other sites
On 17/11/2017 at 6:19 PM, johnnyboy said:

 


_dude disableai "PATH";

 

 

This appears to stop units from moving, while allowing them to still rotate.

Is there anything that makes them ignore collisions?

Share this post


Link to post
Share on other sites

{_dude enableCollisionWith false;} forEach myArrayOf Objects;

 

Put your corridor objects in an array called myArrayOfObjects, and the unit can then collide with them via the above command.

Share this post


Link to post
Share on other sites
On 21/11/2017 at 3:53 PM, johnnyboy said:

{_dude enableCollisionWith false;} forEach myArrayOf Objects;

 

Put your corridor objects in an array called myArrayOfObjects, and the unit can then collide with them via the above command.

 

Thanks, I'll play around with it.

I had seen this before and tried it with small sections of the wall, but it didn't seem to be having any effect.

 

I tried disabling collision with, for example, 2 large chunks of wall, but the AI still seemed to consider them as being barriers.

 

Anyway...I'll see what I can achieve. 

Share this post


Link to post
Share on other sites
6 hours ago, lawman_actual said:

I tried disabling collision with, for example, 2 large chunks of wall, but the AI still seemed to consider them as being barriers.

Disabling collision just means they can pass through the objects.  I don't think it affects their path calclations (i.e., they may still try to walk around it).

Share this post


Link to post
Share on other sites
On 24/11/2017 at 6:17 PM, johnnyboy said:

Disabling collision just means they can pass through the objects.  I don't think it affects their path calclations (i.e., they may still try to walk around it).

 

Yup :/

Looks like i'm going to have to rely on loop animations.

 

As you stated, seems like we're lacking some tools for these kind of problems.

Thanks for the help anyway

Share this post


Link to post
Share on other sites

Hey Lawman, I played with your problem a bit, and I could get the AI to walk through a corridor using simple waypoints.  Note that they would not walk through the "H-barrier Corridor" object though.  What objects are you using to make the corridor?

 

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

×