Page 1 of 5 123 ... LastLast
Results 1 to 10 of 44

Thread: Linux Bash Script: Convert RPG City Map Generator to SVG

  1. #1
    Guild Member
    Join Date
    Nov 2008
    Posts
    55

    Default 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.

    Attached Files Attached Files
    Last edited by GrumblingHive; 09-16-2012 at 01:56 PM.

  2. #2
      ravells is offline
    Community Leader Gracious Donor ravells's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    10,902

    Default

    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!

  3. #3
    Guild Member
    Join Date
    Nov 2008
    Posts
    55

    Default

    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.

  4. #4
    Guild Member
    Join Date
    Nov 2008
    Posts
    55

    Default

    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.
    Attached Files Attached Files
    Last edited by GrumblingHive; 09-16-2012 at 06:28 PM.

  5. #5
      ravells is offline
    Community Leader Gracious Donor ravells's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    10,902

    Default

    My pleasure!

    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!

  6. #6
      ravells is offline
    Community Leader Gracious Donor ravells's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    10,902

    Default

    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.

    I remain,

    Your humble servant,

    ravells.

  7. #7
    Guild Member
    Join Date
    Nov 2008
    Posts
    55

    Default

    Quote Originally Posted by ravells View Post

    Forgive me for being so enthusiastic but wanting proper vector output for RPG City Creator has always been a dream of mine.
    Haha! Mine too, that's why I made it!

  8. #8
      ravells is offline
    Community Leader Gracious Donor ravells's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    10,902

    Default

    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.

  9. #9
    Guild Member
    Join Date
    Nov 2008
    Posts
    55

    Default

    Try "wubi" maybe?

  10. #10
      ravells is offline
    Community Leader Gracious Donor ravells's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    10,902

    Default

    I'll give it a go, but right now I'm too busy playing with the possibilities from your example map!
    Attached Thumbnails Attached Thumbnails Linux Bash Script: Convert RPG City Map Generator to SVG-krayken-render.png  

Page 1 of 5 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •