Jump to content
The Dark Mod Forums

AI won't enter AAS area from certain directions only


SteveL

Recommended Posts

My test AI will happily walk through a certain AAS box to get to a path corner, but then walks carefully around it to get back. It's a big AAS box, so the effect's not subtle.

 

post-29566-0-99486800-1390249191_thumb.jpg

 

In the pic, he's just crossed successfully through area 29 into area 28 going left to right, but to get back to the left hand side of area 29, he's pressing up against the far wall to walk around the box rather than cross it.

 

The floor is a lumpy patch over a caulk wedge. It looks very bumpy but the maximum gap between it and the caulk wedge is 20 units. The underlying brush isn't broken under the problem area, so there's no invisible "step". There's no visportal or intersecting brush.

 

Tweaking the caulk wedge verts hasn't fixed it. Nor has moving the path corners, including z-axis-wise. What *does* seem to fix it is adding an extra path corner in the middle of the offending AAS box. Then the AI paths through it fine both ways.

 

Any idea how to understand or avoid this problem? There's a second spot in my map where it seems to be happening too, though I haven't done as many tests yet as I have with the one above. If I'm somehow messing up TDM's shortest-path calculations, I could end up with lots of pathing bugs :huh:

Link to comment
Share on other sites

The pathfinding math going in one direction can very well be different from the math going in the other direction.

 

I've seen plenty of situations where AI pick what I would consider to be the least direct route from A to B, especially when several choices are available to them. I've seen them enter a room with two doors by picking the door farthest away from them, instead of using the one they're standing next to.

 

So there's really not anything we can do with pathfinding short of redesigning it, which is a big job.

 

Your use of an extra path_corner is one way to "guide" them. Another would be to use monster_clip to force them along a particular path. But in an open area like your example, monster_clip would be a problem when searching or trying to combat you.

Link to comment
Share on other sites

The floor is a lumpy patch over a caulk wedge. It looks very bumpy but the maximum gap between it and the caulk wedge is 20 units.

 

20 units probably is causing problems, I'd reduce to <=16, see http://wiki.thedarkmod.com/index.php?title=Pathfinding#monster_clip_:_Adding_AI_pathfinding_to_Horizontal_Surfaces

 

I'd also change the caulk to monsterclip, I've found they do affect AAS differently (I had AI refuse to go up brush stairs, even with a nodraw ramp, until I made monsterclip stairs).

 

You can put islands of monsterclip below high spots in your patches where the disparity in height is greater than sixteen. Not that some AI can't step up over 14 (and perhaps less) per that wiki article, so they might go down fine and not want to return if there's a step up that way.

 

Any idea how to understand or avoid this problem?

 

Experience. :-) There's a reason I worked a lot with patches and outdoor landscape for my first FM. Future FM creation will feel easy in comparison.

 

The command, "timescale 2" is a great way to test pathing in half the time, it doubles the speed of almost everything (not sounds). It can throw off the physics though, so don't rely on it exclusively, and numbers greater than 2 are supposedly even less reliable. Use "timescale 1" to return timescale to normal (it's a factor).

"The measure of a man's character is what he would do if he knew he never would be found out."

- Baron Thomas Babington Macauley

Link to comment
Share on other sites

Thanks for the advice guys. When you think you've tried everything, ask :) The timescale tip is something I'd not come across before and it's sped up my testing cycle a LOT.

 

Results of latest testing:

  • The extra path corner is fine for fixing a patrol, but not for allowing an AI to chase the player. They still take the long way round once they leave their patrol route.
  • Changing the AI type didn't change anything.
  • Using monsterclip or nodrawsolid instead of caulk didn't change anything in this spot.
  • Varying the types of adjacent walkable brushes (i.e. striping between monsterclip, caulk, and nodrawsolid) doesn't affect the AAS boxes or the pathing.
  • Adding an extra caulk wedge fixed both patrolling and chasing, but it also caused the big AAS boxes to be split up into small ones so it was unclear whether the height difference was the problem, so I tried more tests:
  • Splitting the original caulk wedge into 6 small ones didn't affect the AAS boxes or the broken pathing.
  • Lowering the verts of one of the central split wedges by an couple of units also caused the AAS boxes to be split, and it fixed the problem too. NB This increased the gap between the caulk and the patch.

So I've still not worked it all out, but I'm much happier that I can fix this problem where I find it. My take-away lesson is, if AI are pathing around a big AAS box, add a little brush or do something else to break up the AAS boxes. And tweak stuff till it works!

 

ps: If I seem to be taking too long over this, it's because of past experience. The only other time I ever tried to make a FM for any game was 8 or so years ago with T3ED. I put months of work in, but then couldn't get AI to walk between rooms at all. My navmesh looked perfect, but neither I nor any of the experienced people on ttlg could make AI path around my map, and I ended up abandoning the map and mapping for a decade! This time round I've had test AI exploring every corner almost since day one. So happy to have found TDM now and to be giving it another go. TDM is so much better!

Link to comment
Share on other sites

Thanks for providing feedback, interesting results, similar to some of my own. Yes, the chasing behavior is different, but in my map, they were willing to chase happily where they were not willing to path normally. Go figure.

 

Same conclusion, not working as expected? Change it a bit. :-)

"The measure of a man's character is what he would do if he knew he never would be found out."

- Baron Thomas Babington Macauley

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • OrbWeaver

      Has anyone had any luck with textures from Polyhaven? Their OpenEXR normal maps seem too washed out and give incorrect shading in the engine.
      · 3 replies
    • datiswous

      I tried to upscale the TDM logo video. First try:

      briefing_video.mp4 You can test it ingame by making a copy of the core tdm_gui.mtr and place it in your-tdm-root/materials/ , then edit line 249 of that file into the location where you placed the new briefing.mp4 file.
      What I did was I extracted all the image files, then used Upscayl to upscale the images using General photo (Real-Esrgan) upscale setting and then turn it back into a video.
      I might have to crop it a bit, the logo looks smaller on screen (or maybe it's actually better this way?). My video editor turned it into a 16:9 video, which I think overal looks better than 1:1 video of original.
      · 1 reply
    • nbohr1more

      Trying to be productive on my down-time before Capcom releases Akuma and my son is constantly on my PC playing Street Fighter...
      · 1 reply
    • OrbWeaver

      Finally got round to publishing a tutorial on baking normal maps in Blender, since most of the ones we have are inaccessible or years out of date.
      · 2 replies
    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
×
×
  • Create New...