Text Mapper

Text Mapper is a web app to quickly generate a map based on a textual description of the map. The result is an SVG file and therefore scalable.

There’s a Mastodon bot posting maps: @textmapper!

The source is available.

2019-10-21 Metainformation for an image

Recently, asked me whether it was possible to get from a dungeon map in Hex Describe to an editable map in Gridmapper. There wasn’t, but I liked the idea and so I started thinking about it. It should be doable in theory even though I am generating the dungeon maps using Text Mapper and all they have in common with Gridmapper maps is that they look similar.

So yesterday I started writing the code that transforms the Text Mapper data into a Gridmapper link. Once I could see it in the log output, I was happy. But what next?

I decided to add a HTTP header with that link, hoping that Hex Describe would be able to extract it, and I told J. Alan Henning that I had these instructions for him:

  1. generate map using Hex Describe
  2. use View Image to look at a dungeon map
  3. use Inspect Element to get to the development tools
  4. switch to the Network tab
  5. click the Reload button
  6. click on the new request line to see details
  7. in the Headers tab, there’s a section called Response headers
  8. in that list there’s a header called X-Link
  9. the value of that header is the Gridmapper link

It was late, I was tired, and I needed to sleep, obviously. 🙂

As the rendered image uses the SVG format, I alread had the input used in a comment at the end. Therefore, the link I just mentioned can be found right there. The X-Link code I had written was unnecessary and I removed it.

The instructions were in fact much simpler!

  1. generate map using Hex Describe
  2. use View Image to look at a dungeon map
  3. use View Page Source to look at the SVG code
  4. scroll to the end until you see the Gridmapper link

But then I realized that I could simply add the information the SVG output as a link! Within Hex Describe it’s hard to spot the link. It’s tiny:

Hex Describe output with link

If you use View Image, however, it gets bigger:

View Image

(If you click the image above, you might get taken to a different image because the seed I used is only guaranteed to work for as long as the code doesn’t change. My guess is that this won’t be stable for long!)

If you click the link in the top left corner, you’re taken to Gridmapper:

Image 3

I also need a way to add nice arrows to images using Gimp. Surely there is a better way!


Comments on 2019-10-21 Metainformation for an image

I was playing with Gridmapper the other day and was wondering about Switch Background and Toggle Floor commands. I couldn’t figure them out. Any hints?

– Ruprecht 2019-10-30 19:02 UTC

The Switch Background command (capital Z) toggles between various background options:

  • grey background (the default)
  • black background
  • white background
  • white background with grid
  • blue

The Toggle Floor command (hold Alt and use the arrow keys to move around) simply toggles the floor on or off. In other words, it’s the equivalent of pressing f and and arrow key repeatedly – it’s simply faster.

– Alex Schroeder 2019-10-30 22:46 UTC

Add Comment

2019-10-09 Ten random dungeons generated

With the random tables of J. Alan Henning and ktrey parker and Text Mapper with the Gridmapper algorithm (which knows how to create five room and seven room dungeons), and Face Generator, we have a funny little thing, now:

There are probably a gazillion things we could still add, but it’s already interesting. 🙂

Talk to us on Diaspora!

If you’re reading this in the future, check my profile for the latest thread called “Hex Describe, Face Generator, Text Mapper, and more” (see this old post for context).


Comments on 2019-10-09 Ten random dungeons generated

I like it! Looks very usable, especially with the yellow highlighting.

Jensan 2019-10-09 12:09 UTC

Thanks! Now that I look at the maps a bit closer I see that many of them are repeats. I need to think about the random number seed a bit more. I fear it’s simply taking the current time and passing it off to the mapp generator, which thus gets the same seed for every map. That’s not cool.

– Alex Schroeder 2019-10-09 13:50 UTC

This is killer Alex

froth 2019-10-15 18:54 UTC

Heh, all thanks to ktrey parker and J. Alan Henning who pushed me towards it because I was quite skeptical, and they wrote the random tables for it. Beautiful!

