Thank you so much for this tutorial, I have been wanting to make a strategy game like panzer corps for a while but couldn't find any tutorials that worked well for me, this one is great so far though! After I finish this I intend to look at your civilization tutorials, they seem like they have lots of helpful info!
Many thanks on creating these video. I hope there will be more in the future. Curious if you can do hextile swap, like a forest tile transforming into a deforested area in real time.
Thanks for the suggestion! Sure basically you need to ensure that the GameObject representing the HexTile has as a Child Object the forest model. All you need to do is to swap it / remove it using *Destroy()* and *Instantiate()* methods. Thanks for watching!
I don't recall the code but that is the idea. I don't think that the end result would work without the condition being correct in the tutorial but let me know how it ended up!
Thanks for this great series of videos. How would you go about expanding this system to work with a 3D hex grid where a character could climb up or down hexes as well as traverse across them? Do you know of any asset/code available that would handle this?
It should be fairly easy. I would just introduce a check to A* (if you want to include the extra cost for this type of movement) and to the movement itself "Is the next hex on the same height as me?". In case of A* you just add some extra cost if the next hex is higher. During the movement you could add the check that when you want to start moving to the next hex and it is higher make the character play some climb animation when moving. In case it is moving down play the jump-down animation + move the character. I hope it helps!
Hey! Sure! I will be showing it soon in my Make Civilization tutorial series :) All you need is to create a grid out of the tiles on your tilemap. Ex make a "walkable" tilemap where all the tiles are meant to be walkable and you can use CellToWorld and WorldToCell methods from the Tilemap class to get the positions for your grid.
In the SelectionManager I had to add GraphSearch. to the front of the line BFSResult bfsResult = GraphSearch.BFSGetRange(hexGrid, selectedHex.HexCoords, 20); so ie :- GraphSearch.BFSResult bfsResult = GraphSearch.BFSGetRange(hexGrid, selectedHex.HexCoords, 20);
Hey! I just think about A* as a solution to "find me a shortest path" while BFS as " visit all the nodes that meets a condition and return me the result". I'm pretty sure that A* goes only in the direction of the destination so I'm not sure how you would make it go in any direction without removing the "move to Destination" part (I mean to get the movement range). I can be wrong ;)
If you mean an ion-game level editor you would approach it the same way that you would make any grid related building mechanic. I have this City Builder tutorial that should give you some idea about it ua-cam.com/video/8ayFCDbfIIM/v-deo.html . All you would need is a save and load system to persist the levels that you create.
I just want to tell you. I have started making my game and thanks to you i know how to make some stuff work. greetings from Tijuana :3
I'm very glad!
The most advanced unity tutorials! Very good quality and interesting topics!
I am glad you like it!
Thank you so much for this tutorial, I have been wanting to make a strategy game like panzer corps for a while but couldn't find any tutorials that worked well for me, this one is great so far though! After I finish this I intend to look at your civilization tutorials, they seem like they have lots of helpful info!
Glad I could help! Thanks for watching 😉
I love this series !
Thanks for watching!
Ohh very helpfull,
i am currently working on turn based game with hex grid)))))
Many thanks on creating these video. I hope there will be more in the future. Curious if you can do hextile swap, like a forest tile transforming into a deforested area in real time.
Thanks for the suggestion! Sure basically you need to ensure that the GameObject representing the HexTile has as a Child Object the forest model. All you need to do is to swap it / remove it using *Destroy()* and *Instantiate()* methods.
Thanks for watching!
@@SunnyValleyStudio interesting and thank you. Your knowledge of unity is amazing to say the least
At 4:00 shouldn't be 20 >= the cost instead
I don't recall the code but that is the idea. I don't think that the end result would work without the condition being correct in the tutorial but let me know how it ended up!
Thanks for this great series of videos. How would you go about expanding this system to work with a 3D hex grid where a character could climb up or down hexes as well as traverse across them? Do you know of any asset/code available that would handle this?
It should be fairly easy. I would just introduce a check to A* (if you want to include the extra cost for this type of movement) and to the movement itself "Is the next hex on the same height as me?". In case of A* you just add some extra cost if the next hex is higher. During the movement you could add the check that when you want to start moving to the next hex and it is higher make the character play some climb animation when moving. In case it is moving down play the jump-down animation + move the character.
I hope it helps!
Would this be possible to implement somehow while using Unity Tilemaps for the map?
Hey! Sure! I will be showing it soon in my Make Civilization tutorial series :)
All you need is to create a grid out of the tiles on your tilemap. Ex make a "walkable" tilemap where all the tiles are meant to be walkable and you can use CellToWorld and WorldToCell methods from the Tilemap class to get the positions for your grid.
In the SelectionManager I had to add GraphSearch. to the front of the line BFSResult bfsResult = GraphSearch.BFSGetRange(hexGrid, selectedHex.HexCoords, 20); so ie :- GraphSearch.BFSResult bfsResult = GraphSearch.BFSGetRange(hexGrid, selectedHex.HexCoords, 20);
Ahah nevermind I needed to move BFSResult struct outside of the public class Graphsearch
I am glad that you were able to fix it.
Is there any reason to use BFS instead of A*?
Hey!
I just think about A* as a solution to "find me a shortest path" while BFS as " visit all the nodes that meets a condition and return me the result". I'm pretty sure that A* goes only in the direction of the destination so I'm not sure how you would make it go in any direction without removing the "move to Destination" part (I mean to get the movement range). I can be wrong ;)
How would you build a level editor for a hex grid?
If you mean an ion-game level editor you would approach it the same way that you would make any grid related building mechanic. I have this City Builder tutorial that should give you some idea about it ua-cam.com/video/8ayFCDbfIIM/v-deo.html . All you would need is a save and load system to persist the levels that you create.
@@SunnyValleyStudio Thanks! Going to watch it now. Your videos are very helpful btw, great work!
Graph search part little bit gone far
Thanks for the feedback!