Jump to content
madrussian

Path-finding for AI building Entry / Exit

Recommended Posts

I'm very impressed with the recent AI Driving update, driving is indeed much improved!  (obviously still needing some tweaking)  I was hoping the "path-finding" update would fix another longstanding issue, but with foot soldiers.

 

AI building path-finding in ArmA has always been a mixed bag.  Just talking about open buildings here, those with positions detectable via buildingPos.  Also, focus of this thread is not about open buildings on Tanoa or lack thereof, rather AI getting into and out of open buildings (partially open or otherwise).  In my experience, AI building path-finding falls into 3 categories:

  1. On the one hand, most of the time AI can successfully enter & exit these buildings (via doMove to buildingPos), which is awesome!
  2. In many cases, AI cannot enter certain open buildings in the first place.  The path-finding is busted.  This seems to be an issue where the building model itself is fine (duplicates of the building elsewhere on the map work just fine), but perhaps this instance of the building was placed poorly on the map (door slightly too high from terrain, building hemmed in too close with other buildings and/or objects, etc.)  Although disappointing, it's not a terrible problem.  Next item however, is a real deal-breaker!
  3. In many cases, AI can enter the open building reliably just fine (via doMove to buildingPos), but gets absolutely stuck inside.  When stuck like this, AI can travel between the building positions just fine, but here's the kicker:  The AI can never leave the building, he is forever stuck inside.  (Barring teleportation via script, lining him up at the front door and doing a forced animation, etc).  This "able to enter / unable to leave" issue occurs even with a single man in a group, even with no other men in or near the building, unit not in Combat, etc.  This is a true path-finding problem, and it's terrible for building takeover scripts.  Also, there is no way to detect these "trap" buildings via script to avoid them (without going to super-extraordinary lengths, such as automated overnight tests where you spawn a man in each building position on the map, ordering him to leave the buildings repeatedly, and collecting the results to form a mega "banned buildings" list, and doing this over and over again per map).

I dream of a day when we can script reliable AI building entry/exit.  I personally picture an MG-42 team on a Stalingrad type map moving from one partially destroyed building to another, setting up MG positions from the windows.  Seems to me, the first step towards this lofty goal is making sure the AI can reliably leave a building once it enters.

 

After seeing the radical improvements to AI Driving, I'm very hopeful for a solution in this area.  Any plans for improved AI building entry/exit navigation?

 

  • Like 12

Share this post


Link to post
Share on other sites

Here is one such place on Stratis: [2240.19,5713.17,0.243564]

 

Repro:

 

place player unit in editor and group an AI buddy to him called man1

 

then type this in debug console

 

man1 setPos [2240.19,5713.17,0.243564]

 

Then watch as he rotates on the spot or paces back and forth, unable to leave the building.

 

This is the building: 44dfd600# 67419: miloffices_v1_f.p3d

  • Like 2

Share this post


Link to post
Share on other sites

The one you found might be a #2 or #3 variety.  Before getting stuck inside, can the AI walk into the building on his own two feet? (via doMove to a buildingPos position)  There really are a plethora of these "bad buildings" (both #2 and #3) on every map I've checked out.  Many right there in the main Stratis village.  Many are close to that man-made concrete ditch.

Share this post


Link to post
Share on other sites

so you guys think it's down to building type or is it unique objects having problems?

Share this post


Link to post
Share on other sites

Definitely not building type, as when you find a bad instance of a building (bad individual building object), there are perfectly functional instances of the exact same building type elsewhere on the map.

 

I don't pin the problem on the buildings or the building object's placement, or on nearby object placements.  In the cases I'm thinking of there is nothing obstructing the building's doorway, and nothing funny about the terrain at the doorway.  I simply order the AI through the front door to interior buildingPos via doMove, and he happily walks right in.  Then he moves around just fine within the confines of the building, but there's absolutely no way to get him to walk back out again.  (To repeat: single AI alone in his own group, and not in combat.)  I pin the problem squarely on the AI path-finding.

 

