Text Mapper

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

Check it out:

The source is available.

2016-08-16 Alpine Map Generator

I’ve been working on the Alpine map generator some more. It uses Text Mapper to render the output into an SVG image and it uses the Gnomeyland icons by Greg MacKenzie so it looks nice. Sadly, I’ve developed a pathetic obsession about getting it “right”. To illustrate my obsession and to help me fight it, let me document what I’m talking about. This is a “bug” I just fixed.

Here’s the old map:

The old map

What’s wrong you ask? I was confused by the canyon carved into the mountains from lake 17.04. I expected it to flow into 18.05. Let’s check the height map before lakes start flooding, looking for an outlet:

The initial setup with arrows pointing where the water wants to flow

Why would the river flow from 16.03 (height 7) to 15.04 (height 9)? This makes no sense.

So I studied my debug logs:

Lake started with 1704
Candidates: 1704
Looking at candidate 1704
River now: 1704
A neighbor of 1704 is 1804 with target 1704
Adding 1804 to our lake because it empties into our lake; the river leading here: 1704 1804
A neighbor of 1704 is 1603 with target 1704
Adding 1603 to our lake because it empties into our lake; the river leading here: 1704 1603
A neighbor of 1704 is 1803 with target 1704
Adding 1803 to our lake because it empties into our lake; the river leading here: 1704 1803
A neighbor of 1704 is 1703 with target 1704
Adding 1703 to our lake because it empties into our lake; the river leading here: 1704 1703
A neighbor of 1704 is 1705 with target 1704
Adding 1705 to our lake because it empties into our lake; the river leading here: 1704 1705
A neighbor of 1704 is 1604 with target 1704
Adding 1604 to our lake because it empties into our lake; the river leading here: 1704 1604
Candidates: 1804 1603 1803 1703 1705 1604
Looking at candidate 1804
River now: 1704 1804
Adding lake 1805 to our candidates: 1603 1803 1703 1705 1604 1805
A neighbor of 1804 is 1905 with target 1805
Adding 1905 to our lake because it empties into our lake; the river leading here: 1704 1804 1905
A neighbor of 1804 is 1904 with target 1803
Adding 1904 to our lake because it empties into our lake; the river leading here: 1704 1804 1904
Candidates: 1805 1603 1803 1703 1705 1905 1604 1904
Looking at candidate 1603
River now: 1704 1603
A neighbor of 1603 is 1602 with target 1702
Adding 1602 and 1702 to our lake, but need to explore
We flowed back into the lake via 1704 1603 1602 1702 1703
... 1702 is a new candidate with river: 1704 1603 1602 1702
... 1602 is a new candidate with river: 1704 1603 1602
Back at 1603 with river 1704 1603
A neighbor of 1603 is 1504 with target 1505
Adding 1504 and 1505 to our lake, but need to explore
Adding 1506 to our lake and keep exploring
Adding 1606 to our lake and keep exploring
Adding 1707 to our lake and keep exploring
Adding 1807 to our lake and keep exploring
Adding 1808 to our lake and keep exploring
Adding 1909 to our lake and keep exploring
Adding 2009 to our lake and keep exploring
Adding 2010 to our lake and keep exploring
Adding 2110 to our lake and keep exploring
Adding 2210 to our lake and keep exploring
Adding 2211 to our lake and keep exploring
Adding 2212 to our lake and keep exploring
Adding 2313 to our lake and keep exploring
Adding 2413 to our lake and keep exploring
Adding 2514 to our lake and keep exploring
Adding 2614 to our lake and keep exploring
Adding 2715 to our lake and keep exploring
Adding 2716 to our lake and keep exploring
Adding 2816 to our lake and keep exploring
Adding 2817 to our lake and keep exploring
Adding 2918 to our lake and keep exploring
Adding 2919 to our lake and keep exploring
Adding 3019 to our lake and keep exploring
Adding 3120 to our lake and keep exploring
Adding 3220 to our lake and keep exploring
We left the map via 1704 1603 1504 1505 1506 1606 1707 1807 1808 1909 2009 2010 2110 2210 2211 2212 2313 2413 2514 2614 2715 2716 2816 2817 2918 2919 3019 3120 3220
Arrows for 1704 should now point to 1603
Arrows for 1603 should now point to 1504

