Part of the reason MoteMancer didn't start with a map is because of how technically challenging it is to juggle hexagons and performance when you aren't working with a standard grid. What does a pixel even mean? Are hexagons expected to match the world? What's the best way to save a texture knowing a bunch of the space is likely to be wasted?
If I'm honest, I was secretly hoping that the in-world compass provided by Seismic Flare and the world flora leading you towards Mote Fields would be enough - there is a magic in the immersion of needing to navigate your world by landmarks alone. But, there are two major design reasons to add a map to MoteMancer:
- The Alchemical foundation of the game is not as intuitive a kit as a standard factory, but it is the conceit for the game and is unlikely to change. This is an important point because there are only so many things a player will bump into before they get too frustrated to continue. While I think the idea of a map-less experience is cool, having both mental burdens forced upon the player early can be too overwhelming.
- The world is infinite, so the concept of a land-marker is much harder to latch onto. Because the world is largely self-similar, getting a little lost can quickly lead to getting very lost.
Also it's one of the most player-requested features, which counts for a lot,
Always Back to Math
So the first idea I had was to fake a half-pixel offset in a resulting map texture using some clever mod-math like this:

Then our forums started discussing ways to get the pixels to look like hexagons, and shared a bunch of super cool shaders that let you do this:

And That's When it Fell Apart
I spent an entire day trying to get these two methods to play nicely with each other in a variety of ways and always came up just short of it working. I would either get an extra row here, or the wrong offset value there, it turns out that there's a lot of nuance in the width x height ratio of a hexagonal tiling grid. Mapping an orderly set of squares to that with proper offsets is just one too many balls to juggle.

I won't bore you with all the gory details, but here's a quick graveyard of some of the paths i tried and failed to get there with. I got close from a few different angles, but "close" and "correct" are not the same thing.
Giving Up?
I think it is super important to share when you try something and don't quite make it. It is always a very natural part of the creation process, especially when you are treading territory that is less traveled. I do think that simply offsetting by half a pixel is functional, and already something most people don't do, so is an improvement on just mapping a coordinate system to a square grid.
But........ after stepping away to work on another problem this morning, I received a flash of insight. I am spending an enormous amount of effort effectively trying to procedurally create a set of UVs with very specific values... and I know what the end result should be... which means logically I can just make it by hand. It's not actually that different from making custom Streamway or Grindstone UVs, and since I know exactly what shape/tiling/colors each hex needs to be, a single custom UV texture is all I need. It's definitely a little silly to take a very procedural-feeling thing and hit it with the art hammer, but I guess there's a great lesson in that - If you are a hammer, every problem looks like a nail, changing your tool can change your perspective completely. I was definitely so focused on solving the problem from the engineering angle that I didn't even consider solving it from the art angle.
Ever Towards the Horizon
Every hour spent in game development is opportunity cost, and compartmentalizing this problem to a single day helped me set it down to see the problem from a different angle. While I do have to move on to work on the larger feature I'm planning for an upcoming milestone, I have better perspective for how I'm going to solve this problem in the future (and honestly that could even be tomorrow). For now the player map is functional and I'm certain changing pixels to hexagons will happen in short order. Thanks to everyone for all of the resources and help with solving this problem. Even though I didn't get there, I learned a ton, and gave me enough perspective to find a novel solution that will work.

The Map still needs a little feature love but should be ready for Thursday's patch. If you want to see all the code snippets I tried, there's a fair few of them in Discord, and I'm sure a procedural solution exists out there if someone is looking for a hard problem to solve for fun :)
Back to the lab!
~CyanAvatar
