My friend L recently mentioned that he hadn’t seen any blog posts from me. It’s true, I haven’t posted for a while. Earlier this year I had explored signed distance field fonts, in particular using Viktor Chlumský’s multi-channel distance fields[1]. I really enjoyed the many experiments I did, and I learned a lot. I had intended to use it in a real game project but the timing wasn’t right. So I put it away. Then before I got started on a new project, life happened. I had to take a break and attend to other things. I haven’t been blogging because I haven’t had projects to blog about.
Then in July I started thinking about other places I could apply the font code. I thought back to my 2019 blog post about map annotations[2], where I observed that even small amounts of text added to a procedurally generated map could make the map much more interesting. I started dreaming up a new map generator. Broadly, the tasks would be along these four categories:
Procedurally generate a map that has interesting “point” features including chasms, volcanos, waterfalls, and towns.
Identify large scale “area” features on a map such as peninsulas, bays, and mountain ranges.
Generate names for both point and area features, tied into geography, history, cultures, etc.
Place labels on the map corresponding to these features.
Normally I’d approach this as separate steps, but I wanted to consider the possibility that these steps influence each other. For example what if I identify two adjacent mountain ranges that are each too small for a label? I could modify the map to turn these into one larger mountain range. Maybe I modify a label to match the size of the mountain range, or modify the mountain range to match the length of the label. Maybe I favor east-west oriented geographic features because it’s easier to read the labels for them.
Before I got too far, I wanted to get a sense of what the final maps would look like.
Seeing the end result can help me decide if this is going to be inspiring or mundane.
For now, I can manually identify features and generate names to get started.
I wanted to quickly get something running, the equivalent of rendering a triangle in a 3D world.
I used a static map image and then I drew text on top of it using my distance field font renderer from earlier this year:
Initial label test
That’s the “hello world” level for this project. The next step was to try text that I might actually want to render:
Outlined labels on a map
I decided yes, this would be a nice summer project.
The next step was to spend a lot of time reading about map labeling. I made notes for myself. I don’t normally share these notes because interpreting them is dependent on what’s in my head, but I’m going to share them here so you can get a sense of the kinds of notes I take while reading:
instead of force layout or simulated annealing, tries a bunch of possibilities in one pass
I’ll sometimes take parts of my notes and turn them into a proper page, but most of the time I don’t. I use text files instead of bookmark services because I want to be able to group things together in outline form. I hear good things about Obsidian[34] but I use emacs org-mode.
That’s just for step 2 of the four steps I listed. There are also lots of things to learn for step 3 and step 4. After reading all of this, I felt overwhelmed. Scott’s heredragonsabound blog is amazing, and you can see he’s put many years of work into these problems. I wanted a summer project, not a multi-year project. I decided the scope of this project was too large for me with my current skill level. To level up, I should work on smaller projects first.
So I started a one week project to manually place and style labels on maps, focusing on step 4. That was six weeks ago. I’m still working on it. I’ve had many more bugs and unexpected rabbit holes than expected. I’ll blog about them soon!