The key is the list of candidates after looking at the first round of neighbors: 1804 1603 1803 1703 1705 1604. These are sorted by height, 16.04 is last, which is great. But it also means that 16.03 (wrong direction: east into the mountains) is the equivalent of 17.05 and 18.04 (south east, towards lake 18.05).

Clearly, I needed a better sorting algorithm for the next candidates to look for: the candidates at the same level needed to be sorted by their lowest neighbor which had not already been looked at.

A bit later:

Lake started with 1704
Candidates: 1704
Looking at candidate 1704
River now: 1704
A neighbor of 1704 is 1803 with target 1704
Adding 1803 to our lake because it empties into our lake; the river leading here: 1704 1803
A neighbor of 1704 is 1804 with target 1704
Adding 1804 to our lake because it empties into our lake; the river leading here: 1704 1804
A neighbor of 1704 is 1705 with target 1704
Adding 1705 to our lake because it empties into our lake; the river leading here: 1704 1705
A neighbor of 1704 is 1703 with target 1704
Adding 1703 to our lake because it empties into our lake; the river leading here: 1704 1703
A neighbor of 1704 is 1603 with target 1704
Adding 1603 to our lake because it empties into our lake; the river leading here: 1704 1603
A neighbor of 1704 is 1604 with target 1704
Adding 1604 to our lake because it empties into our lake; the river leading here: 1704 1604
lowest neighbor of 1703 is 1702
lowest neighbor of 1703 is 1702
lowest neighbor of 1703 is 1702
Candidates: 1804 1705 1703 1803 1603 1604
Looking at candidate 1804
River now: 1704 1804
Adding lake 1805 to our candidates: 1705 1703 1803 1603 1604 1805
A neighbor of 1804 is 1905 with target 1805
Adding 1905 to our lake because it empties into our lake; the river leading here: 1704 1804 1905
A neighbor of 1804 is 1904 with target 1803
Adding 1904 to our lake because it empties into our lake; the river leading here: 1704 1804 1904
lowest neighbor of 1703 is 1702
lowest neighbor of 1703 is 1702
lowest neighbor of 1703 is 1702
Candidates: 1805 1705 1703 1905 1803 1603 1604 1904
Looking at candidate 1705
River now: 1704 1705
A neighbor of 1705 is 1706 with target 1707
Adding 1706 and 1707 to our lake, but need to explore
Adding 1807 to our lake and keep exploring
Adding 1808 to our lake and keep exploring
Adding 1909 to our lake and keep exploring
Adding 2009 to our lake and keep exploring
Adding 2010 to our lake and keep exploring
Adding 2110 to our lake and keep exploring
Adding 2210 to our lake and keep exploring
Adding 2211 to our lake and keep exploring
Adding 2212 to our lake and keep exploring
Adding 2313 to our lake and keep exploring
Adding 2413 to our lake and keep exploring
Adding 2514 to our lake and keep exploring
Adding 2614 to our lake and keep exploring
Adding 2715 to our lake and keep exploring
Adding 2815 to our lake and keep exploring
Adding 2816 to our lake and keep exploring
Adding 2917 to our lake and keep exploring
Adding 2918 to our lake and keep exploring
Adding 2919 to our lake and keep exploring
Adding 3019 to our lake and keep exploring
Adding 3120 to our lake and keep exploring
Adding 3220 to our lake and keep exploring
We left the map via 1704 1705 1706 1707 1807 1808 1909 2009 2010 2110 2210 2211 2212 2313 2413 2514 2614 2715 2815 2816 2917 2918 2919 3019 3120 3220
Arrows for 1704 should now point to 1705
Arrows for 1705 should now point to 1706

1804 1705 1703 1803 1603 1604 is the correct sorting order. 18.04 and 17.05 are at the front and the southern passage is discovered.

Notice my additional debug message I needed to check that for hex 17.03 the neighbor 17.04 is not checked. It would be the lowest neighbor indeed but we have already looked at it, so we need to ignore it. By the time we’re looking at 17.03, only the three northern hexes are options and 17.02 is indeed the lowest neighbor.

