PDA

View Full Version : Create a random town



Ascension
02-01-2009, 09:09 AM
Redrobes actually inspired me with his town patterns project and while discussing things in his thread I had an idea so I followed up on it. It's all self-contained (image and instructions) and while it's not perfect, it is a jumping off point for experimenting on ways to alleviate the tedium of drawing out towns in raster programs. I will almost certainly be changing and adapting this over time, but since this is my first go at it, I thought I'd put it up for others to digest and dissect.

Steel General
02-01-2009, 10:24 AM
I think you're definitely on to something here...a few tweaks here and there... have to give this a whirl sometime.

I wonder how hard it would be to turn the basic steps into an action?

Ascension
02-01-2009, 10:50 AM
Quite easy, I just haven't done it yet :)

jfrazierjr
02-01-2009, 11:20 AM
How hard woulkd it be to seperate the text into a post body, .doc, or something else, even putting a solid color cartouch behind it would really help my old tired eyes.

Ascension
02-01-2009, 11:50 AM
No prob, will do after lunch.

Ascension
02-01-2009, 01:57 PM
Ok I uploaded a doc file with pics to the first post of the thread.

gorkamorka
02-01-2009, 06:07 PM
Cool way of doing this

Sigurd
02-01-2009, 08:44 PM
I think I've read all your tutorials Asc, this is the most imaginative and interesting one IMHO. Good job.

Sigurd

Ascension
02-02-2009, 12:30 AM
Thanks, Sig, but I owe a large amount of credit to Redrobes for getting my brain working with his city patterns (thanks Red).

Redrobes
02-02-2009, 01:41 PM
Cool job Ascension - I will have a similar hack at it in a while. Cities are a lot of work right now and I for one welcome some ways to automate some parts of it. We did scripts for tiles a while back and they work well. Robs dungeon script is certainly well developed now and I reckon that chugs out dungeons to a standard thats quite hard to match by hand. Terrain has almost always been scripted usually off of some random starting point too so if we can get cities into that same league then were really cookin.

I have always wanted a big app which makes great random terrain then fills it with virtual people which build houses get jobs, marry have kids which go on to get other jobs and so on building up the virtual world with a full list of buildings and people who live in them. A sort of genetic algo RPG world builder. Thats a bit of a way off at this point tho ;) The bits of scripts and tools are like that metallic bits of The Terminator when hes all molten, coming together bit by bit. Maybe one day we will say "ah we can chug out terrain no problem and we can chug out cities no problem and dungeons too, we have character stat builder and all the monster stats and the scripts which run the rules to know who would likely win in battles so lets glue all of those parts together". Pipe dream I reckon but no harm in traveling on that road for a while huh ?

Ascension
02-02-2009, 04:54 PM
That's exactly where I'd like to go, creating an entire fantasy world from the ground up just by pushing a few buttons, then combine it with Sigurd's find of that awesome German terrain renderer, then get something like the Sims to populate the place and I could have my own world/ant farm and with some powerful 3d apps I could walk among the people. Might need to get some of Pixar's computers or ILM's for that tho :)

sambrookjm
02-02-2009, 06:00 PM
I wrote up a quick GIMP script that does MOST of this automatically.

Things I'd like to improve:

Beveling the rooftops. Right now, this just sets the rooftops to a set color.
Running the threshold to make the buildings interactively instead of setting values for them in the front end. If you guys know a way to do this, please let me know. This filter doesn't have the interactive/non-interactive flag.
Any other suggestions you guys might have. :-)


The roads are generated using a Mosaic plug-in, and the somewhat roughened up by a displace map of random noise.

Great tutorial!

RobA
02-03-2009, 12:16 AM
I wrote up a quick GIMP script that does MOST of this automatically.

Things I'd like to improve:

Beveling the rooftops. Right now, this just sets the rooftops to a set color.
Running the threshold to make the buildings interactively instead of setting values for them in the front end. If you guys know a way to do this, please let me know. This filter doesn't have the interactive/non-interactive flag.
Any other suggestions you guys might have. :-)


The roads are generated using a Mosaic plug-in, and the somewhat roughened up by a displace map of random noise.

Great tutorial!


Attached is a mod of your script. (funny to see how other code ;) )

This adds a bevel roof layer (overlay mode)

I also changed the simple motion blur into a motion-blur/threshold alpha/gausian blur which (imoo) gives a better result. Also set the opacity down on this layer.

Funny that the threshold doesn't have an interactive mode... should post this on the gimp devel list as it could be an oversight.

I changed the road spacing and width to be /4 so the slider is in pixels.

I also changed where it registers. I moved it to File>Create, which is were (afaik) they gimp devels are suggesting image creation scripts should register.

-Rob A>

sambrookjm
02-03-2009, 07:58 PM
Attached is a mod of your script. (funny to see how other code ;) )

Hopefully, it wasn't too difficult for you to follow! :) I'm still a relative neophyte when it comes to scripting this sort of stuff...