Also, there's a totally separate issue (not mentioned here yet), regarding multiple AI in the same building, when one or more are trying to move.  They get in each other's way and often one or more stop moving completely.  The problem is compounded if they are in the same group and in Combat (due to the "go, I'll cover" fsm algorithm, etc), so again I always put men in their own group, which works far better but still has major issues.  (Also I use forceSpeed -1, in cases they are stopped due to forceSpeed 0.)

 

I imagine making AI path-finding inside buildings work effectively is quite a challenge, and I believe that progress is totally possible and that this is a great area for improvement in our beloved game.  I wonder if BIS has looked at 3rd party path-finding solutions.  Something like SpeedTree but for Path-finding complex crowd AI (including within a confined environment) might be just the ticket.

 

Share this post


Link to post
Share on other sites

Trying to get the AI into buildings is a frustrating exercise, because while it does work in some cases, it's not reliable enough to really use. Sadly BI haven't made a lot progress (or apparent effort) towards getting AI using the inside of buildings since OFP:Resistance.

 

I agree that AI's ability to use buildings varies for different instances of the building across a map, but there are some bad building objects that cause a lot more trouble than others. I now suspect adjacent objects around a building is the main cause of AI trouble, as it's the only apparent difference between instances of the same building where one building fails and one works. I've created a bug report here: AI's ability to move in/out/within buildings can be negatively affected by nearby objects.

Otherwise, maybe the pathfinding works on a grid and the position and alignment of the building on that grid somehow affects their pathfinding. Another complication is the simplification of AI routines as the game FPS drops (and maybe also as players get further from the AI?).

 

If you are interested in automated testing, I built a test mission that sends AI off to explore buildings at random. It detects when the AI get stuck and rescues them if required. An Altis version is attached to this bug report: AI needs building usage routines, but it is dynamic and will work on any map. The mission does report some false positives for positions on balconies due to this issue: Script commands doMove and commandMove cannot reliably move AI units to some building positions.

I've done some work on an updated version (since the released R1 version is incompatible with buildings over ocean, which does happen on Tanoa).

  • Like 4

Share this post


Link to post
Share on other sites

Good summary, good bug reports, nice mission!

 

Shifting my thinking slightly - This really a multi-faceted issue.  I agree that some buildings are worse offenders than others.  I think that's a sound theory that it comes down to object placement near the buildings.  I also stand my assessment that the AI path-finding should be more forgiving, and be able to recover when it gets off track or similar.  In short, imo the AI should be able to get where it needs to go (certainly in and out of buildings), regardless of whether it encounters a slightly bugged building.  Above all, AI should never get in just fine, but be stuck once inside.

 

Speaking of buggy buildings, one in particular that consistently has a major "AI can enter but can never leave" problems is "Land_i_House_Small_03_V1_F".  On Stratis in Ageia Marina, turns out this building accounts for fully 25% of buildings with positions!  (see blue dots in the screenshot below)

 

I created a quick simple test mission.  Loon gets ordered to move into nearest building (closest to player) via radio 0-0-0.  Loon gets ordered to move back to player via radio 0-0-9.  To make testing easy (as Loon keeps getting stuck), 0-0-8 teleports Loon back to the player and clears his doMove order.  Results are repeatable.  AI can enter most buildings.  Upon entry, AI gets stuck in many "Land_i_House_Small_03_V1_F" buildings, but he can consistently successfully enter and exit other instances of "Land_i_House_Small_03_V1_F".  For certain instances of "Land_i_House_Small_03_V1_F", AI can always enter but successful exiting seems to depend heavily on the location of the exiting doMove position.

 

I only spent a few minutes in there and found 2 consistently bad exit buildings and 1 consistently good building.  Again, all "Land_i_House_Small_03_V1_F" have a blue dot:

 

efNV3CD.jpg

  • Like 1

Share this post


Link to post
Share on other sites

Here are the some AI issues where I can see opportunities to improve the situation:

 

 

And some examples of AI incompatible or unfriendly content issues:

  • Like 8

Share this post


