Linux Bash Script: Convert RPG City Map Generator to SVG
Here you go: the long awaited version 3 of my RPG City Map to SVG converter...what's that? You didn't know about versions 1 or 2? You HAVEN'T been waiting for this for any amount of time whatsoever? Oh well, here it is anyway. Needs linux with bc (basic calculator) and dos2unix installed. Throw it in a folder with some .sgs files from RPG Citymap generator, run the script, type the name of the town map WITHOUT the .sgs extension, and presto! A perfect vector city. Apart from the lakes. And possibly some other stuff. Oh, and I don't think illustrator likes the svg output, use inkscape instead.
I hope someone tries it out, if only to tell me about all the bugs, the terrible scripting, and the amount of time it takes to convert the file.
Last edited by GrumblingHive; 09-16-2012 at 01:56 PM.
Oh man! I love RPG City Map generator, and I use an autotrace function in Serif Drawplus to transform the raster data into vector. I would LOVE a script that does it all automatically and produces a good vector result, particularly a clean two node line on diagonals. Unfortunately I don't use Linux. :: cries ::
Is there any chance you could make a version which runs on windows or is there some sort of emulator I can use to run your script on windows?
Can you post up sample SVGs of some of your results? I'd love to see how clean the results are.
Have some rep!
Erm...windows version? Not too sure about that..maybe I'll give it a try, just for you.
Can you use cygwin or something like that to run it in windows perhaps? Or maybe use virtualbox? Might be a bit of overkill just to run a scrpt though.
I turned off my main machine for today, but I'll post some svgs here tomorrow. It handles towns of like, 7000 buildings really well (apart from the lakes), which takes about ten minutes on my machine. The results are usually very good if I say so myself.
Hooray! My first rep, thanks a lot!
Here's a fairly large example. The buildings are not outlined, but they are individual objects. The outline is easy to change anyway.
Tell ya what, as I'm in such a good mood, if you post an sgs file here, I'll convert it for you with a colour scheme of your choice...how about that?
Last edited by GrumblingHive; 09-16-2012 at 06:24 PM.
Here's that example...
Oh, and remember to use inkscape. Illustrator probably won't be able to open this. I'd be interested to know if any other software can manage it though.
Last edited by GrumblingHive; 09-16-2012 at 06:28 PM.
Oh....before you run into the effort of making a windows version, let me see the results, if they are similar to what DrawPlus's autotrace can do then I wouldn't want to put you through the bother. I don't know anything about operating systems, programming and languages, so cygwin etc mean nothing to me but I can do some research!
I can live without the lakes, (I never have them on) . Can't wait to see what your script can do!
OMG!!!! How did you get such clean results? it looks fantastic! Also, you've vectorised each individual building even those overlaid on top of others (Autotrace in Drawplus just traces the whole outline of the bitmap). This is brilliant!!!
The other (utterly amazing) thing you have done is exported the roads as single splines rather than enclosed shapes!
Forgive me for being so enthusiastic but wanting proper vector output for RPG City Creator has always been a dream of mine. I even tried to hunt down the creator to ask him if he could produce one!
I'm using Drawplus X5 to open the SVG and it isn't even pausing to draw breath on the redraws.
The other supercool thing about it is that although all the shapes are on one layer, they ordered by type so separating them out is pretty easy.
Your humble servant,
Last edited by ravells; 09-16-2012 at 06:44 PM.
Haha! Mine too, that's why I made it!
Originally Posted by ravells
I'm very glad you did! programming is like black magic to me, I'm so glad you took this on! I'm looking at 'andLinux' to run your script but that looks like it doesn't run on Win7 64 bit.
I'll give it a go, but right now I'm too busy playing with the possibilities from your example map!