Download

AI Random Walking path?

Hi friends!
I’m having an issue with my AI controller.
If I am using the basic AI code from blueprints, the AI logic, by default, it will choose the easiest way and the shortest way from it’s position to the target. I want to make it go randomly until it reaches the target.
I made an image to exemplify the hole thing… I am trying to make it work for about 4 days and I don’t know what to do to make it work…
I hope someone will find a solution for this and help me out!!!
Thank you in advance!!!

so Epic made a huge optimization for AI and pathfinder and you would destroy all of this hhh
anyway i think it’s made by implementation of stop point or something like that and make those point location random. i hope it help

For example:

1- select target T
2 - while random(1,n) != 1 (or a counter)
2.1 - select random point P in the navmesh (this is the tricky part … many possibilities on how to chose)
2.2 - move AI to P
2.3 - if P close to T then goto 3
2.4 - goto 2
3 - finally move AI to T (if not there already)
4 - done

Thank you for your reply @EvilCleric . I will test this out tonight and I will let you know if it is everything ok :smiley:

I guess for the choice of the point, you could try to get the next point of the path and from here randomely select a point in a certain radius as the next point. Using something like this would allow the ai to still go generally in the direction of the player, while not taking the shortest path