Link to post
Share on other sites

Great breakdown Ceeeb!  Very nice path forward for incremental fixes.

 

They are all important.  I'd say fixing this one may have single the biggest impact:

Share this post


Link to post
Share on other sites

It seems that sometimes AI have hard time to "link" buildingPos to calculate a proper pathfinding. It was already the case in ofp, if AI was alone in a group, it was turning endlessly trying to calculate pathfinding. When I order AI to move inside buildings I disbaleAI "FSM". I don't know exactly why but they navigate easier and are usually not stuck.

Share this post


Link to post
Share on other sites

Is there any improvement for that?

I'm trying to send an AI unit at Tanoa main airfield control tower (balcony). I succeed in placing some helpers to check building positions. That's not the problem.

I attached a waypoint to the building then used setWaypointHousePosition command, and that fails. The unit goes under the position but on ground. Ai never ever try to climb into the tower.

 

If i'm right so far, just mentioning houses/objects where a player can climb on ladder/stair, there are:

- houses/objects, like reservoir tower, with no path, no buildingPos, just ladder for players,

- houses/objects like Tanoa control Tower, with no path, but some building positions. The kind of disappointing position you can ask your subordinate to reach (HUD), then hear a "no sir" because he's polite.

- holy houses/objects, probably, with paths and building positions. (I should avoid Tanoa!).

 

I'd like to known if there is some project about that, but right now, if there is a command/function able to check if there is some path inside a building, just in order to skip some unreachable waypoints if not.

Thanks

Share this post


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

 if there is a command/function able to check if there is some path inside a building

https://community.bistudio.com/wiki/BIS_fnc_buildingPositions

https://community.bistudio.com/wiki/buildingPos

https://community.bistudio.com/wiki/buildingExit

if none are found, there is no path lod.

more theoretical information:

https://community.bistudio.com/wiki/LOD#Paths

The "can't enter" issue could also happen because the building is 1cm sunk too far into the ground - it's not possible to tell what the requirements are for finding/accepting an entry position. Vanilla buildings have some fancy "entry flower" - you can check the Arma 3 Sample house to see how that looks like.

Share this post


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

https://community.bistudio.com/wiki/BIS_fnc_buildingPositions

https://community.bistudio.com/wiki/buildingPos

https://community.bistudio.com/wiki/buildingExit

if none are found, there is no path lod.

more theoretical information:

https://community.bistudio.com/wiki/LOD#Paths

The "can't enter" issue could also happen because the building is 1cm sunk too far into the ground - it's not possible to tell what the requirements are for finding/accepting an entry position. Vanilla buildings have some fancy "entry flower" - you can check the Arma 3 Sample house to see how that looks like.

 

Sorry, but it seems to me , some buildings, like Tanoa control tower have building positions (easy to check with a simple order to subordinate or with the command), but no path LOD at all. Easy to check: the AIs disobey and never reach some upstairs positions. So I agree, if no position, no path. But on the other hand, some positions doesn't mean path.

So, players are able to go up a ladder (water reservoir) or inside a control tower (The Tanoa one, different from Altis one), and you can't say when an AI can reach his position. That's a problem is try to issue for AIs medic assistance. My question needs still answer: is there a way to detect if paths are present in a building?

Share this post


Link to post
Share on other sites

+1

 

Pretty sure the landscape designers didnt and dont talk directly with the AI dept in a very thorough way..

Share this post


Link to post
Share on other sites
On 22.1.2018 at 7:56 PM, froggyluv said:

Pretty sure the landscape designers didnt and dont talk directly with the AI dept in a very thorough way..

 

My impression is rather that this was simply a question of priorities - unfortunately not a very high one.

For example take the two largest buildings from that hotel/resort (tiny island top NE). They'd be really great, weren't it for the fact that parts of both of them are closed off for no good reason (thereby drastically reducing their utility for mission makers).  Why do that? Why would anyone do such a thing? To save time.

 

Or take the huge yellow haul trucks. Why can't we drive them around (man, that would be so sweeeet)? Missing parts, yada yada? No. To save time.

 

