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-smiles10 ай бұрын
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 Жыл бұрын
JMBIV, your tutorials are among the best on the web for serious learners. Thank you so much.
@jmbiv_dev Жыл бұрын
Thanks for the kind words! Appreciate them and so glad that these can still be helpful for you.
@CellarPhantom5 ай бұрын
Frikking awesome! Did you ever release the third video with adding dynamic obstacles?
@CellarPhantom5 ай бұрын
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 Жыл бұрын
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 Жыл бұрын
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.
@3booodpro2 жыл бұрын
thank u so much for this amazing tutorials
@jmbiv_dev2 жыл бұрын
Thanks for the kind words! So glad that these were helpful for you 🙂
@Agonnee2 жыл бұрын
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_dev2 жыл бұрын
Thanks for sharing, I'm sure others will find that very helpful!
@Liquid_Rigel7 ай бұрын
Any plans to continue this tutorial?
@longuemire7482 жыл бұрын
Thank you for this video, there is a solution when there is a staircase or slope?
@jmbiv_dev2 жыл бұрын
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!)
@longuemire7482 жыл бұрын
@@jmbiv_dev Thank you for these tips, I will work on them.
@frankoesavage83142 жыл бұрын
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_dev2 жыл бұрын
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!
@kiyu32292 жыл бұрын
Can we do this work in 2d ?
@jmbiv_dev2 жыл бұрын
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
@kiyu32292 жыл бұрын
@@jmbiv_dev thanks ! I will have a look at this :)