Unity Pathfinding on a Hex Grid System!

Поділитися
Вставка
  • Опубліковано 3 гру 2024

КОМЕНТАРІ • 41

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  2 роки тому +1

    ✅ Get the Project files and Utilities at unitycodemonkey.com/video.php?v=XqEBu3un1ik
    🌍 Get my Complete Courses! ✅ unitycodemonkey.com/courses
    🔴 RELATED VIDEOS 🔴
    A* Pathfinding in Unity ua-cam.com/video/alU04hvz6L4/v-deo.html
    Grid System in Unity (How to make it and where to use it) ua-cam.com/play/PLzDRvYVwl53uhO8yhqxcyjDImRjO9W722.html
    Take your Skills to the NEXT LEVEL by making a Turn-Based Strategy game! (Unity Complete Course) ua-cam.com/video/QDr_pjzedv0/v-deo.html
    How to get Mouse Position in 3D and 2D! ua-cam.com/video/0jTPKz3ga4w/v-deo.html
    Awesome Grid Building System! (City Builder, RTS, Factorio, Survival) ua-cam.com/video/dulosHPl82A/v-deo.html
    Modular Character System in Unity (Move, Attack, AI, Pathfinding) ua-cam.com/video/mJRc9kLxFSk/v-deo.html

  • @dontoc4268
    @dontoc4268 2 роки тому +2

    You are the best youtuber I've seen in a long time! Some time ago I commented on one of your videos on how to convert the grid from square to hexagonal cells and now I see that you have already uploaded a video even of the pathfinding! You are an example of how all youtubers should be!

  • @bucketofgames5498
    @bucketofgames5498 2 роки тому +1

    You are on fire bro! All your videos have been top notch lately

  • @modiddymo
    @modiddymo 2 роки тому +1

    Taking your Turn-based strategy course now. Really tight. Learning a lot. Good work 😊

  • @ChadAKA
    @ChadAKA 2 роки тому +1

    Thank you so much for this and can't wait for the course to be updated course, I even have my hex grid working already but I'm sure ill learn a ton from them. That Manhattan distance was tripping me up for so long as well. Your way is way better then what I was trying. This works great.

  • @NewEonOrchestra
    @NewEonOrchestra 2 роки тому

    Gosh darn it I just did this myself about a couple weeks ago, adapting your own older A* pathfinding video. Will still definitely have to give this a watch, though!

  • @Sylfa
    @Sylfa 2 роки тому +4

    I *was* a bit curious about what this one would be about, seeing as A* is a graph search/traversal algorithm so it's not limited to grids at all. You can use it to find the shortest path even with teleports, non-euclidean geometry, or even straight up text adventure style room to room connections. Was a good summary though. Perhaps something like terrain modifiers and units being unable to traverse certain terrains could be interesting to do a video about?

  • @vladzatoloka
    @vladzatoloka 2 роки тому +10

    I'm really sorry for a negative comment, but it just grinds my gears to see pathfinding choosing a non-optimal path on this video's thumbnail 🙃

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 роки тому +4

      Oh heh good point I didn't even notice that! I was just focused on making an interesting path shape

  • @pablomirandaandrade3712
    @pablomirandaandrade3712 2 роки тому +1

    Hey!, I just started working on a hex project and I've watch all your hex related videos and they are super helpful!, If you are working with hexes too you should give a read to catlike tutorials on the topic too!

  • @IJH-Music
    @IJH-Music Місяць тому

    Code Monkey doesn't know Ctrl + H?
    Every IDE uses this shrotcut!
    You're Welcome ;)
    Messy tutorial, but it still helped. Thank you!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Місяць тому

      What is Ctrl + H? Find and replace? Yeah I don't want it automatically replacing things, I want to go through it one by one to verify that I want to replace it.
      Although I do use Ctrl + R + R a lot to rename things since that one only renames the exact symbol

  • @MarushiaDark316
    @MarushiaDark316 2 роки тому

    Super cool. Thank you. Does this mean the next video is going to be placing buildings on a hex grid? :D

  • @phonkis-design
    @phonkis-design 2 роки тому +1

    Pretty good video. I would love for new videos to be about these algorithms. Because I wanna make world war strategy games (3d) with hexagonal tileset but idk that how to start to make hexagonal in unity besides how do you think I should start

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 роки тому +1

      For the visual you can look at how I made the Grid Tilemap unitycodemonkey.com/video.php?v=gD5EQyt7VPk
      Just learn about dynamically generating meshes unitycodemonkey.com/video.php?v=11c9rWRotJ8

  • @woody_thelegend8494
    @woody_thelegend8494 2 роки тому

    I'm starting out in the playlist but I have caught a snag at the beginning. Looks like you are calling MeshUtils.CreateEmptyMeshArrays. I can not find this reference in any of the scripts provided in the Utils package. I can't get the heatmap system to work properly.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 роки тому +1

      The videos in the playlist werent really planned ahead of time, I just keep adding things as I use the Grid System, so some things were made off screen. Those MeshUtils aren't part of the standard utilities, I made them in some video but can't remember where.
      But you can download the project files for this video and inspect all the source code.
      That function just pre-allocates all the arrays that are necessary and then uses them to generate the mesh.

    • @woody_thelegend8494
      @woody_thelegend8494 2 роки тому

      @@CodeMonkeyUnity Thank you! I was able to find it in the project files, for some reason my brain thought utils off the website haha. I'll get it working today for sure.

  • @LesusX
    @LesusX Рік тому

    Hello Code Monkey! Just finished the grid series and it was excellent! I was wondering, If we have a game with an "enemy AI" would you recommend this A* script or a BFS script?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому

      Hmm I'm not familiar with BFS, looks like it's a tree searching algorithm. I guess technically it can be used for pathfinding but that seems like an odd approach

    • @LesusX
      @LesusX Рік тому

      @@CodeMonkeyUnity Thanks for the reply! There is not much in regards to enemy grid movement on youtube and from the few videos I have seen both A* and BFS are used. Thats why I was wondering how the two compare. Anyways A* seems to be the best approach, thank you again for the fast reply!

  • @bigjamar
    @bigjamar 2 роки тому

    Excelente trabajo

  • @aviralbhattacharya6258
    @aviralbhattacharya6258 2 роки тому +1

    Gooooood 🎉

  • @mehmetsancar2838
    @mehmetsancar2838 2 роки тому

    Is there an automatic translation of the course or any other option? My english not bad but somotimes can be difficult to understand. Thank you,

  • @MomoVader
    @MomoVader 2 роки тому

    thx :)

  • @yehyabakour8332
    @yehyabakour8332 2 роки тому

    Hey ,I am making a wifi hotspot local multiplayer PvP for pc and android (crossplay if possible)
    Can i use netcode for that?
    if yes can you give me some general directions and guidelines on how to do it because i searched alot on this with no clear (and free😅) result

    • @S_Tadz
      @S_Tadz 2 роки тому +1

      There's an official unity tutorial just out like 1 or 2 weeks ago (totally free)

    • @yehyabakour8332
      @yehyabakour8332 2 роки тому

      ua-cam.com/video/oN2c9teXi7M/v-deo.html
      You mean this one 🤔🤔
      I didn't think it covers this thing will chick it out thanks

    • @Sylfa
      @Sylfa 2 роки тому +1

      And the answer is yes, yes you can use netcode for gameobjects for local multiplayer with crossplay.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 роки тому +1

      Sure you can make a connection to any IP you want, can be a local IP for local multiplayer just like I used in testing playing with both my Laptop and my PC

    • @yehyabakour8332
      @yehyabakour8332 2 роки тому

      @@CodeMonkeyUnity
      Ok thank you
      I was delaying this for few months now and the game is now almost ready with no multiplayer in it😅😅

  • @Kevinaya
    @Kevinaya 2 роки тому +1

    U really like your hexagons don't u

  • @jud.su.5developer895
    @jud.su.5developer895 2 роки тому

    ❤❤

  • @MarekNijaki
    @MarekNijaki 2 роки тому

    Up

  • @chloechristley8335
    @chloechristley8335 Рік тому

    Not really Unity Pathfinding on a Hex Grid, more of "How to convert my pathfinding system to use a hexgrid"

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +1

      Uh? Yes I covered the entire A* algorithm in a previous video and used a Rect grid to make it simple and in this one I converted that to Hex. unitycodemonkey.com/video.php?v=alU04hvz6L4