Announcement

Collapse
No announcement yet.

AI Pathing Issues

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    AI Pathing Issues

    I've currently got a problem where Right Clicking in certain areas in your base will confuse any AI you have selected and cause them to run in an opposite direction - usually somewhere outside of the base or off the map. This is particularly notable directly around structures but also in places between structures, and in some completely random locations.

    So far I have checked the Nav mesh which only has gaps where buildings or impassible terrain is present, I have also been over the blueprint for the AI movement several times and cant find any errors there. Any advice would be a great help, cheers in advance.





    Click image for larger version

Name:	aimovement.png
Views:	1
Size:	62.4 KB
ID:	1170163

    #2
    Cannot see nodes in your picture, resolution is quite bad. You should debug that problem, this may be not fault of your blueprint graph.

    To debug, you should do line trace (that is persistent) from pawn location to target location, then eject camera and carefully watch around target location. Turn on collision, see if there is enough free space, maybe some objects have collision that is messed up and are blocking path. Try recasting nav mesh dynamically.

    For eg i had similar problem yesterday: one of my floor meshes had hole with place for vent or some decorative mesh. I did collision of that floor mesh too well (ie it had no collision over hole spot), so when i clicked in that hole my function to trace location under mouse returned [0,0,0] and my little guy started running towards center of map.

    But because i have line trace that can show where i clicked in 3d i turned it on and i found reason.

    Split everything that may cause problems in smaller parts and eliminate module after module, stuff you cannot eliminate is most probably your culprit. Start with finding some spot that causes this behavior, check if it does randomly or its consistent. If its random try to find pawn location when you clicked (it may depend on starting location), so print pawn location and destination to log, when you click, if you get error, place pawn start at same coordinates, restart game, see if same bug persists. Then try same with destination (just create new keyboard event, hardcode destination, fire it up instead of mouse). Find what part of game is causing this, alternative is blindly and randomly changing parts until you find bug.

    More you know abut error, easier will be for your brain to "magicaly" find that bug, yes for me it is still magic (after 15 years of reverse engineering) at some point i just know where error is, it is moment of: "aha you are hiding there!". But first I need to load brain with all those seemingly meaningless information.

    Comment

    Working...
    X