So now, since 18.04 and 17.05 are equally likely, the algorithm picked 17.05 and lake 17.04 doesn’t flow into lake 18.05 but their rivers meet in 17.06 and I think the map is much better, now. Here’s the corrected water flow map:

Correcting the flow of water

And with this correction, the final map also looks different. No more canyon into the mountains!

The new map

Now I get the urge to draw lines indicating the water divides. Noooo! :)

And just in case I make further changes to the algorithm, here’s what the application would generate right now for this width, height, and seed.

Time passes and I’ve spotted another problem in the map above. Take a look at lake 34.05 which drains through one of the highest peaks in the area, 35.07. How on earth did that happen?

We need to look at the earlier maps again. Before the flood processor kicks in we can already see that any water on the peak 35.07 will immediately drain into lake 37.09.

So, the algorithm goes:

  1. look at all the neighbors of 34.05. None look very exciting, they all drain back into 34.05.
  2. look at our neighbors’ neighbors; ignore the two white fields, focus on the light gray ones, e.g. 34.06.
  3. all its neighbors drain back into the lake with the exception of our peak, 35.07; and with that, we found our lake 37.09
  4. looking at all our candidates, lake 37.09 looks like the most promising, since it lies lower than any of the candidates

And that explains it. The problem seems to be that once we are looking at a candidate like 34.06, we’ll evaluate all its neighbors, even the very high ones like 37.09, even if a candidate of similar height like 35.05 has a much better neighbor like 36.05 which would drain off to the north west.

My algorithm is not enough breadth first like water would be.

More tinkering ahead, I can feel it!

Tags:

Comments on 2016-08-16 Alpine Map Generator

Algorithm changed to be totally breadth first. I’m not sure it is better. :)

– Alex Schroeder 2016-08-17 13:24 UTC

Add Comment

2016-08-06 Alpine Map Generator

I’ve been playing around with Text Mapper again. The nice thing about it is that it’s easier to generate the text input for Text Mapper than it is to write a whole new program.

What I wanted was to generate maps that remind of old drawings of the alps, like the one of the Wallis: Vallesia superior, ac inferior, Wallis, le Valais, by Gabriel Walser from 1768. There, you can download a 6208×5151 pixel image.

Anyway, I’ve worked on this for two days and here we are!

If you follow the link, you’ll get a random 20x10 hexmap using the new map generator, with the old SVG framework, and using the same old map icons by +Greg MacKenzie.

The source of your map is in the SVG file, as a comment. Alternatively, use the following link to generate a map description and hit the submit button to render it. If you like it, go back and save the map description:

There are still some things I think are annoying which is why I’ve left the “height” labels in as I need to think about this some more.

  • The river being painted over settlements looks bad, it should perhaps go between the hex background color (such as green) and the icons (i.e. below the forest and below the thorp). I’m not sure how good this looks if I’m using a road instead of a river but there you go. (Fixed!)
  • There are a few more icons I think of using. What about large towns, cities, shrines? No bushes, I think. Where do single trees come in? Where to place a keep? What about using more colors, ocre and sienna maybe? The complete list of icons and colors can be seen in the Gnomeyland example.
  • Also, anybody spotting stuff that defies explanation? Sometimes a river will drain to one side of a ridge – sometimes even appear to flow along side a lowland before turning away – and that is annoying. Perhaps these are opportunities to generate gorges?
  • I think there needs to be a more deliberate spacing of the settlements. “Random” results in random clustering which makes no sense, I think. (Fixed!)

Anybody interested in talking about the algorithm I used? I didn’t put it into words but I might if you want to talk about it and prefer not to see any Perl code… And I definitely need to add a link to this somewhere in the web app. :)

Updates

  1. trails now connect settlements, if within two hexes, three at most
  2. cliffs now separate higher altitudes from lower altitudes if the altitude difference is 2 or more

I’m hoping that cliffs make waterfalls obvious.

I still keep thinking about a way to add shadows and lighting like Swiss Topographical maps have it. Take a look at this nearby hill. Note how subtle shadows indicate altitude changes without you having to read the altitude lines.

Now compare it with this prototype:

