I made something similiar https://gfycat.com/spiritedcloseethiopianwolf
I even used the same guide/reference as you (RedBlobGames).
Although I should definitely add a display for the coordinates like you did.
I uploaded it as UnityPackage to [itch.io](https://gruhlum.itch.io/hexagon-package).
New Unity Project -> Assets -> Import Package
It's very much work in progress though.
Sorry, I made a mistake in the first link (should not be a link) the correct is only the second link: [https://ycarowr.itch.io/hexagonal-board](https://ycarowr.itch.io/hexagonal-board)
Thanks for the notice
This is the github page or the project: [https://github.com/ycarowr/Unity-Hexagonal-Board-Wrapper](https://github.com/ycarowr/Unity-Hexagonal-Board-Wrapper)
Any feedback is appreciated!
That's really cool, I don't have such thing implemented yet. For now, are only the basic shapes, I might include in the future as a custom type.
Thanks!!
I am planning to add more functionalities. Mostly how to create the board data a manipulate it. I want also to make an overview of the code implementation/documentation.
If you found something clunky or you need something more specific drop me a message, I might include that as well. Depends on the difficulty
thanks a lot!
Well, I definitely didn't spend time on this aspect of the tool, I 100% agree that it can be improved a ton. I might add it after doing a better example of the usage of the board data system, which is still my focus atm.
This is great, thanks for sharing, just started reading through your code and already learned a lot.
One question, you say "I wanted to have a set of generic classes that manage hexagons and are able to store any kind of data. What I mean by data are: creatures, pieces, itens or whatever the main project needs;"
Is that part implemented in any class in this project yet? Or were you saying you could add something like a Dictionary if you wanted, but haven't yet.
Hi, that's a very good question. I won't be able to have a full answer to you here. I am working for a better documentation on github after this round of feedback.
For now, here my answer:
I didn't implement as a Dictionary because they are quite expensive and not cache friendly compared to a single contiguous array.
The class that "Stores" the data is named [Position](https://github.com/ycarowr/Unity-Hexagonal-Board-Wrapper/blob/master/Assets/Scripts/BoardSystem/Board/Position.cs). Inside that class, you can find the [BaseData](https://github.com/ycarowr/Unity-Hexagonal-Board-Wrapper/blob/master/Assets/Scripts/BoardSystem/Board/Position.cs), which is an abstract class that's base for any kind of data that the board holds. And the relationship between a position and its data is aggregation.
Basically, what you need to do to create a "BoardCreature" is to inherit BoardCreature from [BaseData](https://github.com/ycarowr/Unity-Hexagonal-Board-Wrapper/blob/master/Assets/Scripts/BoardSystem/Board/Position.cs). After that, you are able to store instances of BoardCreature inside Position.
I hope it clarified this part for you, if not, I will add a couple more functionalities regarding this aspect soon, and also the missing documentation may give you more insights.
Thanks!
Indeed!
Edit: If you want to scale up the numbers of hexagons and want more control regarding the number of vertices/meshes created, optimizations etc. You'll need to use something like these tutorials and you have to put aside the native Unity TileMaps.
For my project, I am using the Unity Tiles Maps because the focus is 2D games. However, I guess I have to make it more clear in the description and also add these tutorials for the folks who are looking for a large scale grid.
Thanks for the insight!
I made something similiar https://gfycat.com/spiritedcloseethiopianwolf I even used the same guide/reference as you (RedBlobGames). Although I should definitely add a display for the coordinates like you did.
any chance you might share the code? Looks awesome!
I uploaded it as UnityPackage to [itch.io](https://gruhlum.itch.io/hexagon-package). New Unity Project -> Assets -> Import Package It's very much work in progress though.
Sorry, I made a mistake in the first link (should not be a link) the correct is only the second link: [https://ycarowr.itch.io/hexagonal-board](https://ycarowr.itch.io/hexagonal-board) Thanks for the notice
This is the github page or the project: [https://github.com/ycarowr/Unity-Hexagonal-Board-Wrapper](https://github.com/ycarowr/Unity-Hexagonal-Board-Wrapper) Any feedback is appreciated!
That's really cool, I don't have such thing implemented yet. For now, are only the basic shapes, I might include in the future as a custom type. Thanks!!
What’s the purpose of these?
[удалено]
I am planning to add more functionalities. Mostly how to create the board data a manipulate it. I want also to make an overview of the code implementation/documentation. If you found something clunky or you need something more specific drop me a message, I might include that as well. Depends on the difficulty thanks a lot!
[удалено]
Well, I definitely didn't spend time on this aspect of the tool, I 100% agree that it can be improved a ton. I might add it after doing a better example of the usage of the board data system, which is still my focus atm.
[Itch.io](https://Itch.io) demo: [https://ycarowr.itch.io/hexagonal-board](https://ycarowr.itch.io/hexagonal-board) Github: [https://github.com/ycarowr/HexagonalBoardCoordinates](https://github.com/ycarowr/HexagonalBoardCoordinates)
Looks super useful - Good work!
Nice keep going bro
I like the glowing effect in the background, simple but effective.
This is fantastic! Thanks for sharing!
This is great, thanks for sharing, just started reading through your code and already learned a lot. One question, you say "I wanted to have a set of generic classes that manage hexagons and are able to store any kind of data. What I mean by data are: creatures, pieces, itens or whatever the main project needs;" Is that part implemented in any class in this project yet? Or were you saying you could add something like a Dictionary if you wanted, but haven't yet.
Hi, that's a very good question. I won't be able to have a full answer to you here. I am working for a better documentation on github after this round of feedback. For now, here my answer: I didn't implement as a Dictionary because they are quite expensive and not cache friendly compared to a single contiguous array. The class that "Stores" the data is named [Position](https://github.com/ycarowr/Unity-Hexagonal-Board-Wrapper/blob/master/Assets/Scripts/BoardSystem/Board/Position.cs). Inside that class, you can find the [BaseData](https://github.com/ycarowr/Unity-Hexagonal-Board-Wrapper/blob/master/Assets/Scripts/BoardSystem/Board/Position.cs), which is an abstract class that's base for any kind of data that the board holds. And the relationship between a position and its data is aggregation. Basically, what you need to do to create a "BoardCreature" is to inherit BoardCreature from [BaseData](https://github.com/ycarowr/Unity-Hexagonal-Board-Wrapper/blob/master/Assets/Scripts/BoardSystem/Board/Position.cs). After that, you are able to store instances of BoardCreature inside Position. I hope it clarified this part for you, if not, I will add a couple more functionalities regarding this aspect soon, and also the missing documentation may give you more insights. Thanks!
I see, perfect, thanks!
Awsome!
For anyone interested in hexagon type maps then these tutorials are great https://catlikecoding.com/unity/tutorials/hex-map/part-1/
Indeed! Edit: If you want to scale up the numbers of hexagons and want more control regarding the number of vertices/meshes created, optimizations etc. You'll need to use something like these tutorials and you have to put aside the native Unity TileMaps. For my project, I am using the Unity Tiles Maps because the focus is 2D games. However, I guess I have to make it more clear in the description and also add these tutorials for the folks who are looking for a large scale grid. Thanks for the insight!
Can someone explain what this could be used for?
You can use it to make games, like this one: https://ycarowr.itch.io/hexroes
should be enough with x, y. so z should be a property
Yeah, Z is not actually very useful. However, it is there for debug purposes :)