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.
I broke down and wrote a prototype. Behold my awesome SVG powah!
The input file is plain text! Behold my awesome ASCII art powah, too!!
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/Inkscape.app/Contents/Resources/bin/inkscape \ --without-gui --export-area-drawing --export-eps $@ $^ %.pdf: %.eps ps2pdf $^ $@
Producing the SVG was the tricky part. I used a little Perl script called old-school-hex.pl.
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 old-school-hex.pl > 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…