Text Mapper with Shadows

I don’t think I like it. Light is basically assumed to come from the east, and if the neighboring hexes are higher up or further down, a little shadow is cast. And yet, something is off. The entire thing is too busy. Are the shadows too deep? Is the problem that these are polygons instead of fuzzy shadows? I tried using two different shades of light and dark so that it would look more organic but it didn’t help. Is it because we can skim over multiple hexes with out eyes and thus if A < B < C then it is not enough that C cast a shadow on B and B casts a shadow on A, do we expect that all of B lies in shadows?

I guess I like the look of the lakes.

Tags:

Comments on 2016-08-06 Alpine Map Generator

I’ve been working for many hours every day, working on better river flows, or basically better flooding of lakes and rivers cutting through higher surrounding areas searching for a passage, creating canyons as they cut through the land.

– Alex Schroeder 2016-08-15 21:29 UTC

Add Comment

2016-08-04 Text Mapper Update

Today I rewrote Text Mapper to be a Mojolicious application. I hope the important URLs still work exactly as they used to, so if you’re using Text Mapper as part of an application of yours, you should be fine. If not, let me know and I’ll see what I can do about it.

Another big step forward are the examples on the Text Mapper Help page. You can click on the links to see the examples, live. This makes me very happy.

These days, I use Text Mapper to maintain the player’s map for my Greyheim campaign. You can see it on the Greyheim Region page.

The reason I rewrote the application was that I actually wanted to write a new algorithm to generate maps – maps that would look like Swiss maps: rivers, ranges of hills and mountains, passes, all of that.

Tags:

Add Comment

2016-04-20 How To Get Started With Text Mapper

Here’s how to get started with a random map:

  1. Visit https://campaignwiki.org/text-mapper
  2. Click the Random button
  3. Click the Submit button
  4. Use the Back button to make changes

(If you click the Random link then you won’t be able to get back to the text that generated it all – you’ll have to look at the page source and at the very end you’ll find the text that generated the map in a comment, just in case.)

To get a feel for the icons available, do the following in another tab:

  1. Visit https://campaignwiki.org/text-mapper
  2. Click Help
  3. Scroll down to the Gnomeyland section
  4. Compare example data and result

Campaign Wiki Bonus: If you can find a way to store your text describing the map online, then your map will be live – you can change the text and reload your map, and it will have changed as well. For one of my campaigns, for example, I keep the text on on a page, and I use the link to the raw text of that page to generate the actual map.

Dropbox: If you store your map in a public (!) text file you can edit the map and regenerate the map on demand. Here’s the text file for my current map.

Awesome! :)

Tags:

Add Comment

2015-08-27 Settlements for Random Maps

I’ve been looking for map symbols and have added them to my favorite Text Mapper library, the Gnomeylands. These icons are based on the icons by Gregory B. MacKenzie.

New settlement icons: thorp, village, town, large-town, city. And some religious buildings: shrine, law, chaos.

Text Mapper also includes a random wilderness generator using Erin D. Smale’s algorithm (Part 1 for the terrain, Part 2 for the encounters). Currently I’m only supporting major encounters 1 to 3: settlements, fortresses and religious orders. Please note that these will be rare. Not every random map will contain one of these.

I also added agriculture. If a settlement is built on a plains hex, that hex is colored like soil or light soil. If the settlement is not built on a plains hex, or if it is a large town or a city, then a neighboring plains hex will be changed to soil or light soil colored fields.

Also note the black & white random map option…

À propos random maps: A few days ago I added this random maps feature. It allows you to keep reloading the page until you like what you see. You can always save the result as a .svg file and keep editing it using Inkscape. If you want to tweak it online, however, you need the actual map data. It’s available from the page source. At the end of the SVG, you will find the map data in a comment like this one:

<!-- Source
0101 light-grey grass
0102 light-grey grass
0103 green forest
...
2318 green forest
include https://alexschroeder.ch/contrib/gnomeyland.txt

-->

You can copy and paste the map data (without the <!-- and -->) into the Text Mapper text area, submit, go back and make change to it until you’re happy with the result.

Tags: RSS RSS RSS

Add Comment

2015-01-06 Text Mapper at Work

