View Full Version : RPG City Map Generator to SVG Converter
09-22-2012, 01:11 PM
Thought I'd make a new thread as it's no longer a humble script. Anyway, here you are: the long awaited and much salivated-over binary versions of my RPG City map to SVG converter.
New features include:
1) Much faster.
2) Works on windows
4) That's about it. Maybe some new bugs that weren't in the old version...
Windows (x86/32 bit) and Linux(x86_64) versions here: (other architectures probably to come later):
Remember this still probably has a few problems. Off the top of my head, the lakes are still not quite right, and the towers in the city wall that should be invisible are not. Though that should be fixed pretty soon.
Have fun, and thanks very much for the award, I will be boasting for weeks I can assure you!
Oh, suppose I should mention how to use it. For windows, just unzip, double click the .exe, type the name of the sgs file in the window and hit enter. Your svg should hopefully appear in the same directory where the original sgs was. For Linux, you probably need to chmod and run it from the terminal...wait a minute, if you downloaded the linux version, you don't need me telling you stuff do you now? ;)
09-22-2012, 02:23 PM
Holy moley the windows script is fast!!! It's virtually instantaneous!
p.s. I hope you've noticed your 'honourable contributer' award whcih is the least we could do. Thank you so much for writing this script, grumbling hive!
If you ever want to write your own city creator with proper L-system streets etc, I'd be delighted to help (with everything except the programming!).
09-22-2012, 02:27 PM
I hope you've noticed your 'honourable contributer' award whcih is the least we could do. Thank you so much for writing this script, grumbling hive!
Yeah, I said, "I'll be boasting for weeks"!!! My house is starting to fall apart due to my rapidly expanding ego...
I actually am working on my own city generator..watch this space!
Be sure to tell me if you find any problems with my program, and thanks again for my award, woohoo!!!
09-22-2012, 02:30 PM
Congrats to your new award!
I've tried the Windows version (Win7, 64bit) using a city file from RPGCG 5.40. Converting to *.svg works, but only for a small part of the streets. Importing it to Illustrator CS4 produces one layer with some street paths. Anyone else with this problem?
09-22-2012, 02:32 PM
It worked for all the streets that I had. Could you post up your .sgs file katto and I can try it on my machine?
::edit:: I am opening it in Drawplus not Illy though
09-22-2012, 02:33 PM
Please can you post the svg and sgs files that didn't work?
09-22-2012, 02:47 PM
Here they are.
I've tried to look what svg standard Illustrator uses, but the help is not very helpful :)
There the program is nearly 2 years old I'll guess it uses standard 1.0, but I don't know the changes to 1.1, if this is the problem.
09-22-2012, 02:59 PM
Illustrator's SVG standard is non-standard...
Works nice on my machine...try inkscape and export to emf or something...I'll try and make it play nice with illustrator in the next version. Or maybe we need an .svg to .stupid.adobe.svg converter...
09-22-2012, 03:05 PM
Thank you, GrumblingHive.
I've thought something like that and just download inkscape.
Edit: Works fine with Inkscape :)
It keeps crashing on me.. I am using CG 5.4 and windows 7 64bit.. I drop the file like it says, and hit enter.. Works for a sec and crashes..
edit wrong file added lol..
09-22-2012, 03:58 PM
Man that was fast!!
I ran a few small towns and villages though and it was all in a blink of an eye; I clicked enter and then the window disappeared....THEN I noticed the file in the folder.
Okay, Lets try something bigger, so I went to max size and buildings, no trees or lakes and RPGCG took 1 1/2 min to generate a 6mgb file, and guess what...the converter crashed......After a few other tests I figured that somewhere around 3mgb is the limit because it was quite quick (a few secs) to do that one, and I was real impressed with the job it did...
VERY well done :D Rep on the way!!!!
Got a question for you...What format of images does this work on, or is it strictly for RPGCG? Not that that isn't more than enough mind you, but was wondering if it can also be used elsewhere.
09-22-2012, 04:24 PM
@ruff: remove the "" then it will work, remove also any spaces in the filename
@ravi: if you have found a way to import the *.svg file and export it to *.dxf for City Engine use that works, it would be fantastic (there seems to be no trial version of your favourite program Draw Serif)!
09-22-2012, 04:43 PM
Hmmm. I'm guessing since you're running win7 64bit that ram is not a problem..I can't check that file right now, but I'm guessing "small village" means it's not a very big city.
Try making sure that the .sgs file is in the same directory as the program and see if that helps.
Sometimes I get a crash on the windows version with a really big city, but then the linux version works fine. Maybe it needs recompiling with a better compiler...
I should really start quoting people to make it clear who I'm talking to. I don't normally participate in such active threads...
09-22-2012, 06:36 PM
@katto: I have always had problems getting the .dxf export from Serif Drawplus to work in City Engine (which likes the AI export). In the end I have to open the .dxf file in Campaign Cartographer 2 (which is built around Autocad I think) which then allows me to export it in a way that City Engine likes. It was a while back when I did this and really fiddly, but give me a couple of hours or so and I should be able to figure out how to do it again.
The hours I spent trying to get CE to accept a Serif Drawplus .dxf and the zillions of different freeware programmes I downloaded to try and get it done .. it was a lot.
I'll give it a try...hang on.
There is a free starter version of Drawplus here: http://www.serif.com/free-graphic-design-software/
but I don't know if it will open .svg files....worth a try!
09-22-2012, 08:37 PM
You're going to have some problems importing into city engine, mainly due to the overlapping splines. You could try setting the anti-overlap check in RPGCMG to maximum, and/or create a sort of giant compound path from all the buildings,bucket fill the largest negative space and use the resultant fill as a shape to simplify things a bit.
I should be coming up with a more memory-efficient version of the program in the next couple of days to address all the crashes people seem to be experiencing...
09-23-2012, 06:03 AM
@ravs: No problem here with exporting dxf files from CC3 to CE. You must set the fill style of the houses to hollow, that's all.
09-23-2012, 02:17 PM
Here's a new (windows 32 bit) binary. It's a little slower, but crashes less (I actually couldn't get it to crash at all, even on 20,000 buildings, maximum streets etc, even the biggest file I could make didn't crash the crappiest computer in my house)
If anyone does get an error, please tell me so I can try and fix it for you...
Try and put the program in the same location as the file you are trying to convert. Probably best to stick to your desktop for now.
Also it's probably better to stick to letters and numbers with no spaces in the filename.
Oh, and if you happen to have a file called "TEMP.txt" in the directory you're using, <IT WILL BE DESTROYED BY THIS PROGRAM PROBABLY>. So call your important "TEMP.txt" file something else before you run it, ok?
Also, when it says "drop the file..." Don't do this. Just TYPE the filename and all should be well.
Probably needs Visual C++ 2010 Redistributable Package if you don't have it installed already...
09-23-2012, 06:14 PM
I've found a bug! I think!
On my machine the new version is producing houses which only have '3 sides' and not an enclosed 4 sided shape. In the he attached I've given the house objects a gray fill and a 1pt stroke. The older version made enclosed shapes which is much more useful.
09-23-2012, 06:33 PM
When you say "new version" do you mean, it didn't used to happen in the bash script version? Or the earlier version in this same thread? Anyway, I'll look into it soon!
edit: yup, you're absolutely right, well spotted. Happens in the other binary version too. I'd better fix that, hadn't I? :)
Oooops....seems I got "polygon" and "polyline" mixed up. That's the problem. Easily solved though!
By the way, the newest versions are now on the first page, and all the other versions are removed. To make things simpler...
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.