It's really a shame to save time by reducing functional objects to mere decoration. I love Tanoa (haven't been around for a while, so I'm still exploring). The forests/jungles are simply the best (boy, do I hope we'll see similar dense forests with more northern/european, maybe alpine vegetation). It's all so friggin pretty. And then you take a closer look and lot's of stuff is just "fake". A "cardboard city/object". It's very unfortunate.

 

Then again, close quarters combat (or similar things "this close up") was never really a priority (and the terrain, to the contrary, is of very high quality; from a functional/tactical pov). And it was never supposed to be tackled for A3, seeing how they "solved" the problem with fancy video sequences for such stuff you can't really represent ingame (e.g. your cheesy door breach, throw nade, shoot and arrest scene). Not really happy about this... it's all just smokes and mirrors. Ingame machinima, known from earlier releases in the series (gib guba back!), are much better, more honest, anyways. meh... :)

 

 

EDIT: And just because it's such a good example, here's a screenshot from the hotel resort building. Red dots indicate all the building positions that aren't available (closed off rooms/closed doors), but really should be. What makes me an especially sad rambo here, is the fact that you could easily step (hit "v") onto the roof from the balcony for excellent overview position (just for the players, not the AI, eh). Alas... :(

The other building right next to it is also just frustrating, with it's main room not being accessible, only the entrance or something? Just.

 

Share this post


Link to post
Share on other sites
50 minutes ago, rübe said:

..it's all just smokes and mirrors...

 

every game/movie is just that (cpt obvious mode off:dozingoff:)

Share this post


Link to post
Share on other sites
Just now, bars91 said:

 

every game/movie is just that (cpt obvious mode off:dozingoff:)

 

Absolutely not, no. If an object is functional within the game world, and can manipulate it in the way a user expects he should be able to, then it's not just smokes and mirrors. It turns "real" (with respect to the game world of course).

Sure, it's not black and white, it's a spectrum. And what detail is really needed (or expected by users) is up for debate. Should we be able to cut down individual trees with that axe object? Does a milsim need this? Questionable. Probably more something for DayZ and the like. So it stays a "smokes and mirrors" object (maybe someone writes a script, but that's a different discussion...). Same with buildings: do we just need them to populate the terrain, which reduces their function to that of a huge rock (still something, I guess...)? Or is the interior of buildings valuable to what we're trying to do here?

Share this post


Link to post
Share on other sites

IKR - i'm just of the mindset that "the (money) train has already left the station" since there are more global (systemic) AI problems still not solved since 2013.

 

You can call me nihilist, but i've been around long enough to see where this is going.

Share this post


Link to post
Share on other sites
On 1/23/2018 at 4:56 AM, froggyluv said:

+1

 

Pretty sure the landscape designers didnt and dont talk directly with the AI dept in a very thorough way..

 

AI department ... 

 

giphy.gif

 

 

found pic of AI department (inside source):

 

Ai2tn4Q.jpg

  • Like 1

Share this post


Link to post
Share on other sites
On 18/02/2018 at 9:17 PM, rübe said:

 

Absolutely not, no. If an object is functional within the game world, and can manipulate it in the way a user expects he should be able to, then it's not just smokes and mirrors. It turns "real" (with respect to the game world of course).

Sure, it's not black and white, it's a spectrum. And what detail is really needed (or expected by users) is up for debate. Should we be able to cut down individual trees with that axe object? Does a milsim need this? Questionable. Probably more something for DayZ and the like. So it stays a "smokes and mirrors" object (maybe someone writes a script, but that's a different discussion...). Same with buildings: do we just need them to populate the terrain, which reduces their function to that of a huge rock (still something, I guess...)? Or is the interior of buildings valuable to what we're trying to do here?

 

Sure. At least, we could have a little consistency. If there are some "positions" in a building, then AI paths to them must be operative. It's hard to spill time with scripts, (or even "in game commanding action")  to order an AI to reach an "unreachable" position. Simple as that.

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

×