2009-09-11 Traveller Map Based on UWP

There is an amazing Traveller Map API available out there. Specifically, there’s a service that will produce a PDF based on your UWP list. But you know how it is. I bet half the Traveller referees are trying to code up subsector generators and mappers. Me too!

Here’s my SVG Mapper for Traveller. It comes with example data so you can figure out what format it expects by looking at it. Just click the Submit button! Remember, you need a browser that knows how to deal with SVG files – Firefox will do.

Source code is available. I got to reuse some of my abandoned Old School Hex Mapper. And figuring out the trigonometry stuff is fun. :)


Comments on 2009-09-11 Traveller Map Based on UWP

Very nice! :-)

It looks very nice, and has a simple interface. This is a very good tool to quickly make a subsector.

You are very generous to release this with the GNU General Public License. This means that I might use it together with my random subsectror generator (that is also written in perl).

I have been thinking of doing my own mapper, (other than the ascii one I have made). My plan was to use GD or ImageMagick.

BeRKA 2009-09-11 05:51 UTC

Heh. I come from a FreeSoftware background. Sharing’s the ethical thing to do. ;)

Is your random subsector generator based on the Mongoose rules, or are they the same as for previous editions? I noticed that the generator I had used for my subsector produced strange trade codes and had to write a Perl script to fix them.

Also, Mongoose Traveller doesn’t say how UWP codes for the various based look like. They just provide Scout and Navy as examples. Do you know of a site that defines it?

AlexSchroeder 2009-09-11 07:21 UTC

My generator is based on previous editions? You can select to use book-3 or book-6 rules, that are slightly different when calculating hydrographics. My trade codes are from book-7.

Base codes can differ depending on the version you use. One common version is found on traveller map.

For Naval and Scout base “2” is also commonly used instead of “A”.

BeRKA 2009-09-11 08:25 UTC

Oh wow. Thanks for the link. This was new to me: “special codes deal with the presence of more than one type of base within the same system in order to maintain a single base code letter per system.”

I think I’m going to focus on the rules I have or I’ll go mad. :)

AlexSchroeder 2009-09-11 08:36 UTC


greywulf 2009-09-11 09:35 UTC

Add Comment

2008-07-04 Gimp Layer Effects

On the Mac Mini I had a Gimp without layer effects. I often need these to add outer glow to text layers when making slide shows for Claudia.

There’s Layer Effects for GIMP 2.4 (also in the Gimp Plugin Registry) – yay! :)


Add Comment

2008-06-26 mkhexgrid

So I’m trying to build mkhexgrid.

  1. libpng ok
  2. ignore libjpg for the moment ok
  3. FreeType 2 ok
  4. libgd sucks – I had to configure and build this inside a X11 session!
  5. fortunately I already have libz! :)
  6. and I need the Boost C++ Libraries – I had too add -I/Users/alex/Source/boost_1_35_0 to CPPFLAGS in the Makefile
  7. mkhexgrid ok

The X11 dependency was surprising. I assume there’s a better way to do it, but I don’t know what it is. The error I got without X11:

Pyrobombus:~/Source/gd-2.0.36RC1 alex$  gcc -DHAVE_CONFIG_H -I. -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/include/libpng12 -g -O2 -MT gdft.lo -MD -MP -MF .deps/gdft.Tpo -c gdft.c  -fno-common -DPIC -o .libs/gdft.o
gdft.c:1405:35: error: fontconfig/fontconfig.h: No such file or directory
gdft.c:1468: error: parse error before '*' token
gdft.c:1468: error: parse error before '*' token

I also noticed that SVG output required px units, which is not true. I submitted the following patch to version 0.1.1:

diff -c /Users/alex/Source/mkhexgrid-0.1.1/grid.cpp\~ /Users/alex/Source/mkhexgrid-0.1.1/grid.cpp
*** /Users/alex/Source/mkhexgrid-0.1.1/grid.cpp~	Wed Jan 10 14:37:42 2007
--- /Users/alex/Source/mkhexgrid-0.1.1/grid.cpp	Thu Jun 26 14:06:37 2008
*** 646,652 ****
              throw runtime_error(string(o) + " is not in px");
        case SVG:
