Drawing Our A* Grid in Godot 3D (Godot A* 3D Tutorial #2)

  Рет қаралды 6,424

jmbiv

jmbiv

Күн бұрын

Пікірлер: 21
@jmbiv_dev
@jmbiv_dev 2 жыл бұрын
Hey friends! A quicker video today, but one that hopefully helps add a lot of debug functionality to the A* system we made in the last video. Let me know if you have any questions/suggestions, and make sure to hop into the Discord server if you haven't: discord.gg/e4BxZbe
@rsk-smiles
@rsk-smiles 10 ай бұрын
Thanks so much for this and the previous video. A great help. What happened to the 3rd tutorial? I guess that you use a method in the Astar to mark a node has being inaccessible? You would have to do that at start up? Ray trace in the y axis looking for a collision with an object in a group called pathblocker? And then every time a character moved setting the node in which it is in as inaccessible so that other characters don’t share the same space?
@boerbol9422
@boerbol9422 Жыл бұрын
JMBIV, your tutorials are among the best on the web for serious learners. Thank you so much.
@jmbiv_dev
@jmbiv_dev Жыл бұрын
Thanks for the kind words! Appreciate them and so glad that these can still be helpful for you.
@CellarPhantom
@CellarPhantom 5 ай бұрын
Frikking awesome! Did you ever release the third video with adding dynamic obstacles?
@CellarPhantom
@CellarPhantom 5 ай бұрын
I managed to do it myself. with a similar function as add_point(pos: Vector3), but erase_point(pos: Vector3) instead. Used for placing object in real time (in running game). if astar.has_point(astar.get_closest_point(pos)): astar.remove_point(astar.get_closest_point(pos)) points.erase(world_to_astar(pos)) if debug_mode: _remove_nav_cube(pos)
@hotcrossbun26
@hotcrossbun26 Жыл бұрын
Nice tutorial. The point dictionary felt unnecessarily complicated to me (although others may disagree) but nice to see in action regardless. To connect my points I just looped through and got the distance between each point in the grid and if it was less than my step size (or diagonal step if you want diagonals) I connected them. Worth noting I was only using a rectangle for my purpose though and did not have multiple meshes of different sizes like in your demo. Anyway really love your videos, hope you start making more again soon my dude.
@Tempus64
@Tempus64 Жыл бұрын
The dictionary is so that you can get the id of a point and not add it more than once to AStar which, who knows, could have bad effects depending on what else you might be do. The function to check for that sort of thing is there for a reason even if we don't know why without investigating. Off the top of my head I would suspect it might make AStar slower as it could end up checking twice as many segments per point.
@3booodpro
@3booodpro 2 жыл бұрын
thank u so much for this amazing tutorials
@jmbiv_dev
@jmbiv_dev 2 жыл бұрын
Thanks for the kind words! So glad that these were helpful for you 🙂
@Agonnee
@Agonnee 2 жыл бұрын
Hey all! For anyone trying to center the nav points away from the edge without making the tiles unconnected I added an "offset point" and added it to the next_point calculation: var offset_point = Vector3(grid_step/2, 0, grid_step/2) var next_point = start_point + Vector3(x * grid_step, 0, z * grid_step) + offset_point Hope this helps someone!
@jmbiv_dev
@jmbiv_dev 2 жыл бұрын
Thanks for sharing, I'm sure others will find that very helpful!
@Liquid_Rigel
@Liquid_Rigel 7 ай бұрын
Any plans to continue this tutorial?
@longuemire748
@longuemire748 2 жыл бұрын
Thank you for this video, there is a solution when there is a staircase or slope?
@jmbiv_dev
@jmbiv_dev 2 жыл бұрын
Great question! You'll have to do a bit of work on your own, but you could create another group type (instead of "pathables," something like "inclines" or whatever), and then basically do the same X and Z loop that we do to make the grid for pathables, but then also add the Y direction too. You should be able to do this pretty easily if your slope/stairs have a fixed amount of incline, so just increment the Y value of your A* points by like 0.5 each time you go to another row of X or Z values. Hope that helps! We can help you out more in the Discord server too, if you need it! (Also worth mentioning that the new navigation server in 3.5 will probably let you do this by default, so try checking that out!)
@longuemire748
@longuemire748 2 жыл бұрын
@@jmbiv_dev Thank you for these tips, I will work on them.
@frankoesavage8314
@frankoesavage8314 2 жыл бұрын
I was wondering if you could make a tutorial like this except have a AI patrol instead of clicking the navigation mesh. Im stuggling trying to figure out AI Patrol. I have gotten some courses on Udemy thats got me to setup some Idle, Chase, Attack, and Death states though hasnt taught me how to make AI move on their own except with Chase. Is there anyway to do this? I tried making a Spatical node in front of my character and making paths towards the spatical, The ai only runs forward however. Then i tried rotatiing my character randomly , and failed.
@jmbiv_dev
@jmbiv_dev 2 жыл бұрын
That's a good question! I don't think I'll be able to make a tutorial on something like that anytime soon, but one thing you could try is calculating a random point a set distance away (say, like, 10 units). So if the player is at (0, 0, 0), try randomly getting a new X and Z value within 10 units (so you might end up at (8, 0, -2), for example). Then, have your unit move there. If that point is not a viable point in your A* grid, then the navigation function will take you as close to it as you can go. It helps when doing something like this to save the unit's original position, too (so (0,0,0) in this example) so that you always calculate a new patrol point around that original spot, rather than potentially letting the unit move further and further away from their origin. Hope that helps! If you join our Discord server, we can help you more there, too!
@kiyu3229
@kiyu3229 2 жыл бұрын
Can we do this work in 2d ?
@jmbiv_dev
@jmbiv_dev 2 жыл бұрын
Yes! It should be pretty easy to transfer the code into 2D, but I also did that exact same thing as part of my top down shooter tutorial. Even if you don't follow the rest of the top down shooter tutorial, you can still follow along with these specific videos (videos #20-23) and adapt them to your own game. Here's the link to the first one where we start writing the algorithm in 2D: kzbin.info/www/bejne/kGe0oKOBnreBgqc
@kiyu3229
@kiyu3229 2 жыл бұрын
@@jmbiv_dev thanks ! I will have a look at this :)
A* Pathfinding in Godot 3D (Godot A* 3D Tutorial #1)
42:02
How I Turned a Lolipop Into A New One 🤯🍭
00:19
Wian
Рет қаралды 10 МЛН
Зу-зу Күлпаш 2. Бригадир.
43:03
ASTANATV Movie
Рет қаралды 720 М.
Kluster Duo #настольныеигры #boardgames #игры #games #настолки #настольные_игры
00:47
Mom had to stand up for the whole family!❤️😍😁
00:39
How to Make a 3D Hexagon Grid in Godot (Tutorial)
21:58
jmbiv
Рет қаралды 21 М.
How To Shader (Fast) - using Godot Engine
7:10
PlayWithFurcifer
Рет қаралды 335 М.
Godot's Hidden Level/Map Editor
3:39
Garbaj
Рет қаралды 137 М.
How You Can Easily Make Your Code Simpler in Godot 4
6:59
Bitlytic
Рет қаралды 440 М.
Godot makes saves so easy!
2:26
GDQuest
Рет қаралды 105 М.
Simple Interactive Grass in Godot
13:17
Kasper Frandsen
Рет қаралды 35 М.
Finite State Machines in Godot 4 in Under 10 Minutes
7:16
Bitlytic
Рет қаралды 294 М.
Godot 4 - Forest Night Environment From Scratch
36:48
DevLogLogan
Рет қаралды 91 М.
13 ADDONS to SPEED UP your game creation in GODOT!
11:23
MrEliptik
Рет қаралды 109 М.
How I Turned a Lolipop Into A New One 🤯🍭
00:19
Wian
Рет қаралды 10 МЛН