Pathfinding - Understanding A* (A star)

Поделиться
HTML-код
  • Опубликовано: 10 май 2024
  • Pathfinding can be a fundamental component of your game. Truly understanding how it works gives you fine-grained control of how units interact with the environment.
    Learn how A* pathfinding truly works by diving deep into the mechanics. We'll go step by step through each process as well as cover the edge cases not often talked about.
    Repo: github.com/Matthew-J-Spencer/...
    ❤️ Become a Tarobro on Patreon: / tarodev
    =========
    🔔 SUBSCRIBE: bit.ly/3eqG1Z6
    🗨️ DISCORD: / discord
    ✅ MORE TUTORIALS: / tarodev

Комментарии • 156

  • @brittinfontenot3544
    @brittinfontenot3544 6 месяцев назад +38

    I have a degree in Computer Science. I taught algorithm analysis in college. I've been a developer for more than 10 years. This is hands down the best introduction and demonstration to A* I've seen on youtube. Concise, comes with visual examples, comes with code, and comes wiht references to other videos. WELL DONE DUDE. You just made my day.

  • @Paul-zh2jp
    @Paul-zh2jp 2 года назад +69

    there aren't enough tutorials (in general) that just look at code and explain it. it feels like a better use of my time than watching someone type. ty for that. i'm also always surprised how your videos are about something commonly needed but that i've rarely seen covered

    • @Tarodev
      @Tarodev  2 года назад +14

      This is a topic I constantly flip back and forth on (explaining typed code, or typing live). I did a poll months ago and most people said they prefer it being typed live, as it shows the thought process better, but obviously more advanced devs prefer pre-typed. So I do a bit of both.
      Glad you liked it!

  • @chchappa
    @chchappa 2 года назад +92

    The time you took to make it so visual, I really appreciate it. I've never tried pathfinding and I am delaying its implementation in my own game just cuz it looked very difficult. But your explanation and way of showing so graphically for every step made it really helpful.
    Thanks and I hope this channel keeps growing.

    • @Tarodev
      @Tarodev  2 года назад +12

      Thanks for saying that! It makes the large time investment worth while.

    • @MatthewAWinston
      @MatthewAWinston 2 года назад

      ​@@Tarodev Clear thinking, clear explanation, and clear visuals. Top notch! Had me subscribe right away.

  • @JW-uu9je
    @JW-uu9je 8 месяцев назад

    Thank you kindly for the download. I followed both yours and Code Monkeys tutorials on grids and pathfinding. I learned a lot, but a lot is also way over my head. The download works seamlessly and I am excited to dive into the code! Thanks for all that you do :)

  • @lynnnr1319
    @lynnnr1319 2 года назад +1

    What a timely upload! I was just finishing writing some work and reviewing A* was one of the things I had left to finish it. Thanks for the great explanation and presentation!

  • @SpencerYonce
    @SpencerYonce 5 месяцев назад

    I can't thank you enough for this video. No one has ever made a video that made me fully understand the algorithm like this one. Simple and to the point. Thank you greatly.

  • @minigun62
    @minigun62 2 года назад

    This is exactly what I've been looking for thanks for the video man, really explains it nicely.

  • @thepizzafoogle5481
    @thepizzafoogle5481 2 года назад +1

    Thanks very much for this tutorial, its straightforward and explains things well!

  • @MegaLolStorm
    @MegaLolStorm 2 года назад +4

    I came across your videos a few weeks ago and ever since I was hooked. you explain concepts so well and so clearly. Keep up the great work!

    • @Tarodev
      @Tarodev  2 года назад

      Thank you so much! Glad to have you on board

  • @broneslav547
    @broneslav547 2 года назад +1

    Wow, great work! Pure and simple

  • @judasdedalosson8105
    @judasdedalosson8105 5 месяцев назад

    Wow really good explanation of the algorithm! Very informative and to the point. No unneccessary talking but still all the information needed! Great video! Thanks to you I understood simply how to implement this algorithm in just 20 minutes (stopping your video when coding myself)! Great video! Thank you very much!

  • @sc4334
    @sc4334 2 года назад +16

    I went from day 1 feeling like this was impossible, to day 3 creating my entirely own method of implementing A* pathfinding because of how you explained the rules so in depth. It's much better to have a video like this where it explains the concept and rules / fundamentals rather than just doing it and saying to copy it. Thank you very much for your work on this. Saved my life!

    • @Tarodev
      @Tarodev  2 года назад

      That's amazing man, well done!

  •  Год назад +1

    That was such a great explanation. Thank you 😊

  • @akmaludddin9281
    @akmaludddin9281 20 дней назад

    its either the viewer is smart enough to understand your video or your way of teaching is so good that even i can understand the A* pathfinding. but the most importantly, u give us the code :D I hope you all have a fun and great days, Thx!

  • @rize2137
    @rize2137 2 года назад +1

    Hey, wanted to say that I enjoy your simple format of these videos.
    Even tho I already understand topics you present it's still enjoyable.
    And these eye-candy effects and graphics do a lot!

    • @Tarodev
      @Tarodev  2 года назад

      Glad they are still entertaining even if you know the topic! Thanks mate

  • @Hassanali-jr4yb
    @Hassanali-jr4yb Год назад +1

    amazingly done & thanks i' have never done any algorithm myself but think this would be the first one, subscribed for more.

  • @d_ogo
    @d_ogo Месяц назад

    amazing, simply so good that it was enough for me to learn and also enjoy...

  • @MrJanos
    @MrJanos 2 года назад +1

    This was an extremely good video and the apps look REALLY educative and fresh! I have to learn and try to spread these programs for you! It is amazing how such simple applications can explain so much! MUCH LOVE FROM SWEDEN!

    • @Tarodev
      @Tarodev  2 года назад +1

      Thanks Jonas from sweden!

  • @SayedSafwan
    @SayedSafwan 2 года назад +1

    Amazing as Always!Keep it up!

  • @VikkersOlfsson
    @VikkersOlfsson Год назад

    Legendary A* walk through. A hero the people need!

    • @Tarodev
      @Tarodev  Год назад +2

      Thinking about re releasing this with a few editing fixes

  • @pa_de_queijo
    @pa_de_queijo 2 года назад

    You are SPETACULAR!
    Most simple/complete A* video I've ever seen.
    It just works as magic!

    • @Tarodev
      @Tarodev  2 года назад

      Ah, why thank you 😊

  • @PandemoniumGameDev
    @PandemoniumGameDev 2 года назад

    Nicely explained and a great presentation, subbed!

  • @stephenkirby6788
    @stephenkirby6788 2 года назад +1

    Top tier/very professional, in both production and subject matter explanation.

    • @Tarodev
      @Tarodev  2 года назад

      Thanks buddy

  • @_g_r_m_
    @_g_r_m_ 2 года назад +36

    I thought it was way more complicated, but it's pretty straightforward.
    btw i would like a video on optimization

    • @gadgetboyplaysmc
      @gadgetboyplaysmc 2 года назад +1

      Same would love a video on optimization. Sebastian has done something with Binary Trees apparently, but I couldn't get my head wrapped around it haha

    • @Tarodev
      @Tarodev  2 года назад +6

      @@gadgetboyplaysmc His implementation is very good (obviously, it's Sebastian), but I could certainly do it in the next video in a more beginner-friendly way.
      Or maybe I could just do a general binary tree video explaining how it works and mention at the end "By the way, you could use this to replace the F cost calculation in A*". I'll have a think

    • @shannonrowe9402
      @shannonrowe9402 2 года назад +2

      @@Tarodev One quick win is to change the processed list to be a HashSet, for quicker .Contains checks. And then yeah, a min heap tree for the search list, which takes a fair bit more work. It's also possible to convert everything to Burst and C# Jobs, including the heap - I've done it, but it sure took a lot of head-scratching and probably wouldn't make for an easily explainable YT video. Anyway, great job on this one making the general A* principles easy to understand.

    • @Tarodev
      @Tarodev  2 года назад +2

      @@shannonrowe9402 Ohhhh, the hashset is something I didn't think about! Very interesting.

    • @pliniomourao
      @pliniomourao 2 года назад +2

      I will just say but i don't recommend go into it without learning and playing alot, but implementing A* with JOBS (ECS) have an huge performance impact.
      I tested it and it's faster and can utilize all the threads your CPU may offer decreasing the amount of work for a result. Specially in bigger maps.

  • @nopens
    @nopens Год назад

    Thank you. I still have troubles understanding how it works but it does. My implementation on pygame does indeed find the shortest path after watching this video.

  • @ragerungames
    @ragerungames 2 года назад +2

    man this is amazing. Previous video I watched on A* was going above from my head and I couldn't understand the meaning of G and H cost, from this everything is clear from the first minute of the video. Thank you for creating amazing content. I can imagine where your youtube channel gonna be in near future!

    • @Tarodev
      @Tarodev  2 года назад

      Thank you so much! This is exactly what I set out to provide in this video, so that makes me happy 😊

    • @ragerungames
      @ragerungames 2 года назад

      @@Tarodev Hope to see some small game tutorial series (with intermediate concepts) on your channel in parts soon 😍

    • @Vastlee
      @Vastlee 2 года назад

      It's probably because the other tutorial said "H Cost". Here it's careful explained as Haych Cast. Much easier to comprehend.

  • @DerAua
    @DerAua 2 года назад

    Very good explanation!

  • @hagen.360
    @hagen.360 6 месяцев назад

    Very interesting!
    Thank you!

  • @julia_petcos
    @julia_petcos 2 года назад +3

    Mark my words this video is about to blowup

  • @datablob
    @datablob 2 года назад +2

    Excellent stuff as always!

    • @Tarodev
      @Tarodev  2 года назад

      Love you blobby

  • @istegal8079
    @istegal8079 2 года назад +2

    Hello, I would be very interested in the optimization follow up, and also in a fix for units moving through gaps vertically. I don’t really know how to explain it, but basically if two blocks are diagonal to each other the unit can pass between them, assuming you allow diagonal movement on a square grid

  • @gadgetboyplaysmc
    @gadgetboyplaysmc 2 года назад +2

    I swear to God, your videos are the best. I always loved watching Sebastian Lague's videos on these. You go into them with so much detail and I really appreciate it. What's the secret?

    • @Tarodev
      @Tarodev  2 года назад +2

      Even mentioning Sebastian in the same sentence as me is an honor. The secret is I get fueled by comments like this and seeing how I help people, so thank you!

  • @user-dg6ue1tx6w
    @user-dg6ue1tx6w 4 месяца назад

    You are a genius Sir, Salute!!!

  • @Fewnity
    @Fewnity 2 года назад +1

    Wow thanks you now I understand how A* works!

    • @Tarodev
      @Tarodev  2 года назад +1

      Mission accomplished :)

  • @CaptainGerBear
    @CaptainGerBear 8 месяцев назад

    I had to shave and finesse in order to get this to work in my project, but extremely helpful overall, thank you very much.

    • @Tarodev
      @Tarodev  8 месяцев назад

      Shaving and finessing is the perfect way to learn

  • @DanPos
    @DanPos 2 года назад +1

    Nice, will be sure to watch this on lunch later!

    • @DanPos
      @DanPos 2 года назад

      Awesome stuff and well explained - I actually prefer this method of not doing it the most optimised way at first, just to get your head around the concept, a lot of other tutorials out there set off to be the most highly efficient way of doing it but then it just gets confusing about what actually is the core basics of the algorithm. I'll have to check out the code monkey video on the job system version out of curiosity.

    • @Tarodev
      @Tarodev  2 года назад

      @@DanPos I started out with pure optimization and then when I went to explain it, it was way too convoluted. I'm glad I dumbed it way down. Code monkeys tutorial for example is hyper-optimized (the jobs one, not his first one), but very hard to follow for new devs.

  • @libberator5891
    @libberator5891 2 года назад +1

    I give this video an A*!!
    That intro though 🔥🔥🔥

    • @Tarodev
      @Tarodev  2 года назад

      That's cheesy bro

  • @hamedbabamohamadi9017
    @hamedbabamohamadi9017 2 года назад +1

    One epic music on an epic video! well done.

  • @star_smells6451
    @star_smells6451 Год назад

    Thankyou so much, I'm recreating a game in Roblox that uses A* path finding, this helped me to create my second version ever, (my first was technically by chat gpt)
    Although yes this is another language for code, my brain somehow translated it! THANK YOU FOR THE VISUALS TOO!!!! You deserve every subscriber and likes

    • @Tarodev
      @Tarodev  Год назад

      That's awesome 😂

  • @money_hyde
    @money_hyde 6 месяцев назад +1

    Jessussssssssss man FINALLY a video I understand

  • @robelso5646
    @robelso5646 Год назад +5

    Hey amazing tutorial! One small piece of constructive criticism, I think reading the code would be much more clear if instead of using the var keyword you used the variable type, other than that, stunning tutorial!

  • @pliniomourao
    @pliniomourao 2 года назад +1

    Very good explanation!
    You should think about adding a video for advanced users to turn your example/tutorial into JOBS as it can gain alot of performance.

    • @Tarodev
      @Tarodev  2 года назад +1

      It will certainly be in part 2, along with a few other tid bits :) Glad you enjoyed it!

  • @TheKr0ckeR
    @TheKr0ckeR 2 года назад

    I was always scared about A* algorithm, but this video explanation really makes me feel it's easy as f

  • @sseymour1978
    @sseymour1978 2 года назад

    Hexagonal grid and pathfinding there was rather tricky to implement. Did that 15 years ago in Flash.

  • @juke-duke
    @juke-duke 2 года назад +2

    This is great! Are you gonna be doing other pathfinding algorithims?

    • @Tarodev
      @Tarodev  2 года назад

      Yes I think I may. Or at least a quick comparison of a few popular ones

  • @Tharky
    @Tharky 2 года назад +1

    I literally had to code my own A* a few days ago and now you uploaded this :D I'm so sad.

  • @JoschinoDev
    @JoschinoDev 2 года назад +2

    Great Tutorial and great visuals, made it really easy to understand. Just one thing around 6:30 the bg music was a bit to epic/loud.

    • @Tarodev
      @Tarodev  2 года назад

      Yeah... you're right >< I'll keep an eye on that for the next videos

  • @Amonimus
    @Amonimus 12 дней назад

    Ah. Other videos only used a basic 2D grid, so this feels more understandable for practical usecases.

  • @RandomProduct
    @RandomProduct 2 года назад +3

    I know it's supposed to be a literal target, but all I can think is "oh man that octopus really needs to go to Target, what's he getting?"

    • @Tarodev
      @Tarodev  2 года назад +1

      He's getting a nice wall plant and bedside lamp

  • @andrewhamel1
    @andrewhamel1 9 месяцев назад

    Imma steal that "subscribe immediately" trick i didnt' realize I wasn't subbed

    • @Tarodev
      @Tarodev  9 месяцев назад

      YT really is a place where you need to prod people to subscribe. I watch content all the time which I enjoy and would totally subscribe, but I just don't think about it until they ask me.
      We are simple creatures and need guidance 😅

  • @imheretosleep
    @imheretosleep Год назад

    Hey I have a question and its very important for my study, I would like to ask if theres any other way to get the heuristic value without calculating distance? Lets say by sound? Like if a grid is emitting a sound or a signal then is it possible to use that grid as the heuristic without calculating the distance from the starting node to that signal?

  • @user-oc9be5bb2v
    @user-oc9be5bb2v Год назад

    Great video, but i have 1 last question: what a *current.Neighbors* array we have see in *foreach* loop on 4:38 ? How did you found the neighbors?

  • @Noctarc
    @Noctarc Год назад

    What would be the best way to implement this into the Game Grid Tutorial project?

  • @popingui2219
    @popingui2219 2 года назад +1

    Thank you for awesome guides! Started learning Unity with your videos on 2D Game Grid. Always wanted to make a puzzle-tactics game. One important noob question: is this a good idea to learn Bolt system? Or basic scripting is more efficient and better in the long run? It is quite tempting to learn visual system of Bolt but I am afraid it can lead a novice off track. It is also a bit confusing and timeconsuming to grasp both systems. Would appreciate your advice!

    • @Tarodev
      @Tarodev  2 года назад +1

      Learning Bolt will pigeon hole you into only being a visual scripting game dev. Learning to code means not only can you work on games, you can also get employment as a programmer anywhere. Strongly recommend learning to program my guy.

    • @popingui2219
      @popingui2219 2 года назад

      @@Tarodev Yeah, thanks. "There is no easy way out. There is no shortcut home!". A clean code also looks much better than those spaghetti-like arrows of Bolt!

  • @Hellishcaos
    @Hellishcaos Год назад

    Super curious if this can be converted to C++ to improve performance and smoothly match with Unreal Engine. I'm working on gathering the foundation pieces for an rts game and I need a pathfinding algorithm for it. So far I've discovered flowfields, deterministic lockstepping and this. In your opinion which of these would work best and why?
    For context, the game is supposed to have 2 to 8 players in a game at a time, with approximately 2000 actors assuming everything goes overboard and everybody maxes out on population count.
    Also looking for resources on rendering engines that handle lots of entities better than the current replication system.
    Sorry if this was long winded and thanks for the awesome video!

  • @FunkyTurtle
    @FunkyTurtle 2 года назад +1

    been working on A* for a couple of days now so your video gave me a great boost in the right direction!
    still have one problem tho,
    my algorithm (which looks exactly like yours)
    always gives me a path, but it's rarely the most efficient one,
    the path traced back from the end always seems to bump into a wall and then change direction instead of opting to go around it from the start. any tips as to how to debug my code?
    cheers

    • @Tarodev
      @Tarodev  2 года назад

      I'd say setup some debug lines (like I did) indicating the last few path calculations. It'll help you see what your silly unit it thinking. Also, ensure your distance calculation is correct as that can throw off the best path. For example if I just swap out my distance for vector2.distance it'll be way off. Maybe check out the package I provided for what I do.
      Not updating the G cost when it's more favorable can also give less-than-ideal paths. I know you said your code is the same, but I've seen a lot of attempts leave that out.

  • @longuemire748
    @longuemire748 2 года назад +1

    Thank you.

    • @Tarodev
      @Tarodev  2 года назад

      You are most welcome

    • @longuemire748
      @longuemire748 2 года назад

      @@Tarodev Excuse me, but If I understand correctly, we calculate the heuristic with the function GetDisctance(ICoords other) ?

    • @Tarodev
      @Tarodev  2 года назад

      @@longuemire748 That is where I do the distance calculation, yes. It's an interface method so that I can re-use the same pathfinding logic for all 3 tile types.
      H cost will be the estimated cost to the target, without taking into account obstacles.

    • @longuemire748
      @longuemire748 2 года назад

      @@Tarodev Thank you for this clarification.

  • @dipereira0123
    @dipereira0123 5 месяцев назад

    I have a question, how is the cost to neighbor and the cost to defined? the "G" and "H" do they stay stored or they are reprocessed everytime we run the code with a new origin and target?

  • @nikunev
    @nikunev 2 года назад +1

    I know A*, but the way you explained it is an ART! Even my cat would understand it and start to code :D BUT - the background music is probably unnecessary.

    • @Tarodev
      @Tarodev  2 года назад

      Since then I've learned what volume levels voiceover/music/sfx should be. Wish I could go back and change it :D

  • @cooperhardi4324
    @cooperhardi4324 10 месяцев назад

    Yes

  • @nottheguy4328
    @nottheguy4328 2 года назад +1

    So if I was trying to implement a system where there are different terrain types with varying traversal difficulties, would I want to have a multiplier assigned to the tile that would modify the G/H value calculated? How would you recommend doing that?

    • @Tarodev
      @Tarodev  2 года назад +1

      That's exactly how I'd recommend it!

  • @piedra13
    @piedra13 Год назад +1

    i wasnt comparing H if F were same, lol the improvement in time

  • @bales1569
    @bales1569 6 месяцев назад

    What do i do about the Neighbors, Walkable and GetDistance() red squiggly lines?

  • @blenderytrabajo5329
    @blenderytrabajo5329 3 месяца назад

    Claro que funciona asi pero la duda es como calcula si la cuadricula es valida o no

  • @fatmanboozer1760
    @fatmanboozer1760 10 месяцев назад

    I know this is old but i cant figure out how to use the iCoords interface. Or more accurately I think i am failing to set the Icoords. I am trying to pass it a vector2 but it doesnt like that, video doesnt really cover this bit, any where i can see something that does?

  • @TomDonahue
    @TomDonahue 2 года назад +1

    Came for the pathfinding. Stayed for the multiple pronunciations of "H" :D
    For real tho, fantastic tutorial.

    • @Tarodev
      @Tarodev  2 года назад +1

      This video was enlightening as I never knew I did that...

  • @_g_r_m_
    @_g_r_m_ Год назад +4

    Hey! I've been tinkering with optimizations for the heuristic cost function (the one that returns your G and H costs) and I've found out that using Manhattan algorithm yields significantly faster results, here's the function in case someone want's to try it.
    float Manhattan()
    {
    var dist = new Vector2Int((int)Math.Abs(from.transform.position.x - to.transform.position.x), (int)Mathf.Abs(from.position.z - to.position.z));
    return dist.x + dist.y;
    }
    float Manhattan3D()
    {
    var dist = new Vector3Int((int)Math.Abs(from.transform.position.x - to.transform.position.x), (int)Mathf.Abs(from.position.z - to.position.z), (int)Mathf.Abs(from.position.y - to.position.y));
    return dist.x + dist.y + dist.z;
    }

  • @xdcedar
    @xdcedar 2 года назад

    The nested `if` statement at 7:10 confused me a little bit since `!inSearch` appears twice there..
    How about splitting it into two parts? like this:
    ```
    if (!toSearch.Contains(neighbor)) {
    // set G and Connection
    // set H and Add Node
    }
    else if (costToNeighbor < neighbor.G) {
    // only set H and Add Node
    }
    ```
    It seems clearer to me ;)
    Oh wait..I come up with a better idea..Just pull the inner `if` statement out of the outer one:
    ```
    if (!inSearch || costToNeighbor < neighbor.G) {
    // set G and Connection
    }
    if (!inSearch) {
    // set H and Add Node
    }
    ```
    It works in the same way, but now there is no duplicate code or nested statement anymore~♪(´▽`) Easier to understand~

  • @CHEEZEyCHEEZE
    @CHEEZEyCHEEZE 2 года назад +1

    And how would you do something that is dealing with many floors? Like Stairs?

    • @Tarodev
      @Tarodev  2 года назад

      You add modifiers to the different types. Sand might have a modifier of 1.5, so the F cost would come out as more expensive. It would make your units favor roads and dirt etc

  • @pliniomourao
    @pliniomourao 2 года назад

    in 6:55 where do you first set the neighbor for the "startNode"?
    Reading the logic of it. it will never enter the first iteraction of the foreach, because "current.Neighbors" is empty. Unless before calling "FindPath", you already filled the neighbors of startNode.

    • @Tarodev
      @Tarodev  2 года назад +1

      The neighbours are cached at scene load, so you don't need to assign neighbours :)

    • @pliniomourao
      @pliniomourao 2 года назад

      @@Tarodev on the grid build right?
      In my thinking process:
      1. Construct the grid
      2. Define the Node data by working on their neighbors.
      Therefore when calling "FindPath", it is already there.
      Thanks.

  • @YulRun
    @YulRun 2 года назад +1

    How did you know I was going to look into A* this week as a simple pathfinding system for networked play?

    • @Tarodev
      @Tarodev  2 года назад

      I was looking through your window

  • @ntomsho4545
    @ntomsho4545 2 года назад +1

    Looks a lot like Dijkstra's Algorithm. Do you know why this is preferred over that algorithm in the gamedev space?

    • @Tarodev
      @Tarodev  2 года назад

      A* is an upgraded dijkstra. It adds the heuristic value to predict the best path available. It's not accurate every time but it certainly gives it a boost.

  • @abuzzakasm9767
    @abuzzakasm9767 5 месяцев назад

    What if i need every possible path not the closest path?

  • @dio8440
    @dio8440 2 года назад +2

    Literal greek god you are, very nice video

    • @Tarodev
      @Tarodev  2 года назад +1

      Aussie god*

  • @momissimo4087
    @momissimo4087 Год назад +1

    Hi, is the Grid created with the Unity TileMap?

    • @Tarodev
      @Tarodev  Год назад +1

      It is not, but you can still use this algorithm on a tile map

    • @momissimo4087
      @momissimo4087 Год назад

      @@Tarodev Thanks for the reply :)

  • @CHEEZEyCHEEZE
    @CHEEZEyCHEEZE 2 года назад

    How would you do it within a 3D space? For like flying agents?

    • @Tarodev
      @Tarodev  2 года назад

      Just swap the y plane for the z plane to convert it to 3D. Flying agents can generally skip walls, so that's easy :)

  • @Kalahee
    @Kalahee 2 года назад +1

    One thing that often annoys me in how A* (or pathfinding in general) is presented is how it is always presented on an hex or square grid. I'm sure you could use coordinates 10² per 1m² to make it work over any terrain, but somehow it wouldn't be natural or efficient, would it? I wonder if a supersampling method (Poisson Disk, Quasi-Monte Carlo, N-Rook) would make it a good alternative to classic grid.

    • @Tarodev
      @Tarodev  2 года назад +1

      A* should work on any node based grid as long as you can comfortably calculate the heuristic. Even using completely variable node distances.

  • @DrHeinzDoofenshmirtz
    @DrHeinzDoofenshmirtz Год назад

    Where does the intial music in this video come from?

    • @hexitcz
      @hexitcz 9 месяцев назад

      a year late, but hey
      better late than never
      Bonkers Beat Club - Ney Flute Type Beat

  • @jeroeno_boy
    @jeroeno_boy 2 года назад +3

    Here is something i always wonder, lets say you have 3 different tyles, water, road and dirt. You can drive over road and dirt, but dirt would be 3x slower. How would you calculate the fastest path to the target?
    My guess is that you add another variable, lets call it S. The road would have an S value of 3 and the dirt would be 1.
    With this the F variable would be G + H + S. Do you think this is a good way of calculating it? Or would you prefer another way?

    • @Tarodev
      @Tarodev  2 года назад +2

      Yes this is exactly how you'd do it. I've always called them modifiers, standard is 1. I multiply the cost by the modifier.
      It's quick and easy and has never given me troubles.

  • @mikhailnikolaev9927
    @mikhailnikolaev9927 Год назад

    But what if I have a big units, like 2x2? Let it be square grid.

  • @amidriki6717
    @amidriki6717 2 года назад

    Keep up the amazing work

  • @LeviAckerman-xt7dx
    @LeviAckerman-xt7dx 2 года назад +1

    Comment for RUclips algorithm

    • @Tarodev
      @Tarodev  2 года назад

      Thank you for your offering

  • @mrnotprofortnite4105
    @mrnotprofortnite4105 2 года назад

    the package and code link are not working. please reply me

    • @Tarodev
      @Tarodev  2 года назад +1

      Seems to be working for me. Here, I hosted it in another location for you: www.dropbox.com/s/yi9d845ffk3rkx3/Tarodev%20Pathfinding.unitypackage?dl=0

    • @mrnotprofortnite4105
      @mrnotprofortnite4105 2 года назад

      @@Tarodev thank bro

  • @Betruet
    @Betruet 2 года назад

    Man I just spent 2 days writing my own path finding system. It's nothing like this lmao. Not sure if its a good or bad thing... probably bad hahha

  • @seppukun208
    @seppukun208 Год назад

    Did you say class or cast?

    • @Tarodev
      @Tarodev  Год назад

      I have no idea babe

    • @seppukun208
      @seppukun208 Год назад +1

      @@Tarodev oh you said “cost”. Of course 🙄 to early in the morning for pathfinding algorithms 🤣

    • @Tarodev
      @Tarodev  Год назад

      @@seppukun208 did my Aussie accent throw you off? 😂

    • @seppukun208
      @seppukun208 Год назад +1

      @@Tarodev I’m Australian too so super lame that I couldn’t understand you 🤣

    • @Tarodev
      @Tarodev  Год назад

      @@seppukun208 haha, no excuse then brother 😂

  • @MrSambhav200
    @MrSambhav200 2 года назад +1

    I am too stupid to get this. Fuck!

    • @Tarodev
      @Tarodev  2 года назад

      It's a lot. Although the code is simple, grasping it all can take time. Just take it bit by bit.

  • @TheDzzirtuoz
    @TheDzzirtuoz 2 года назад

    Excuse me. It's a Squid Game?

  • @davidfoldberg8004
    @davidfoldberg8004 Год назад

    Terrible. Didn't even show pseudocode.