athornton: Angry.  Drunken.  BOFH. (Default)
athornton ([personal profile] athornton) wrote2009-05-24 09:18 pm
Entry tags:

One-Page Dungeon Contest

So, I recently entered the One-Page Dungeon Contest.

This was pretty easy--I just entered level 5 of the megadungeon I've been creating in my spare time. The fun part was making the mapping tools.

So, the dungeon itself was based on the One-Page Dungeon Level Template:
http://sites.google.com/site/chgowizsite/Home/OnePageDungeonLevelTemplates.zip?attredirects=0

My megadungeon has all been built using this template. Level 5, in the version that's just for the megadungeon, looks like this:



Megadungeon-L5



Well, that's not terrible, but I really wanted a map in proper TSR Blue style, like classic first edition AD&D modules (S1 in particular).

There were a couple of posts at http://greyhawkgrognard.blogspot.com/ about how to do a map like that, and the basic idea is: do a grid, scan your map to vector, overlay map on grid, fill with TSR Blue (== #1EAED0). I tried this, but neither Illustrator nor Inkscape was able to do much with my map, and when I was done it still looked terrible. I have no discernable drawing talent, and so this looked a lot like a dead end.

Then I had a realization: although I couldn't draw well, at least for this level, what I had was pretty much straight lines, and I already had all my corners and features plotted on a 30x30 grid. And although I can't draw, I can write adequate Perl, and generating SVG is really a pretty easy process.

So, I created a little language to represent the features on the level. Here's the example from this level:




crypt.desc



Note that this could just as easily be a spreadsheet; it's just a very cheesy 6-column CSV file.

Then I needed a parser to take that language and turn it into a series of marks. This was a job for Perl. Note that this is bad, ugly perl. There's no use strict, there's no -w, I'm very sloppy in my use of globals. The thing, though, is that it worked, and it's trivial to tweak.





makemap.pl



And then when you feed a) to b), you get the following map (when added to slightly tweaked text for the dungeon level):




Crypt



So I thought that was pretty cool. FWIW, the best way I found to rasterize the map to put it into the ODF I generated the PDF from was just to open the SVG in Safari and then cut-and-paste the rendered map (Inkscape lost all the line width variation I used).

Adam

Post a comment in response:

This account has disabled anonymous posting.
(will be screened if not validated)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org