Setting distance from wall when generating a path

299 views
Skip to first unread message

Ermin Kreponic

unread,
Dec 19, 2017, 8:27:04 AM12/19/17
to recastnavigation
Hi all.

At the moment I am just generating paths with detour, and it does indeed create a path across tiles that can be followed.
The problem comes into being when it is moving close to a wall sometimes the height of the object moving is bigger then the corridor through which it passes. I would like to be able to configure not only vertical distance from a wall but just a general distance in all direction from a wall. And this to be taken into consideration. I have seen a post here from 2009 stating that this was planned to be implemented.

First question is: Is it possible to do what I have described above?
Second question: How would this be done?

Thank you all for your time and effort.

Jakob Botsch Nielsen

unread,
Dec 19, 2017, 8:44:41 AM12/19/17
to recastna...@googlegroups.com
Hi,

For the agent being too tall: this should not happen if walkableHeight is specified correctly. Try to make sure your actual agent height is a multiple of your cell height to
ensure you don't lose precision here.

In general the mesh erosion (rcErodeWalkableArea) should ensure the agent does not get too close to a wall. You can always specify a larger radius to this function
to erode the mesh more.

If you would like to control the distance-to-wall when paths are generated in Detour instead, then you will need to make some modifications yourself. There are multiple
ways to accomplish this. I suggest to shrink the portals during the string pulling algorithm (dtFindStraightPath) -- this has given me good results in practice, and is
pretty simple to implement. See http://digestingduck.blogspot.dk/2010/03/simple-stupid-funnel-algorithm.html to understand the string pulling algorithm.
The idea is that you can make the portals smaller during this algorithm, which will make the agent stay away from the walls of your mesh.

-- Jakob

--

---
You received this message because you are subscribed to the Google Groups "recastnavigation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to recastnavigation+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

@alisha

unread,
Dec 19, 2017, 8:57:19 AM12/19/17
to recastnavigation
Also checkout this fix:
https://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-bots-programs/wow-memory-editing/422616-code-fix-recast-path-keep-away-wall-corners.html

вторник, 19 декабря 2017 г., 16:27:04 UTC+3 пользователь Ermin Kreponic написал:
Message has been deleted
Message has been deleted

Jakob Botsch Nielsen

unread,
Dec 19, 2017, 9:11:04 AM12/19/17
to recastna...@googlegroups.com
Be careful with this method as it can create paths that go outside the corridor (and thereby mesh), requiring additional fix-ups.
(It seems my messages keep disappearing, let's hope this one goes through). 

Reply all
Reply to author
Forward
0 new messages