(Quick recap: the actual map is a set of irregularly shaped zones. For purposes of exploration, there’s a hexagonal grid. The map you see in play is the combination of these. But the part I have to create for a new game is the zone data.)
I figured that the basic metadata was easy enough to code by hand as Lua data, like this:
["Stones"] = {flags = kFeature},
I figured I could feed these to TexturePacker, and at the very least, get a file with the coordinates of each. Although I’m not using Corona, I tried using that as the export format, since it’s Lua-based. Sure enough, I got a Lua file with lines like
["Stones"] = 72,
-- Stones
x=1824,
y=301,
width=111,
height=48,
sourceX = 873,
sourceY = 678,
sourceWidth = 1500,
sourceHeight = 1375
},
I can easily read the two Lua files to get game-specific metadata and the image-specific data.
![]() |
Stones.png |
With the zone data available, hit-testing is a simple matter of a quick check for zones whose bounding box includes a point. If a zone passes, I need to load the PNG and see if the pixel is opaque or not.
Once hit-testing was in, I could finish the metadata. This was the tedious part of noting which zones were adjacent to other zones (which is used to figure out which clans are neighbors). I’ve worked on games where specialized tools analyze the data, but figured it wasn’t worth the effort for this particular map. It was worth the effort to visualize the data with an interactive debugging mode. Here, the zone NBE is selected, and its neighbors marked.
["NBE4"] = {neighbors = {"NBE2", "NBE3", "NBE5", "NBE10"}},