– Alex Schroeder 2019-10-15 20:36 UTC

This is another amazing resource for randomness – thank you. I use Hex Describe quite a bit to generate random entries for my D&D wilderness treks (using tables I have created from mash ups of existing material/adventures and my own mind) and am wondering how I would add in a chance of generating one of these dungeons? I’ve done a quick search of your wiki, the source file and can’t see anything specific – is it possible?

– VickyR 2020-01-07 20:27 UTC

It depends on what you want. If you’re already writing your own random tables, then it’s easy to simply add [dungeon] and it’ll add one to your entry.

  • the dungeon table (the tables below that show how the images with the maps are included)
  • the forest-hill table (the last entry uses the [dungeon] table)

– Alex Schroeder 2020-01-07 20:59 UTC

Thanks for this. Looking through the tables it’s an amazing piece of work by you and ktrey parker and J. Alan Henning. Much more complex that I usually create, but full of interesting ways of using code you’ve written. Thanks again.

– VickyR 2020-01-09 06:44 UTC

Thanks. 🙂

– Alex Schroeder 2020-01-09 06:48 UTC

Add Comment

2019-09-20 Ocean Hexes

I’m not interested in ocean hexes, I think. But Hex Describe would treat all water hexes the same: as a lake. And so you’d get the most useless hex descriptions for the open sea. The real problem was of course that Text Mapper would just generate water hexes and not differentiate between big lakes, coastal areas and the ocean. Well, one of these issues has been resolved, now: ocean hexes. And since no such table exists for Hex Describe (at least not in the “Schroeder” tables), this means that no description should get generated. At least I hope that’s what it means. 🙂

And visually:

Map with open ocean

I still have a little bit of a problem picking just the right hue of darker blue. If you have opinions, please comment with a color code. The existing Gnomeyland colours, if I remember correctly, are based on old Russian maps.

To generate maps with more water, set the bottom parameter to some number single digit number, e.g. 6.


Comments on 2019-09-20 Ocean Hexes

I actually really like the colors, and the more vibrant blues are pretty in contrast to the more neutral greens. The yellow on the hills has the same kind of enjoyable contrast.

I’d need to print it on a black-and-white printer to be sure, but it looks like you would be able to tell the hexes apart by tone even if you had trouble distinguishing the shade.

Anne 2019-09-21 04:20 UTC

Thanks for the feedback. 🙂

– Alex Schroeder 2019-09-21 15:24 UTC

Add Comment

2019-08-23 Gridmapper inside Text Mapper

Gridmapper is an interactive web application. You can use it to draw multi-level dungeon maps. The drawback is that you cannot use it to generate images in order to use them elsewhere.

A while ago I wrote a Megadungeon Generator which generates a random dungeon and allows you to open it in Gridmapper. That’s pretty cool, but I was still unhappy. The preview images I generated as part of it seemed to be on the right track: these were images, but much to small, and they didn’t use the Gridmapper tiles.

Recently, I added the ability to generate square maps within Text Mapper. Now all I was missing was the Gridmapper tiles and some encouragement.

The last few days, as I was talking with Brian Green, J. Alan Henning, and ktrey parker on Diaspora the topic turned to mapping again. ktrey parker suggested using the Face Generator or something similar for dungeon maps. Something smaller, combining geomorphs, something like the five room dungeon, not something big like Dave’s Mapper. Robin Green linked to The Nine Forms of the Five Room Dungeon | Gnome Stew, and started drawing sketches of the kinds of geomorphs we could use, how they’d fit together, and so on.

And suddenly... that was the kind of social enthusiasm I needed and I started writing code...

This is a new mapping algorithm for Text Mapper based on all of the above. It doesn’t do the special rooms Brian had sketched, yet; and it doesn’t always place the initial stairs correctly; and there are no “extras” such as pillars, chests, pits, and so on. But all of this can still be added.

As always with these algorithms, you can use them to generate a new text description for you to edit, or you can just keep reloading this link.


Add Comment

2019-08-06 Hex Describe, Face Generator, Text Mapper, and more

