PDA

View Full Version : Randomizing City House Creation



Nomadic
02-10-2009, 01:36 AM
I am currently mapping out a massive trade center city for my world and I have just finished getting the walls, streets, and house areas in place. The problem is that the city has a population of about 115,000 people so there are thousands of buildings. I was wondering if anyone had figured out a way to create a random scattering of various houses. I know there's a tutorial for doing this in gimp via mosaic but I am stuck with photoshop (and photoshop's mosaic filter is nothing like gimps). So any ideas as to how one might pull this off?

ravells
02-10-2009, 02:31 AM
Finding a city generator which will produce credible looking cities is a bit like finding the philsopher's stone. There are some automated city generators out there if you're not particular about what your city should look like.

I still remain somewhat convinced that someone who is good at programming could make something with 'Context Free' (google it). I think Redrobes is working on something.

Vector programmes have a brush setting where you can put down 'house shapes' at random following a line, so you can populate a street very quickly that way, (CD3 has a similar option) but the results are a bit 'meh'.

All I can suggest, if you are using photoshop, is to start out with your city as a single solid black shape. Download some references from the web as to what you want your city to look like and start to carve out negative space from the shape using a white brush. It will take ages though.

waldronate
02-10-2009, 03:30 AM
http://www.vision.ee.ethz.ch/~pmueller/documents/procedural_modeling_of_cities__siggraph2001.pdf is a good paper on the subject of procedural city generation. There have been a number of others SIGGRAPH papers on the subject in recent years.
http://www.citygen.net/ is also fun.

ravells
02-10-2009, 05:35 AM
Fantastic, thanks Waldronate!

Vandy
02-10-2009, 07:03 AM
Hello, Nomadic.

To build upon what ravells posted, you might want to read through the following two tutorials to get some "pointers":

