News › Forums › RAIN › General Discussion and Troubleshooting › Pathfinding problem
This topic contains 28 replies, has 3 voices, and was last updated by prime 1 month, 2 weeks ago.
-
AuthorPosts
-
May 30, 2022 at 9:41 pm #26485
hmmmmmm… and I could use the example on the wiki. I like it.
December 22, 2022 at 2:45 am #34869Hello. I have a new old problem. Units cannot find path to target at usual flat surface.
There is an area inside red lines (screen 1)
No any obstacles at this area.
White spheres are nav targets for 3 units (selected from user input). Unit’s motor shows “Running” state at BH tree. Also there is huge performance impacts (non regular) at this case (pathfinding?). Units are running at their places infinitely.
December 22, 2022 at 2:56 am #34870December 22, 2022 at 5:12 am #34872I found the solution. Its a magic parameter Step Up Height for motor. Its fully not intuitive parameter that determine the difference between real landscape and approximated by RAIN. Thus, a small hole in landscape was a real problem for pathfinding solution. Perhaps, if the graph is only one, it would be possible to exclude the influence of this parameter?
December 22, 2022 at 7:42 am #34874And another new small feature. When I set moving target twice (change target while moving) units move forward the target without taking into account obstacles.
- This reply was modified 2 months ago by uservs.
December 22, 2022 at 12:03 pm #34878I wouldn’t say step-up height is a magic parameter - and it doesn’t quite do what you think. What it does impact is how the navmesh is created with respect to how high you think your character can step up, based on its rig. If the difference in height between two adjoining grid cells is greater than the step up height, then they will be disconnected on the graph.
Step up height also impacts how far below a navmesh your character can get before it no longer thinks it is on the navmesh. If the character base (ai.Body) transform is lower than the (navmesh y value - stepupheight) then the AI will ignore the navmesh.
When a target is moving, the AI does not ignore obstacles. It does repath, but it continues to walk the previous path until a new path is found.
I’ll also mention that the distance you are showing between the visualization of the navmesh and the actual ground is pretty much irrelevant. That’s just a visualization issue, so I wouldn’t worry too much about it. You can change it by adjusting the visual height offset.
We’d be more than happy to take a look at the problems you are encountering and give specific explanations and offer solutions. You could send us over the scene you are experiencing issues with, or you could send us a test scene that demonstrates a similar issue.
Also, make sure you are running the latest RAIN - we’ve been patching a few pathfinding bugs recently. 2.1.7.2 as of this post.
Thanks
- This reply was modified 2 months ago by prime.
December 22, 2022 at 1:12 pm #34881I set Step Up Height to some large value (100f) and problem was resolved.
Today I downloaded RAIN 2.1.7.2 package and updated my project from 2.1.6.1. I found new problem with frequent mouse clicks. Each mouse click changes target for Move action through working memory Vector3 variable. After first target selection units are moving correctly. Next 1-2 quick clicks are provide a bug with path planning. Units try to move to the target directly. Unfortunately I cannot send full project for you. Maybe I can do a little test. This bug is new in 2.1.7.2 version. I tested this problem for 2.1.6.1 and bug was not detected.December 22, 2022 at 1:34 pm #34882I think we’ll need to see some example or a way to reproduce the problem behavior in order to help. At the moment I don’t know how to reproduce what you are seeing.
December 22, 2022 at 4:22 pm #34884Okey. I have created a test project. How to transfer it to you?
December 22, 2022 at 5:27 pm #34885January 6, 2023 at 1:53 am #34991Hello guys. Is there any news about this issue?
January 6, 2023 at 10:56 am #34998Based on what I saw in the video - here’s what I think is happening:
1) There are lots of gaps and holes in your nav mesh, and lots of disconnected pieces.
2) Many times the AI are not standing on a navmesh when pathfinding starts. In that case, the AI attempts to reverse pathfind from the target back to the AI and picks the closest on-mesh point that it can.
3) The reverse pathfinding often fails because the closest point is on the other side of a building. Occasionally one of the AI will find a path and correct itself. That happens when the AI “accidentally” moves onto a small piece of connected navmesh and is finally able to generate a valid path.It would be useful in the videos to have you show the actual navmeshes that make up the scene. Without them it is hard to tell what’s going on.
There’s one issue that may be impacting performance we might be able to help with - something I’m looking into and I’ll get back to you on. But again, generally it appears as though the navmesh itself is not good and that the AI is being asked to pathfind from off mesh locations.
January 6, 2023 at 11:38 am #34999There are holes from houses (obstacles) with colliders. I dont know how to start pathfinding from offgraph place in this scene. Navmeshes in test scene and in my are identical. Units are at walkable places (ongraph) and navtarget too. There is a new problem only in 2.1.7.2.
Navmesh (identical with test, no recalculation):
January 6, 2023 at 2:49 pm #35000Yep - you are correct. There’s a real issue here. We’re fixing it right now. Thanks for being persistent on this one.
-
AuthorPosts
You must be logged in to reply to this topic.