New Navigation in Godot 3.5: Avoiding Obstacles
Вставка
- Опубліковано 13 чер 2024
- Learn to Code from Zero, With Godot: gdquest.mavenseed.com/courses...
Godot Node Essentials (ultimate cookbook): gdquest.mavenseed.com/courses...
---
📚 THE LINKS
Godot 3.5 open-source demos: gdquest.github.io/godot-demos...
---
👥 CREDITS
Video edited by Nesi: / nesiawesomeness
---
💌 JOIN US
Come chat on Discord: / discord
Follow us on Twitter: / nathangdquest
---
📝 CC-BY LICENSE
This video is licensed under the CC-By 4.0 license: creativecommons.org/licenses/...
You can attribute it to "CC-By 4.0 - GDQuest and contributors - www.gdquest.com/"
Amazing, thank you for the constant great content you create!
great demo
The new navigation system in Godot 3.5 is amazing. Very easy to set up and performs pretty well out of the box.
This looks epic
What about if I want to avoid collisions with some of the other agents? For example, in an RTS I have multiple friendly units using pathfinding and I don't want them to collide with each other when they move. I'm guessing adding both agent and obstacle nodes to an object isn't going to work, right?
agents are counted as obstacles if you have avoidance enabled on them!
exactly what I needed, thank you!
I am on godot 4 and navigationobstacle2d's properties has changed and its not working for me please help.
Does this work for 3D ? every AI tutorial i find around about 3D is either only usable for single player mode only or is incredibly lag inducing when there are multiple AI agents.
Please update for godot 4.1 🙏🙏🙏
Hi, I downloaded the project and did some testing; the enemy doesn't seem to actually path around the obstacle. It just collides and slides off of it. Is there a way to make it actually path around it?
Yeah, I came to the same conclusion. If you take out all that physic and smoothing stuff and simply add the velocity from to the callback to the position, you see that the path finding completely ignores the obstacles.
Please update this for Godot 4, there is no examples of using these in godot 4 that I can find.
I've just come back from a break from Godot and this really helps thx
Is there any way to make turning slower? I mean, not make sharp turns but slowly avoid obstacles as if they were thicker and round for example.
Yes, you can play with several parameters:
- Increase the radius of obstacles. If you want to keep a collision shape that fits the obstacle, then turn off the detect radius option on the obstacle node and set the radius manually. You may need to lower the agents' radius, so they don't struggle to fix between an obstacle and the navigation polygon's limits.
- Increase the obstacle detection distance and the distance you can stray from the path on the agent. It'll try to avoid obstacles a little earlier (Path Max Distance).
- If you use your own steering code for the agent's movement, I would recommend playing with the drag factor. Lowering it will make the agent accelerate slower but also turn slower and move in smoother and wider curves.
Does this also work in 3D ?
The system works in 3D and the setup and code are similar, yes. In the provided open source demos, you'll find the 3D equivalents to this 2D project.
@@Gdquest Thank you
Your Github page is down.
Boosting for the algorithm
Too bad generating navigation polygons in 2D is very clunky, you have to either do it manually through the editor, or "manually" do it through code.
I'm surprised there's no simple one-button mesh baking like there is for the 3D mode, and I don't think there is a good reason for it
agree. its so time consume to do nav mesh in tiles.
@@tPlayerioT fyi, there is a 2d nav mesh baking in latest Godot 4.2 beta 1.
It should work with tiles too, haven't tried it myself
Donde puedo conseguir los archivos del proyecto ???
+
navigation 2d is deprecated, this doesn't work anymore
I did that in my project but my AI kept getting stuck on the objects while its chasing player that is on other side of the object it wants to avoid.. I expected more from this feature I even spent whole week trying to get it running... big disappointment for me. I ended up having to make AI going through objects which sucks but yeah well this engine can't deal with that reliably.
Also there is no way to make AI avoid static obstacles that are created at runtime which is something that engine should be able to handle.. you have to draw empty spaces inside NavigationPolygon to where static objects are which is disaster as every time I add new object I have to complete re-do whole NavigationPolygon - which also makes it impossible to do randomly generated maps. I love godot but making games with AI is nightmare.
Is it possible to make maincraft game through godot engine?
please ans me
1 year later