Hello. In the first image, the navigation takes him to the edge as she finds it "efficient", however, if she went like in image 2, he would straighten up and go through the obstacle. because the ant is able to turn depending on the direction to the target. How can i do this? Any ideas?
#How can I make "centered navigation".
27 messages · Page 1 of 1 (latest)
Best you can do is to make a border around the obstacles so that it’s forced to go further away from the obstacles. That’s the only way I know of to resolve the problem, have had it many times
I solved the problem by creating 2 identical tiles, 1 with a nav layer and the other without. As a result, under the obstacles, I put a copy of the tile but without the navigation layer
left - with
right - without
Yes that’s what I meant, good that you solved it by yourself 👍
Oops, I'm sorry I didn't answer that. This is what happens to a human when he sleeps for 4 hours instead of 8. My ant ignores the obstacle, but because he is on the edge, he clings to the collision and cannot move on. Also, it will look more organized.
And so I would like it to go between the obstacles in the middle, and not from the edge of any obstacle, depending on how close they are to the goal (as I understand it)
I have an idea to write my own navigation, but it will not be very funny if it turns out that I could somehow "configure" this navigation for such actions
I just can't place non-nav tiles around an obstacle. Because it's too narrow xD
Actually there is another idea. Make the collisions square so the ant slides, not polygonal. But I'm a masochist, for the sake of beauty I'm ready for anything.
Place a navlink between every obstacle 😂. Would be even more painful. I am sorry, but I don’t really know how to continue from here. Of course you can make the obstacles spaced further apart but you maybe don’t want to do that. My knowledge ends here
When I want the behaviour you're talking about, I use waypoints. For example, to get an agent to go down the centre of a straight corridor, place a waypoint in the middle of the doorway at each end. I only really work in 3D, so I have not tried this in 2D, but in theory it should be pretty much the same. Of course, this technique is not suitable for all scenarios. For example, it is not so good for some types of procedurally generated environments.
In the future, I plan to add procedural map generation to my game, so this may not be what I need. But thank you, knowledge is never wasted 😅
In what node is this setting? Wanna give it a try
Oh haven’t checked out 4.1 yet, cause I’m on a holiday. Looks really useful, thanks!
ohh this is actually something i was looking for
thanks!
Excellent. I had not used 4.1 enough yet to see that. Hopefully that is in the 3D NavAgent as well.
This pathfinding functionality exists in both Godot 4.0 and 3.5, the only thing that is newer is that the property is exposed on the NavigationAgent node.
It was always available as the old "optimized=true" boolean value of the get_simple_path() function in Godot 3.5 that switches between the corridiorfunnel and edgecentered path postprocessing. This is the NavigationServer.map_get_path() function in newer versions.