Today I saw a post by Jeremy Friesen where he used Text Mapper to produce a beautiful map. Beautiful colors! I found it hard to believe that he had used my icons.

Tags: RSS RSS

Add Comment

2013-06-27 Text Mapper for Traveller

A few years ago I was working on Traveller Subsector Mapper. As I was thinking about the new Text Mapper, I wondered how feasible it would be to generate a Traveller subsector using Text Mapper. I know, it’s a stupid waste of time because I already have the Traveller Subsector Mapper. But I couldn’t resist the lure of showing off how flexible Text Mapper could be. And it works!

Subsector created using Traveller Subsector Mapper:

https://alexschroeder.ch/pics/9153223058_dae54b6bc5_c.jpg

Subsector created using Text Mapper:

https://alexschroeder.ch/pics/9153222700_fc92f88abf_c.jpg

In order to reproduce it, use the following input:

include https://alexschroeder.ch/contrib/traveller-example.txt

The example file traveller-example.txt uses the library traveller.txt defining everything it requires.

Tags: RSS RSS RSS RSS RSS

Comments on 2013-06-27 Text Mapper for Traveller

Nice curved routes! I like it.

BeRKA 2013-06-27 21:38 UTC


Looks gorgeous, actually.

noisms 2013-06-27 21:49 UTC


Thanks!

AlexSchroeder 2013-06-28 07:18 UTC


I like the new version better (-:

– Harald Wagener 2013-07-01 12:08 UTC


I love your random generators (the idea behind TextMapper is fantastic), but as I know next to nothing about programming, I can’t do one thing I’d like: change your Traveller map to generate a larger subsector. The reason is I’d like to use it with your “wilderness” generator. Let me explain. The “travel” and “communication” routes on your Traveller generator could be used to trace important locales in a point-crawl / node-crawl / path-crawl. Expanding those to cover a larger map (let’s say 30x40 hexes) would be a great way to indicate the point of interests in a given region. I hope it’s not too confusing to understand what I’m trying to say.

Marcelo Paschoalin 2015-10-09 14:46 UTC


Yeah, the problem is that the UWP Generator doesn’t produce the output format necessary for Text Mapper. You need to create the Text Mapper input manually. The easiest solution would be to just print out multiple subsectors and connect them manually. For my own Fantasy mapping needs, I often find that placing roads and rivers between settlements is a manual process (example, data with trails and streams at the end).

– AlexSchroeder 2015-10-09 15:09 UTC

Add Comment

2013-06-05 Gnomeyland and Text Mapper

When I wrote my Old School Hex Map Tutorial, I noticed the Gnomeyland Map Icons and the Making Hex Maps With Inkscape tutorial by Gregory B. MacKenzie.

After a futile attempt to write a tool that would extract those icons automatically and make them usable for Text Mapper, I did the work by hand. Look at the example below… Beautiful! And since this is SVG, you can quickly generate your first map and later you can keep working on it using Inkscape.

https://alexschroeder.ch/pics/8958141006_7000b5627c_o.png

To regenerate the map above, visit Text Mapper and use the following “map”:

include https://alexschroeder.ch/contrib/gnomeyland-example.txt

This loads the Gnomeyland example map which uses the Gnomeyland library.

The Gnomeyland example map uses the tiles from the library. Here’s what you would need to generate just the lower part of the map:

include https://alexschroeder.ch/contrib/gnomeyland.txt
0005-0806 trail
0105 dark-green fir-forest "to the caves"
0106 dark-green fir-forest
0205 green fir-forest
0206 green fir-forest
0305 green firs
0306 soil keep "The Keep"
0405 light-soil
0406 light-soil
0505 light-grey mountains
0506 light-green forest-hill
0605 grey grass
0606 grey marsh
0706 dark-grey swamp
0806 dark-grey castle "Dolorous Garde"

Just paste it into Text Mapper. :)

Tags:

Comments on 2013-06-05 Gnomeyland and Text Mapper

I wonder if it wouldn’t look a bit better if the trail were drawn below the icons.

Andreas Gohr 2013-06-05 14:06 UTC