If you’re wondering where the discussion regarding Hex Describe, Face Generator, and Text Mapper actually happens, the answer might surprise you: it happens on the Diaspora network!

There, I create new threads every now and then for people who want to talk to me about these applications. They allow people to generate a mini-setting including a map, a key, and NPCs, with but one click, powered by the greatest collection of random tables I know. 😅

I keep creating these threads whenever the previous thread reaches about 100 comments because it starts being unwieldy.

Here’s a list if you want to explore:

You get the idea. 🙂


Add Comment

2019-07-08 Square Traveller

OK, square maps instead of hex maps, for Traveller, right?

This is the sort of map the Traveller Subsector Generator creates. It’s pretty good, I like it.

Original map

If you use the same data and rewrite it somewhat, you can use Text Mapper to generate the same map, but now with rounded communication and trade lines:

Hex map

And since Text Mapper recently got the ability of creating square maps instead of hex maps, all I had to do was fiddle a bit with the data, move the black frame around, move the labels into the correct positions, and we’re nearly there:

Square map

There are still so many things wrong: the symbols overlap the coordinates and the labels; the lines intersect the labels, so basically everything is terrible and unreadable at a second glance. But it will have to do for the moment. Perhaps if square Traveller maps make a breakthrough one day! 🤪

The map generated uses a separate map, Which in turn uses a separate library. If you want to regenerate, you need to put the following in the text area:

include https://campaignwiki.org/contrib/traveller-square-example.txt


Or take a look at the map and modify to taste.


Add Comment

2019-06-17 Text Mapper with Squares

I’ve been trying to see whether I could get Text Mapper to create a square grid instead of a hex grid. Preliminary results aren’t too bad!

This is the traditional example hex map:

Hex Map

And this is the result when you feed the same text into a square grid mapper:

Square Map

It already looks like magic!

The goal I have in mind is to generate square-based Alpine maps.

And maybe I could change my Megadungeon Generator wanna-be to use it as the output instead of Gridmapper. Once I have that, I can generate images using web services without relying on a browser rendering the Gridmapper Javascript code.

OK. Alpine maps. I mean, the algorithm often uses loops over the six neighbouring directions in order to create the textual description of the map, so that surely needs fixing.

Then again, once the textual description has been generated, the code no longer cares about hexes and squares, as seen above. It just looks – different.

Let’s give it a try.

Random Alpine hex map:

Alpine Hex Map

Same data, but using squares:

Alpine Square Map


It is in fact recognisable! Like some weird projection from a strange fantasy cartographer. Uncanny.

I’m not even sure I want to change anything at this point! A quick scan at this point just shows that cliffs don’t look too good (because the icon library still uses six different cliff icons).

Well, a bit more studying also reveals that some spatial relationships are disrupted, like the swamp for 0102–0201. Or the river that flows from 1204–1105 now makes a detour through the mountains of 1104.


Comments on 2019-06-17 Text Mapper with Squares

Those pesky fantasy rivers 😝

Ynas Midgard 2019-06-17 13:02 UTC

I love some of the U-turns these rivers are making. 🙄

– Alex Schroeder 2019-06-17 18:18 UTC

I’d love to see Text Mapper with squares evolve into a tool you could map a dungeon from a text source. This would be awesome. The hex based map is one of the best campaign building tools, I’ve ever come across, particularly when combined with Hex Describe to populate the Hexes. It would be great to expand on this by having a tool to generate dungeon maps based on a square grid.

– Stephen Peto 2019-06-17 18:21 UTC

Did you give Megadungeon a try? Reload it a few times until you get close to 100 steps and click on the last one. You’re sent to Gridmapper. Here’s an example I got after a bunch of reloads, three levels deep.

Gridmapper would make a pretty good tool for interactively making a dungeon, and Megadungeon could be improved as well. But unfortunately we cannot embed Gridmapper into Hex Describe. If we want to generate dungeon maps for Hex Describe, we’ll have to enable this via Text Mapper.

