I am planning to build an open-world game building on hexagon maps. The player is supposed to start out with only seven visible hexes but can expand the field in any direction. Each hexagon is supposed to be able to change its appearance (i.e. texture and maybe even height). Also, the user is supposed to interact with the individual tiles (reacting to touch events / via Raycast method).
What are the best practices for this?
The two options I (as quite a Unity newbie) consider up to now are:
- Individual hexagon game objects (or hexagon prisms), spawned at runtime, or
- A procedurally generated plane with triangles to form a hexagon structure
While option 1) is arguably easier to implement (though, I manually need to place the hexagons) I am afraid I may run into performance problems once the map reaches a certain size. Sizes of well over 1000 tiles are to be expected.
For option 2) I am not yet quite sure wether it is feasible to individually change the appearance of each triangle/hexagon on the plane and how the map can be expanded during gameplay (starting with 7 hexagons, growing in all directions).
Can someone point me to useful resources? And what’s the best option in your opinion – or is there even a better way? I know there are quite a few frameworks in the asset store for Hex Grids – but I’d like to stick to free resources for now.
Thanks – and I’m glad for every hint!
Nicolas
Resources I found up to now:
- Procedural Hexagon Grid Framework, 50$ on asset store: Procedural Hexagon Grid Framework | Game Toolkits | Unity Asset Store
- Primitive Plus, a free add-on in the asset store which, among others, adds Hexagon / Hexagon prism game objects: Primitive Plus | 3D Characters | Unity Asset Store
- A great youtube tutorial how to make procedural planes: Unity 3d: TileMaps - Part 1 - Theory + The "Wrong" Way - YouTube
- An awesome article about Hexagons: Hexagonal Grids