Hm… I remember moving it behind the text labels, but you’re right, it would make sense to draw hex backgrounds first, then trails, then trails, then things within the hex and finally the text labels…

AlexSchroeder 2013-06-05 14:50 UTC

Add Comment

2013-06-05 Another Gnomeyland Example

I wanted to test the recently added Gnomeyland icons for Text Mapper and looked at the following map:

https://alexschroeder.ch/pics/8876746436_f2598482c1_o.png

This is the text description I came up with:

include https://alexschroeder.ch/contrib/gnomeyland.txt
0101 water
0102 water
0103 water
0104 water
0105 water
0106 water
0201 water
0202 dark-grey marsh
0203 dark-grey marsh
0204 water
0205 water
0206 water
0301 water
cave xml <line x1="30" y1="45" x2="130" y2="45" stroke="#6ebae7" stroke-width="20" stroke-linecap="round"/><path d="M 30,45 c 0,-20 -20,-20 -20,0 c 2,0 3,0 20,0 z" stroke="black" stroke-width="2"/>
0303 dark-grey tower cave "Portal"
0304 grey grass
0305 grey mountain
0306 water
0401 water
0402 grey trees
0403 water
0404 water
0405 water
0406 water
0501 water
0502 light-green tree "Silberbäume"
0503 soil
0504 water
0505 dark-grey forest-hill
0506 water
0601 water
0602 green forest
0603 green forest "Faule Wald"
0604 green forest
0605 dark-grey trees
0606 water
0701 water
0702 water
0703 dark-grey forest-mountains "Einhorn"
0704 dark-grey forest-mountains
0705 water
0706 water
0801 water
0802 water
0803 water
0804 water
0805 water
0806 water
lake xml <circle cx="45" cy="75" r="30" fill="#6ebae7" stroke="black" stroke-width="3"/>
0302 dark-grey forest  lake "See"

Note some tricks:

  1. the “cave” is defined right then and there, not in a library, and it includes a little water connection to the central bay
  2. hex 0302 with the lake comes at the end such that the neighboring hexes don’t overwrite the overflow

Result:

https://alexschroeder.ch/pics/8959577095_02aed1b95f_o.png

I could work on this some more, or I could just take it, import it into Inkscape, and keep working on it.

The big question is: how much easier is it to work with a text description of a map compared to fiddling with Inkscape directly? As I create new maps, I’m no longer sure this map generator is all that useful, to be honest.

Tags: RSS RSS RSS RSS

Comments on 2013-06-05 Another Gnomeyland Example

I think it could useful as a kind of intermediate language (like MSIL). For instance, you could make a front-end (GUI or website) that lets you tweak some basic things easily (number of roads, cities, amount of water, etc.), and with a push on “Generate”, the front-end then spits out Text Mapper “source code” and feeds it to the back-end, producing the final SVG.

Jensan 2013-06-05 17:31 UTC


Hm, good point. Perhaps somebody could write a random map generator without having to implement the map drawing aspect.

AlexSchroeder 2013-06-05 20:24 UTC


I like the text mapper. I would rather write the textual description than trying to do this in inkscape. At your level of artistic talent, maybe it’s not that useful …

Harald 2013-06-05 20:33 UTC


Well, even for people not into the artistic aspect of it could get by reasonably, I assume, by opening the Gnomeyland template, for example, and using copy and paste. I haven’t tried it, however. Something to consider.

AlexSchroeder 2013-06-05 21:09 UTC


I agree with Jensan, a GUI Editor of some sort would be really helpful I guess.

Andreas Gohr 2013-06-06 08:54 UTC

Add Comment

2013-03-04 Text Mapper With Lines

SVG Mapper now knows how to draw lines. These lines try to flow from hex to hex…

Example input:

2114 hill
2115 hill
2213 forest
2214 forest "Delan"
2215 hill
2314 forest
2315 forest
2414 hill "Forest Bight Fortress"
2415 forest
2515 forest "Boghra Little"

2214-2615 river
river path attributes fill-opacity="0" stroke="black" stroke-width="5"

include https://alexschroeder.ch/contrib/default.txt

Result:

Dangerous Forest