So in short: yes! This idea excites me!

Perhaps one day we’ll need a way to import Text Mapper maps into Gridmapper such that we can edit it there, and then export it back from Gridmapper to Text Mapper. That would be very cool.

– Alex Schroeder 2019-06-17 18:30 UTC

At last, the Alpine algorithm can deal with a square grid and hopefully all the river anomalies have been resolved, now!

Rivers work, now

Next: extracting the SVG for the Gridmapper icons and making them available for Text Mapper...

– Alex Schroeder 2019-06-17 20:17 UTC

Add Comment

2019-04-23 Maps inspire me

I sometimes like to look at those larger maps with fewer mountains. I start speculating about this village being so close to the chaos temple; the small settlements at the foot of mountains with temples of law; I love how the humans try to avoid settling the swamps; how one would travel up river to find the source somewhere high up... In this respect, a map truly serves as an inspiration for the game.

Generate some yourself using the Alpine generator for Text Mapper.

Click to enlarge!

Image 1


Comments on 2019-04-23 Maps inspire me

If you’re wondering about the algorithm: here’s how to show its limits: if you start with just one peak, and a large enough map, you get an island centered arouond a volcano.

Image 2

– Alex Schroeder 2019-04-23 13:08 UTC

Love this, I 100% agree. My gameplay and worldbuilding emerge from the maps I generate, not really as much the other way around.

Shelby 2019-04-23 15:54 UTC

That reminds me, can I add your blog to the Old School RPG Planet?

– Alex Schroeder 2019-04-23 20:54 UTC

Add Comment

2019-04-19 Text Mapper Tweaking

I’ve been working on Text Mapper again. The result is shown below. It probably only affects maps with a reduced number of peaks. In those cases, the altitude can drop down until it meets the sea. At those lower altitudes, I was seeing some strange effects:

Altitude is measured in integers and it drops slowly. That is, on your way to the sea you might see altitudes dropping like this: 4 4 3 3 2 2 1 1 0. Thus, it sort flows in “steps,” and the way I had written it, once a river flows into the next hex and this hex has the same altitude, a swamp forms. Thus it had a swamp on every second hex. In effect the map showed “stripes” of swamps.

The map also had no concept of “dry” land. As we move away from the mountains, however, there are fewer rivers. I was at a loss. How did the landscape look in ancient Germany, with fewer mountains and everything being flat compared to Switzerland? I hear the Romans thought it was heavily forested. But was it forest (dry ground) or swamp (wet ground)? I don’t know. So I went with forest. There can be swamps along the river, but without a river, there is no swamp. Right now, when I place a forest, it will grow up to two hexes into “dry” hexes without a river. In the image below, the forest on the left edge would be an example.

At the same time, I now had a better idea of what “dry” land is: that’s the land that isn’t mountains, or swamps (along a river) or forest. Just for variety, I decided it should have some hills (for a while I had 50% hills but that seemed like a bit much so I reduced it), and grass. I had seen some nice prairie pictures on social media and wanted some grasslands even thought I don’t think ancient Switzerland had grasslands. In the image below, the grass lands in the bottom left would be an example.

Anyway, as Hex Describe also uses these maps, I’ll have to think a bit more about grass land encounters! 🙂

Oh, and enjoy the temples of Law in the mountains and the temples of Chaos in the swamps! 😀

Image 1

If you are interested in the icons, take a look at the Gnomeyland example.

Oh, and for a weekly map, follow @textmapper. 🙂


Add Comment

2018-07-03 Rotating Text Mapper Maps

A user sent me a little NodeJS script to rotate a map in order to get “stacked columns”.

I wonder whether I should add a different hex stacking option to Text Mapper.


Add Comment



Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. Note: in order to facilitate peer review and fight vandalism, we will store your IP number for a number of days. See Privacy Policy for more information. See Info for text formatting rules. You can edit the comment page if you need to fix typos. You can subscribe to new comments by email without leaving a comment.

To save this page you must answer this question:

Please say HELLO.