A medieval town map tutorial in Photoshop (http://www.cartographersguild.com/showthread.php?t=1150)

Eneini: a medieval city tutorial (in Photoshop) (http://www.cartographersguild.com/showthread.php?t=530)

Good luck.

Regards,

Gary

Redrobes
02-10-2009, 08:02 AM
Good links Waldronate.

I would like to program something but so far I haven't started and I don't have enough time really to do it.

Nomadic
02-10-2009, 04:11 PM
All I can suggest, if you are using photoshop, is to start out with your city as a single solid black shape. Download some references from the web as to what you want your city to look like and start to carve out negative space from the shape using a white brush. It will take ages though.

Sadly this will not work, a city of this density means that there shouldn't be any space between houses outside of the rich district. What I really need is a way to put houses edge to edge like you can do in CD. I am thinking of perhaps carving out every other house in order to do this but again we're talking cutting out 10,000-30,000 houses by hand. Not a fun endeavor.


http://www.vision.ee.ethz.ch/~pmueller/documents/procedural_modeling_of_cities__siggraph2001.pdf is a good paper on the subject of procedural city generation. There have been a number of others SIGGRAPH papers on the subject in recent years.
http://www.citygen.net/ is also fun.

Interesting read, though a bit above my head as I have never been good at combining my two hobbies (graphics and programming).


Hello, Nomadic.

To build upon what ravells posted, you might want to read through the following two tutorials to get some "pointers":

A medieval town map tutorial in Photoshop (http://www.cartographersguild.com/showthread.php?t=1150)

Eneini: a medieval city tutorial (in Photoshop) (http://www.cartographersguild.com/showthread.php?t=530)

Good luck.

Regards,

Gary

Yes I have read through both of those. In fact the first one is what I use as inspiration for my smaller towns. The second one though in my opinion isn't any good. The building shapes are unreal and the texture is very blurry. However, I don't think it is any fault of his. Photoshop's noise filters are somewhat sub par compared to GIMP's.


So then I guess I will just have to get it done in GIMP. I will give it a try myself, if it doesn't work I suppose I can just throw it up here as an unpaid job for someone with more skill than I in GIMP.

Ascension
02-10-2009, 04:44 PM
I hate to plug myself but you might want to look at my Brownstone map. There are some sections there where I basically just ran a fat (21-pixel) square pencil to make some lines then went back with a 1-pixel eraser to carve out a tiny line...this layer was then given an inner bevel (chisel soft) to create roof-lines and then a 1-pixel stroke to hide the cut out lines. You can't really apply a thatch pattern overlay to the resulting shape so that's why the chisel soft bevel was used (it puts some lines in). If you'd like I could probably do up a quick tut for that, it's not the greatest but it saves a whole ton of time.

Nomadic
02-10-2009, 04:55 PM
I hate to plug myself but you might want to look at my Brownstone map. There are some sections there where I basically just ran a fat (21-pixel) square pencil to make some lines then went back with a 1-pixel eraser to carve out a tiny line...this layer was then given an inner bevel (chisel soft) to create roof-lines and then a 1-pixel stroke to hide the cut out lines. You can't really apply a thatch pattern overlay to the resulting shape so that's why the chisel soft bevel was used (it puts some lines in). If you'd like I could probably do up a quick tut for that, it's not the greatest but it saves a whole ton of time.

A tutorial would be awesome.

Edit: haha my title now matches my name.

ravells
02-10-2009, 05:33 PM
I suppose I can just throw it up here as an unpaid job for someone with more skill than I in GIMP.

Good Luck! I think the short answer is (so far as I know anyway) there are no short cuts to making a convincing looking city. Good cities with lots of detail take an age to draw.

Nytmare
02-10-2009, 05:47 PM
So after reading through this thread, I decided to play around with some brush scattering in Photoshop and got some decent test run results. Has anyone else tried playing around with anything like this?

Redrobes
02-10-2009, 06:05 PM
Sure and the problem is two fold. One is that it looks nothing like a city. No dis - we have all tried and failed. A city looks like something that has evolved and has some structure. Nobody builds totally random houses in cities. I tried to hand pack them together and then carve out roads and it still does not look right. Were all missing something.

Second, all the lighting is wrong. The idea of the thatching scripts for cities is to try to get a uniform lighting and possibly shadowed effect over all the houses. This at least I think we can do pretty successfully tho.

So we need a program that can place down height maps of buildings in some automated but intelligent way and then we can apply textures quite well to make the city. Otherwise its allocate a huge amount of time and use any ole program, PS, CC3/CD or something and manually put down 10000 icons. Hoel has pointed out that this slows down apps and in any case we will have fixed our res and... well a million other reasons why I dont want to go down that path. I want cities where I spend my time defining the essence of it - shape, structure, purpose etc, not jabbing lots of icons down.

Its all very frustrating. Maybe a custom genetic algorithm type app or similar is the only way. Just hoping that there is a short cut that will work.

I think half my problem is not knowing what medieval cities actually looked like in any detail and also not knowing why they made them the way they did - or even what options they had. That would probably cull down a lot of these issues.


http://www.cartographersguild.com/showthread.php?t=1932

http://www.cartographersguild.com/showthread.php?t=4141

http://www.cartographersguild.com/showthread.php?t=3392

Nytmare
02-10-2009, 06:06 PM
Here's one with a larger brush size and a purposeful tight cluster to see how it would handle the rooves stacked on top of each other. I think there's definite promise here.

Nytmare
02-10-2009, 06:17 PM
I was thinking of it more as a way to make a lot of separate house elements all at once that you could then place to fit.

My main reason for avoiding houses in my larger maps was because I couldn't come up with a fast way to do a ton of rooves that weren't obvious carbon copies of each other with the same basic orthagonal layout.

The only option that presented itself to me was to do close to each one individually by hand which wasn't something I was willing to do. Something along these lines would give me that organic look and feel and cut out the long and boring work.

Also, I don't see how the lighting is wrong, that's natural rendered light from a single source, not random shading. :)

Remember that that was honestly 5 minutes of screwing around with the brush options and a lighting effect trying to go in a new direction, not a final solution.

Redrobes
02-10-2009, 06:27 PM
Oh I agree entirely that there's no fast way of doing it. I don't know the answer and its no slight on you. I was screwing around in a similar way last night on another thread and got a similar result but its not a city. Mine wasn't good at all. I just don't know what to do at this point that does not involve a large programming effort to solve it.

Lighting on second image is better but first has houses with dark on left and dark on right too. Anyway that's not a big problem as we know how we can fix that one.

If there was a really clever random distribution that happened to make nice city blocks then that would be great but I don't think its going to pop out. I think we will need to get the PC to do some work here and think about each house going down minimizing new walls, shortest routes to popular places, keeping roads open and straight, no cut off regions etc etc. There's too much to get wrong for it to come out with a random spread of houses.

I am beginning to believe that it cant be solved simply.

woekan
02-11-2009, 05:58 AM
I created faircrest by drawing blocks and then erasing the roads and squares.

I'm not sure if brush presets will work on cities, maybe on towns.

I'm thinking of doing something with pattern overlay's to define the houses in city blocks.

Nomadic
02-11-2009, 05:45 PM
I created faircrest by drawing blocks and then erasing the roads and squares.

I'm not sure if brush presets will work on cities, maybe on towns.

I'm thinking of doing something with pattern overlay's to define the houses in city blocks.

This is what I have had to resort to for Palaoyr. Unfortunately due to it's size there is something like 110 blocks to chop up. I am on day 2 of chopping it up and am only 25% done.

ravells
02-11-2009, 05:50 PM
The pain will be worth it in the end! :)

Nomadic
02-11-2009, 07:13 PM
The pain will be worth it in the end! :)

I hope, I just finished chopping up the rich district of the city. I am thinking that I may copy it over to the merchant areas and then do a poorer district and copy it over to everything else. Then I just need to go around filling in gaps and cutting out odd houses.

Towser
02-13-2009, 10:14 PM
One thing that I do is make house templates...and copy and paste them far from each other, or sometimes I just change the hue, Saturation, and lightness of one of my house templates and resize some of them. Some of the older houses are probably a little darker and less saturated and some of the newer houses may have more saturation and lightness.I try to think of the weather patterns for the region too. So if the city has lots of rain there are going to be rooftops that have good drainage. or in desert regions maybe they have flat rooftops. I know this won't be the easiest way to put as many houses as you are talking about, but I just put on a good album and go to it!