!          if (u != "px") throw runtime_error(string(o) + " is not in px");
        case PS:
           if      (u == "pt") ;               // 1 point per point :)
--- 646,657 ----
              throw runtime_error(string(o) + " is not in px");
        case SVG:
!          if      (u == "pt") ;               // 1 point per point :)
!          else if (u == "cm") d *= 72/2.54;   // ~28.35 points per cm
!          else if (u == "mm") d *= 72/25.4;   // ~2.835 points per mm
!          else if (u == "in") d *= 72;        // 72 points per inch
!          else throw runtime_error(string(o) +
!             " has unrecognized unit `" + u + "'");
        case PS:
           if      (u == "pt") ;               // 1 point per point :)

Diff finished.  Thu Jun 26 14:08:15 2008

I just used copy & paste to use the same code that was available for PS output.

And finally this is the specfile I used for my map:


Yay!! :)


Comments on 2008-06-26 mkhexgrid

I also found a python extension to generate hex maps in Inkscape via the Cartographers’ Guild thred index. There seems to be a bug that prevents the hexes from actually having coordinates. I’d have to investigate.

AlexSchroeder 2008-08-01 00:53 UTC

Add Comment

2007-06-08 Old School Hex Mapper Getting Better

The Old School Hex Mapper is getting better. Notice how it creates the loop at the bottom using a very small number of simple rules. I have the feeling that it should be possible to formulate the rules required for a decent layouting of roads.

Funny how some skills thought long lost are coming back. 90° – a² + b² = c². 90° & 60° – ½ : √3 : 1.

(Also on GitHub.)


Add Comment

2007-06-06 Hex Mapping – Roads

I worked some more on the “Old School Hex Mapper” I mentioned before (2007-06-02 Hex Mapping). It does roads! Well, it does them in a crummy way. Basically there’s a road-segment connecting the center of a hex with the edge, which I then copy, rotate, and translate as necessary.

Check out this map with a road. (You need a SVG enabled browser.)

Notice how the ASCII input starts to show limitations when there are more possiblities. Look at this unintended (?) three-way crossing near the city.

The ugly part is that the roads go right through the icons. In fact, they have to, because every road segment has one of its ends in the center of the hex.

So that’s what I’ll try to work on next. I think what I’ll do is have four road tiles, one connecting two adjacent sides (60°), one connecting roads at an angle (120°), and one connecting two opposite sides (180°). Then I can have the connecting parts avoid the center of the hex.

And I’ll get rid of extra three-way crossings near cities and towns. That should be easy to do.

In the mean time, feel free to experiment:

To be honest, I still don’t know whether this is worth pursuing. My hand-drawn hex maps look much better! (My players are not supposed to click the link. :))


Comments on 2007-06-06 Hex Mapping – Roads

I think I’ve worked myself into a dead end, here. Before doing any more development, I should do the following:

  1. Use a hex tile centered on (0,0) in order to facilitate any rotations.
  2. Use a coordinate system with an y axis slanted by 60° instead of the zig-zag I’m currently using in order to facilitiate lookup operations when working on roads.
  3. Split it up in decent subroutines.

AlexSchroeder 2007-06-07 17:05 UTC

I quite like the three-way crossing you’ve got there. It’s unusual features like this which make for good maps, to my mind. After all if it’s like that, there must be a reason :)

Perhaps a lord’s castle is at one of the crossing points and the city is:

  1. abandoned and/or haunted
  2. of a different race (dwarven miners?)
  3. in a different country - the road follows the boundary

Alternatively, maybe the other road leading north from the hills is an Old Road, and largely unused now due to bandits/goblin raiders/lizardkin/whatever. ie, it’s a dangerous route which the players will (innevitably) take :)

GreyWulf 2007-06-08 09:56 UTC

Interesting perspective. :) I was planning on trying to avoid three way crossings in the immediate vicinities of settlements. That’s feasible with a bit of extra coding without requiring too much intelligence built into the system. Thus, if there’s at least one other segment between the crossing and the settlement, we still get three way crossings. Or at least I hope we do.

