in Unity C# Open Source Editor extension ~ read.
Unity Hex Tile Editor

Unity Hex Tile Editor

A hex-based tile editor for Unity. Built for Bees Won't Exist.

During development of Bees Won't Exist it became clear we had a lot of environments to make, and modelling them by hand would take a huge amount of time. Our lead artist, David Upcher, had made a prototype model of a level made entirely from extruded hexagons which fit the setting of a giant beehive perfectly, but modelling it manually in Maya was still a very laborious task for a small section and performance wasn't great.

Eventually I decided to work with him to create a tool to help quickly make optimised meshes for levels in that format, and it paid off in spades in art time saved.


The initial version of the tool spawned each tile as a separate mesh, with side pieces automatically snapped to the adjacent tiles and UV coordinates relative to the whole map to support looping textures. This ended up causing a performance bottleneck though because, even though all tiles used the same material and could use Unity’s built-in static batching, the sheer number of objects in larger levels meant that the batching process was taking up a lot of CPU time. Combining all tiles into a single mesh also caused issues with overdraw, so eventually we worked out a middle-ground where tiles are grouped into chunk objects. The chunks are split up per material so can still be batched and drawn in a single draw call per material, but are also small enough that most can be culled when not within the view frustum.

Check out the source on GitHub.