This adds a bevel roof layer (overlay mode)

I also changed the simple motion blur into a motion-blur/threshold alpha/gausian blur which (imoo) gives a better result. Also set the opacity down on this layer.

Yeah, that does give a better result. Very nice technique.


Funny that the threshold doesn't have an interactive mode... should post this on the gimp devel list as it could be an oversight.

I was really surprised by that as well...but this is the first time I've used the threshold filter in a place where it would be useful to run it interactively.


I changed the road spacing and width to be /4 so the slider is in pixels.

*smack* Good catch. Those values were left over from when all of the layers were originally the full mage size. Then I realized that making them one-quarter size would make the script run much quicker and changed the script to do that...but forgot to change them back. I was just happy to get the darn thing working! :)


I also changed where it registers. I moved it to File>Create, which is were (afaik) they gimp devels are suggesting image creation scripts should register.

I'll remember that. Thanks for the tips and improvements!

sambrookjm
02-04-2009, 10:47 PM
I made a couple of changes to your modded script after running it through a few more times.

I used your threshold-alpha filter on the building level to remove all of the buldings that were underneath the roads. With the feathered selection you used for the roads, there ended up being too many shadows. Running the threshold-alpha filter with a value of 200 on the town layer got rid of the buildings under the roads, which eliminated any extra shadows. The method you used to generate the shadows is still in place, though.

I also changed the script so that the random maps no longer have to be square. The maps can be anywhere from 300 to 3000 pixels in either dimension.

Your additions were noted in the comments in the script. Credit is given where credit is due!!

I attached a zip containing the new script, as well as a picture of what my run looked like with the default values. This was a great tutorial to code up, and now I know how to bevel stuff!

CBDroege
02-05-2009, 10:36 AM
I think you guys should check-out this program:

Roleplaying City Map Generator:

It randomly generates towns along a lot of really complex options. I've been using it to generate the maps of my cities lately. Its drawback is that its output is particularly ugly (see my map of Loa in the completed works area (and that after touching it up a lot)).

If someone could make a program with the complexity and flexibility of Roleplaying City Map Generator, but with the really pretty, 3D output that you guys are doing here, it would be the best city mapping program ever.

just throwing that out there :)

RobA
02-05-2009, 02:43 PM
I think you guys should check-out this program:

Roleplaying City Map Generator:

It randomly generates towns along a lot of really complex options. I've been using it to generate the maps of my cities lately. Its drawback is that its output is particularly ugly (see my map of Loa in the completed works area (and that after touching it up a lot)).

If someone could make a program with the complexity and flexibility of Roleplaying City Map Generator, but with the really pretty, 3D output that you guys are doing here, it would be the best city mapping program ever.

just throwing that out there :)

Thanks for pointing that one out. It has been mentioned quite a few times here, and is the basis for a few tutorials.

I see the original author's site is down. We can host the zip here for now as a convenience (it is hosted at a few fileshare sites as well) but we may have to remove it pending any concerns from the author.

-Rob A>

CBDroege
02-05-2009, 09:12 PM
Sorry about that. I haven't made it through the archives yet, and as it was really difficult for me to finally find this program, I thought it might not be widely spread. :/

sambrookjm
02-05-2009, 09:55 PM
I tried running the file in the attached ZIP, but I got an error saying that comdlg32.ocx couldn't be found. Anyone know if there's a Vista (64-bit) equivalent to that ocx file?

Korash
02-06-2009, 05:33 PM
I unzipped the file into the .gimp-2.6>scripts folder but I can't find it when I open gimp :(

what am I doing wrong?

Notsonoble
04-21-2009, 12:37 AM
I found a working MSI of it instead of just the exe...

ravells
05-24-2009, 06:35 PM
Ascension, I hadn't seen this tutorial before, it's pure genius!!!

I'm off to have a play to see if I can use it to get more convincing house distribution by playing with the initial noise layer.

Rated 5 and repped (if I can).

Ascension
05-24-2009, 06:41 PM
Thanks, bro. I should probably revisit this and see what sort of tweaks or streamlining I can do to it.

ravells
05-24-2009, 07:54 PM
I've managed to get some reasonably believable city block designs with some fiddling (all filters)....I think we may be onto something here. This distribution doesn't look half bad. Now I just have to remember what I did to get this.

I did use the Xenoflex mosaic filter rather than the photoshop one...have you got that, Ascension?

Must say I'm quite excited about this!

ravells
05-24-2009, 10:06 PM
Getting there....Waldronate's max/min filter came in handy too for squaring up the buildings.

Ascension
05-24-2009, 10:22 PM
Yep but I try not to use 3rd-party pay for plug-ins on my tuts...I like to get the ball rollin and let others experiment with their own tweaks with what they have. I do like the tip waldro had, tho, and your village has a real artistic feel to it. You'll have to make an addendum here with how you got that look :) Looks pretty cool.