I think that I’m not quite understanding how the viewBox is supposed to work. But anyway: these lines can be used for roads, rivers, borders, cliffs, and the like. If they’re very straight, they don’t look too good. There’s no random waviness. One feature I definitely have to add is providing more intermediary points such that the user can guide rivers around the hills or to allow rivers to merge.

Tags: RSS RSS RSS

Comments on 2013-03-04 Text Mapper With Lines

Hello there. My first time posting. Really hoping you respond. I have been playing with textmapper, learning about SVG, and trying to take it farther on my own. Things would be going much better if I was a computer programmer instead of a chemist. The Viewbox thing has been annoying for me as I have used your website to make ever more complex maps. If I could figure out how to run it locally I would, a big plus would be adding my own content to defaults.txt.

In the above image I THINK you are trying to assign the upper left and lower right corners as it shows here viewBox=“2990 2028 3910 2784”> But what you should be doing is assigning the upper left corner and then the width and height viewBox=“2990 2028 920 756”>. There is still something going on with my bigger maps but they are fully on screen when manually edited this way.

On a related note, in https://alexschroeder.ch/contrib/black-and-white.txt the default attributes are fill=”#ffffff” stroke=“black” stroke-width=“3” That fill attribute causes all the hexes to be blank unless I set the fill-opacity=0.0 with manual editing. I think it should be fill=“none”.

Yeah I really need to get this to work locally, so many possibilities.

– Craig Peters 2014-02-15 02:50 UTC


Wow, this is great! Regarding a local installation. What sort of computer do you have? All you really need is Apache and Perl. If you have a Mac, these come already installed. If you have a GNU/Linux system, you just need to install Apache. If you use Windows, there’s always WAMP.

If you can’t get Apache installed but you have Perl, then you can also run the command from the command-line. It’s somewhat awkward, but if that’s how you’d prefer to use it, usability can always be improved. :)

Here’s what I did. First I created a file in /tmp/map.txt containing the following

0308 jungle "Affeninsel"
include https://alexschroeder.ch/contrib/default.txt

Then I ran the command as follows:

perl text-mapper.pl map=include+file:///tmp/map.txt | tail -n +5 > map.svg

The map just needs to get an escaped URL – replace spaces with + and you should be good to go if all you do is use a simple include statement. The next problem is that you need to provide a local file URL. Instead of starting the URL with http:// you start it with file:// and then you add the file name. The script output contains some HTTP headers which you need to get rid of. I used the tail program, but you could just as well save the output and remove those extra lines manually:

perl text-mapper.pl map=include+file:///tmp/map.txt > map.svg

If those file URLs are giving your problems, try using your browser to “open” these files and copy the URL from the address bar.

If you’re mostly interested in providing a different default library, then all you need to do is find a site that will allow you to host text files. Perhaps a Gist on GitHub would work for you?

Example Gist:

Viewed as a raw text file (the link will be shown when viewing your Gist):

Or, if you decide to work locally as seen above, then your libraries can also use file URLs. :)

As for your two bug reports: Both confirmed, fixed, and installed. Thank you very much! The viewBox issue bugged me in the past until I decided that I was no longer going to waste time looking at it. I must have gotten confused because I was computing the two corners, and then width and height, and then ignoring them and using the two corners instead.

And finally, please share your maps! :)

AlexSchroeder 2014-02-15 09:56 UTC


Wow, that was fast. Thank you so much. I will try the offline thing once I load Apache and have some free hours. In the meantime here is the first of soon to be 5 maps to be used in a kingmaker D&D campaign. You have said elsewhere on this site that entering text to make a map may not be worth the trouble. I agree, but it is good for editing once you have had a look at the final map. Thats why I’m use excel to input one letter keycodes (like your oldschool mapper) that then make the HTTP using concatenate.

http://tinyurl.com/ke5ay9h in black and white http://tinyurl.com/lhfryo3 in color

I’ll need to attend to ocean/sea/rivers in black and white and must not set hatched hexes to white, but its a good start. Wish me luck.

– Craig Peters 2014-02-17 04:47 UTC


Good luck! I like the black & white map. It has a certain lightness to it.

AlexSchroeder 2014-02-17 06:15 UTC

Add Comment

More...

Comments


Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. 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.