Text Mapper -> Convert text file to hex map


Just found this during a search for resources to write my own:


It turns this:

0101 mountain "mountain"
0102 swamp "swamp"
0103 hill "hill"
0104 forest "forest"
0201 empty pyramid "pyramid"
0202 tundra "tundra"
0203 coast "coast"
0204 empty house "house"
0301 woodland "woodland"
0302 wetland "wetland"
0303 plain "plain"
0304 sea "sea"
0401 hill tower "tower"
0402 sand house "house"
0403 jungle "jungle"
0502 sand "sand"
0205-0103-0202-0303-0402 road
0101-0203 river
0401-0303-0403 border
include https://campaignwiki.org/contrib/default.txt
license <text>Public Domain</text>

Into this:

In SVG, a vector image format; Perl source is available, there's a random option based on Welsh Piper's random hex generator. Graphics are customizable; and I bet this place can come up with some fun ACKS-specific libraries.

It's ah...been a while since I've fallen in love..but..umph. 'dat Perl.






This is actually really neat though! Maybe over the summer I'll have to take a crack and automating some of my campaign stuff with this. 

This is relevant to my interests. Thanks for posting it!

FWIW, I got kinda here-ish:

just putzing around.  Input kinda looks like:

2210 default nw-mountain east-plains sw-forest mountain brush
2310 default nw-mountain east-mountain sw-forest mountain heavypine
2410 default nw-mountain east-mountain sw-forest snowmountain heavypine cave "Dwimmermount"
2510 default nw-mountain east-mountain sw-forest mountain heavypine
2211 default nw-mountain east sw-forest mountain heavypine fort class-fort Patricians

plus some custom SVG artwork I did. I'd always liked James C Bennett's work when he remapped the Adamas area of Dwimmermount; and here I used the upper left third for elevation, the lower left for vegetation, and would use the right third for details on civilization or lack thereof; in somewhat the same manner as he did.

I will say it's a bit quicker to manage changes then Hexographer, or, worse, Hexographer/GIMP combo like I've been doing. 


It's gotten a little further out of hand:

Realm and subrealm bordering, river paths, 1.5mile subhex locations for lakes, settlements. Hex colors by elevation, from 20K feet in 0907 down to 0 feet at the shore - stole that particular thought from Alexis Smolensk's mapping.


I love what you’re doing with this. Had not considered svg as an output format, but it makes a lot of sense. Considering a python version.

I had no idea SVG was that simple when I came across this.

That up there is right after I reconverted some things so I could scale all my bits based off the point size of the hexes - the hex size, sub hex size, stroke width of the hex lines and rivers, fonts, etc...

I need to take a break from it for a bit, but when I come back I'm strongly considering having it output a 6m hex map and then a 24m hex map of the same data.


Message me when you feel like you're past the consideration phase and into the coding phase, we could probably put whatever I have at that point up in your Git.

I write 'sysadmin Perl', so...you know. Code-as-sledgehammer. It'll be horrific.

Might be a week or two; we’re in crunch to ship in early August.

Sounds like your perl will go well with my terrible hacker-python :stuck_out_tongue:

A good description of your text input format would be great, so I can generate hex-stocked textfiles and just render them with your tool, rather than duplicating effort.

I just got Hexographer Pro but I am going to play with this nonetheless.

Do you know if you can make maps that are one six mile hex in size with sub hexes detailed?

Literally one hex large? Sure, it's mostly already in the code; if you check 0802, that's how I'm defining subhexes within the hex, and those are proper 1.5m subhexes within that 6m hex. I've got a bit of overlay (3,5,11,14...) into neighboring hexes due to how the river pathing works now, but I'm hoping to fix that up by making that code query neighboring hexes to see if there's a path needing continuing, rather than overloading each hex with more river than required.

And I've largely reworked the code that the drawing scale is definable (the above is 50pt high hexes). I do plan to be able to generate 24m and 6m hex maps out of the same data, live-scaling terrain features like rivers and settlement visibility. 

The lake on 0206 is an example of a defined subhex; as are the settlements and the river paths themselves - each subhex number is an index to the center coordinates for that hex, and either some object or path is drawn to that point. 

I don't quite have it set for free-form subhex defining, but it's possible. I'd like to hear how you'd like it to work - I'm coming at this from certain perspective and I could use mroe opinions on functionality....but, if made possible, there's nothing stopping you from defining everything from elevation to vegetation at the 1.5m hex scale within a 6m hex map.

I'm taking a short break from the mapping code right now - I've been using real-world data to develop a campaign, and I've realized it'd be dumb to continue in my current state - I need to actually apply a hex map to the Earth gridded independently of where I'm working, so I've got to go back and figure out how to do that.

Please do let me know what you'd want to see it be able to do, though, for when I get to round 2 with it.



Heh. Oh, this is gonna be so embarassing to have made public. 

I will do some major commenting and whatnot in the next X days, then I'll get it uploaded somewhere, with a good description of how to input things and the link to the sheet I'm using currently for development.


At one point my toolkit had a giant if-then-else ladder to identify what monster encounter was rolled before my brother pointed out I could use reflection.

I’m used to C/C++ ok not C# I didn’t know that was a thing!

(In summary everyone’s code is embarrassing :P)

I'd like to duplicate some of these single hex maps like thirdkingdom does for my RPG.net game.  Example here.

Or the maps from the Hexed Places products.  Example here.

I think I can do them in Hexographer but I wondered if it would be faster to do them using Text Mapper.

this may be over-engineering for a simple app, but you generally don't want to use reflection unless you're logging.

if you need common behavior that deviates per monster, as you'll often find in long if-else chains or, god forbid a case statement, you'll want to have your monsters either inherit from the same class or implement the same interface that the function can then use, letting the specifics of the monster be handled in each monster's section.

fun fact: writing code for an insurance company's paperless document has a lot of overlap with trying to manage lots of documents with RPG information. the spirit of Gygax lives on!

That is absolutely possible, and you can do almost a 100% reproduction without my code, just using Textmapper as it comes from the author.

One of the neat things about the TextMapper method is that you can pick the range of hexes that you want to generate - and it supports generating hexes in disparate areas, with nothing but blank space between them (preserving the grid structure). A certain area, a few hexes to either side of a road or river, etc, etc, blah. It's wonderful for hexcrawls.

So, define the subhexes you care about in your "single hex" (virtually defined), and feed in the ones you want it to render, viola. 


What could be done additionally is to define "location text" for each hex, and it could output a whole PDF document with the the hex map on front and all the required location notes to follow. I figured I'd do that eventually with my shim.

Heck, given a random hex map generator (which is built into it already...), the L&E lairs, wandering monster tables, and jedavis' default domain definitions, one could generate a lifetime's worth of ACKS hexcrawls in moments.



All right, I'll try to take a crack at it over the weekend and see how I do.  Will report back soon.

The issue was to call a specific function based on a text input.

So yeah, in theory I could reengineer everything including the data storage, but doing that would require either a mass of ungainly code (the original solution) or making the data storage less user-facing (when one of my goals was to store everything in raw text files so that the user can edit encounter tables or create their own).

you said you're using C# right? if the specific functions all have the same inputs and outputs, you can describe them with a delegate and make a dictionary with strings as the keys and the delegates as the values, then it's just one line of "output = DelegateDictionary[strKey](inputA,inputB)"