My attempt at random city (WIP)
Gathar
Traveler
Hello,
I've tried to have a nice random city, but I'm somewhat unsatisfied by the existing tool. I think the cities look too modern, like a suburb where each house is placed along a road, separated from the next one. This is not what I've seen in old, unplanned cities, where everything is much more crammed together.
So, I wondered why wouldn't I try to make my own algorithm to automatically generate a random ancient city? I will try to avoid roads: Large roads will be drawn manually on the map anyway, and minor roads, from my point of view, don't exist: They are just free space between buildings.
I want to share with you my progress on this road. It it leads somewhere, I'll try to see how to integrate the results inside CC3+, but first, let's see if I can get something that suits my taste.
Fist step: Just place buildings randomly, even if they overlap. The goal is just to have the basic elements, the definition of a building, a way to see my results (with zoom & scroll)... So the result is not impressive...
[Image_9398]
I've tried to have a nice random city, but I'm somewhat unsatisfied by the existing tool. I think the cities look too modern, like a suburb where each house is placed along a road, separated from the next one. This is not what I've seen in old, unplanned cities, where everything is much more crammed together.
So, I wondered why wouldn't I try to make my own algorithm to automatically generate a random ancient city? I will try to avoid roads: Large roads will be drawn manually on the map anyway, and minor roads, from my point of view, don't exist: They are just free space between buildings.
I want to share with you my progress on this road. It it leads somewhere, I'll try to see how to integrate the results inside CC3+, but first, let's see if I can get something that suits my taste.
Fist step: Just place buildings randomly, even if they overlap. The goal is just to have the basic elements, the definition of a building, a way to see my results (with zoom & scroll)... So the result is not impressive...
[Image_9398]
Comments
On the first picture, the algorithm added about 25000 buildings before considering it was done:
[Image_9396]
The second picture is a zoomed area of the first one:
[Image_9397]
We can see some interesting emerging patterns on these picture, but it clearly does not look like a city at all. I think it might look like people installing tents where they can during a grand meeting of the clans
Personally, I found tweaking the settings of the Random City Generator can yield some pretty nice results. Even if I don't keep them as generated, I can always delete some streets and copy/paste buildings to make areas more packed or random. Still, I'm curious to see where your experiments take you.
Thanks for sharing,
~Dogtag
A third step. This time, I only plant a few buildings totally at random (100 seeds, displayed in blue), then when I create the other ones, I align them with the closest seed. This higher regularity allows to pack 30000 buildings instead of 25000.
[Image_9405]
And a zoom:
[Image_9406]
While I like this direction better, I think the gaps between the buildings are still too large, I'd like most of them to be in clusters of a few buildings that touch each others, and the the clusters positioned at random. I'm going to think how I can get this result...
Right now, I started to work on this cluster stuff, and I've reached the following result:
[Image_9464]
It's been more complex that I thought first, because it's hard to formulate precisely "random, but touching another one". I finally chose this algorithm:
- Create a random building at a random height
- Move it horizontally until it touches another building (if there is one at his height, 0 otherwise)
- Then move it vertically until it touches another one (same special case).
Next step: Create a city with different clusters (at different angles) and make sure they play nicely with each others. It shouldn't take too long, but I should refrain from starting a new step at 2AM...
And here it is:
[Image_9485]
And a zoomed-in version:
[Image_9486]
I'm quite satisfied of how it turned out.But I'm partial to the subject, so I'd really appreciate to hear comments and suggestions for improvements.
Do you think it would be worth integrating this algorithm with CC3+? Does anyone have any idea on how to do it? Can a macro be enough? Do I need to write a plug-in? Or maybe I can generate a file in a format that CC3+ can import?
As for import to CC3+, there are several options
- Have your program generate a script file that CC3+ can run. This is the simplest option. A script file is basically just a series of CC3+ commands
- Write a CC3+ plugin. Orders of magnitudes more complicated than the above options, but allows everything to be easily done from within CC3+.
- Write a program that communicates with CC3+ through intercom. Basically another way to feed CC3+ commands instead of generating a script file that must be manually run, but also way more complex.
- Make a program that can actually write the .fcw file format. Then you can simply have your program generate a starting FCW for you, and work it in CC3+.
- Depending on the complexity of your algorithm, you may be able to implement the entire thing as a macro, but there are limitations for what is reasonable to do in a macro.
So, where's Waldo's house?
Sorry Dogtag... my typing goes down hill when I'm tired.
Would it be possible to add paths that mark larger roads, so the city is generated around the roads? Also, for export to CC3+ it might be a good idea to add an option to mark the outer limits of the city, so it only generates what you really need.
Importing everything into CC3+ could lead to some performance issues...
Great job, anyway:D
jslayton: I might give it a try, but the way I see, it can also be done by the user generating the city not in one go, but once for each kind of neighbourhood, with specific parameters.
Monsen: Thank you for those ideas. The plugin seems like the more interesting option, I'll see what I can do.
All the others: Thank you !!