I’m half way through my rewrite of the code. It uses – God forbid! – objects in Perl! :)

AlexSchroeder 2007-06-08 11:40 UTC

Add Comment

2007-06-02 Hex Mapping

I’ve always wanted to produce good-looking old-school black-on-white hex maps for my roleplaying games. But I didn’t want to use Windows.

Update: Now available as a CGI script! You can also link to your maps directly. Check out the Perl sources of the script.

I broke down and wrote a prototype. Behold my awesome SVG powah! :D

The input file is plain text! Behold my awesome ASCII art powah, too!! :D

The output is SVG, which I then convert via EPS to PDF. Check out the PDF result.

I found that the best solution was to convert from SVG to EPS using InkScape, and from EPS to PDF using ps2pdf or the OSX Viewer. In my particular case, I just used the following Makefile:

%.eps: %.svg
	echo Ignore Gdk-CRITICAL and WARNING messages
	/Applications/ \
	--without-gui --export-area-drawing --export-eps $@ $^

%.pdf: %.eps
	ps2pdf $^ $@

Producing the SVG was the tricky part. I used a little Perl script called

What next? Add more “tiles”, obviously!

Here’s how to do it. First, produce a SVG file using a single dot as the map. This gives you the empty hex.

echo . | perl > empty.svg

Then fill it with some strokes, simplify them, delete a few extra points on the paths, and save. Open the file in you favorite editor and extract the stuff you added, move it into the script data at the beginning, in the defs element, following the grass example. Add an appropriate character mapping to the %char table and you’re done!

That’s what I’ll do right now.

I’m not yet sure how to add roads and rivers.

I’m already starting to wonder… would it make more sense to have all the hex types in the current directory, and use their filename as the reference, and include them as necessary? :) Maybe if this turns out to be the greatest thing since sliced bread. Perhaps I should turn this into a CGI script…


Comments on 2007-06-02 Hex Mapping

Very neat!

Reminds me of the Realms generator I created for Fields of Blood. Here's the code for the Realms stuff and this is the hexmap builder.

That was much fun to hack, and my scrappy code might give you a few ideas too :)

GreyWulf 2007-06-03 08:31 UTC

Yikes! “My next challenge is roads, coastlines and rivers.” Sounds familiar…

AlexSchroeder 2007-06-03 08:37 UTC

Unfortunately I moved onto other things after failing to drum up enough support for Fields of Blood in my group. Boo!

Now I really need a good hex mapper, so methinks I’ll go back to this and carry on with it. I liked the look of the maps :)

GreyWulf 2007-06-03 09:05 UTC

Heh. My code has the benefit of producing SVG, which you can scale and print and it still looks good. You could replace the tiles I’ve been using by translating the $im->line stuff with the appropriate elements. I just looked at output Inkscape generated and the SVG spec and was all set.

I’ll have to think of a solution for rivers, roads and frontiers. Or perhaps I should just give up and keep hand-drawing my maps. Yesterday I ended up printing an empty hex map and hand drawing everything else in it. I thought it looked great. I’ll have to scan it in once my players have been through it.

I might as well just stick to hex paper. Hm…

AlexSchroeder 2007-06-03 09:19 UTC

Add Comment

2007-02-02 Gimping my Brainz Out

I’m totally working on a map-competition for “War of the Burning Sky” using my pencils, my scanner, and the Gimp. This is the result:

War of the Burning Sky Map

Publication would probably require a title, labels, and a compass rose. :)

Take a look at the other submissions.

Update: Unfortunately, my map is doing very badly in the poll. :'( Why are they using a survey to determine the winner? I think that’s how you get average results, not outstanding stuff. Even if you were not going to vote for my map ;) – I think another noteworthy map that is helium3’s map:

Helium3's map

And yet, that map currently has only 4/155 votes. Too bad. :(

For my own game, I’d probably use the black and white map:

War of the Burning Sky Black and White Map


Comments on 2007-02-02 Gimping my Brainz Out

Looks good to me :)

GreyWulf 2007-02-02 22:32 UTC

Add Comment