View Full Version : Using City Engine

03-31-2011, 08:21 AM
City Engine ('CE') is a powerful procedural city generator. It makes 3 dimensional cities according to rules that you give it. It has a high level of 'editability' meaning that if you don't like something that has been generated it is possible to tweak it to your own specifications (or indeed draw it from scratch). Generally you will make and texture your city models in CE and then export the result to a 3d graphics program to render it, tweak materials etc.

This thread are my baby steps using CE.

In the first image I have auto generated a street network. Lot of sliders that you can play with here such as street lengths, how you want the streets to split, how straight or curvy you want them to be etc. You will see that where an area is enclosed by streets, CE generates Lots, those are foot prints on which you 'grow' your buildings. There are commands you can give to make the lots bigger or smaller, or forbid building on a lot or number of lots or you can paint them in yourself.

The second image is a look at the programming language to make houses, you can either do this by writing code in the traditional way or use a node based interface (which is easier for me). Here I have set two variables (called attributes in CE) of height min and height max. This very simple code extrudes buildings from the lots to a random height between height min and height max. Again, the user can go to any particular lot and set the height manually if required.

The last image shows the buildings generated from this very simple code. CE allows you to import your own building objects either to place as is, or as elements to which you add code to add bits onto..but I haven't got to that bit yet!

More later,


03-31-2011, 09:20 AM
Thanks for posting your baby steps :) It will give us a good idea how easy or difficult this program is.

03-31-2011, 10:59 AM
lol believe me if I can use it, anyone can. I have virtually no programming experience at all. Here is the next step (getting fancy for me, lol!)

So the instructions here are:
a. scale the buildings sizes by 50% along x,y and z axes (so they are not butted up right next to each other).
b. split the houses along the y axis by exactly 3m starting from the bottom and keep splitting until you run out of house (this makes the floors, or put another way, makes new faces each of which can be textured differently).
c. make a gabled roof with a pitch of 22.5 degrees with the eaves overhanging by 1m along x and y.

03-31-2011, 11:13 AM
that's starting to look cool already! thanks for posting this, cheers DJ

03-31-2011, 01:34 PM
Cheers DJ....it's starting to get complicated now. Trying to split the buildings so that there are faces which can be used to put window textures on them. I ended up following the tutorial for this bit and don't really understand what I'm doing, so I'm going to have to sit down and try to analyse it properly before I move on.

Ryan K
03-31-2011, 09:12 PM
Looking great, Rav!

03-31-2011, 09:23 PM
Okay, this is looking great....but WHERE do you get this prog???

Can you apply a base height to the buildings? and if you can can it be done by building or area? ......okay I need to look into this..... ;)

04-01-2011, 03:25 AM
Hi Korash, you can get it here: http://www.procedural.com/

Not sure what you mean by a 'base height', you can extrude a building from a lot by however much you want. So for example you can extrude all buildings by 3m giving you a 'base height' of 3 m. Then you can extrude again by variable amounts if you want buildings of different heights.

04-04-2011, 07:02 AM
Been struggling a bit but getting there.

Being able to procedurally split your building walls into component facets is very important for texturing. Splitting operations can get very complex (for me) when you have to apply splits within splits. For example you split the building horizontally to make floors, you then split the building vertically to make 'tiles' i.e. places where the windows go. You might then want to split the tiles again so that you have some wall on either side of the window. The ground floor of a building usually looks quite different from the other floors, so it needs its own splitting and texturing rules.

Texturing was also a bit difficult to grasp at first, but now I think I've got it, it's not as tough as I first thought.

So here is are some buildings which all use the same construction and texture rules. If I wanted to make a building higher or lower, I can just adjust the height slider for that building and it will automatically add or subtract floors. I've just used some horrid random textures here, but obviously in a final product you would want the textures to tile properly.

The next step is to learn how to insert pre-made 3d assets, like window frames, doorways, ornaments, dormers and ledges to make the the building look properly 3d. That's going to be a toughie, but I'm probably going to spend this week just making sure that the splitting and texturing commands become second nature by doing lots more of these types of operation. After I learn how to insert 3d assets, the next step is doing mass modelling, that is bringing in instances of buildings, like balconies, turrets etc and getting the software to randomly generate buildings out of these components.

04-04-2011, 10:49 AM
Gosh the program is cool. Which version did you buy?
And if ever you manage to get the gist of it, please create a tutorial! :)

04-04-2011, 12:02 PM
I'm just scratching the surface of it. It gets much cooler. I'm going to work on some nicer looking textures this week so the next render should be a lot better.

I splashed out and bought the Indie version. You can get the Vue only version which is cheaper and download Vue for free, it will still accept the City Engine exports and render them for you, but you get a Vue watermark in the bottom right hand corner. If you pay Vue some money, you get the render without the watermark.

CE comes with lots of tutorials, but I'm hoping that we can build up a group of CE users here as swapping rule files and 3d assets will make it much quicker for everybody.

04-05-2011, 11:23 AM
Doing splitting and texturing practice and learning how to randomise textures in a controlled way, for example not having door and 'green window' textures on anything but the ground floor.

04-07-2011, 12:30 PM
Hi Korash, you can get it here: http://www.procedural.com/

Not sure what you mean by a 'base height', you can extrude a building from a lot by however much you want. So for example you can extrude all buildings by 3m giving you a 'base height' of 3 m. Then you can extrude again by variable amounts if you want buildings of different heights.

Thanks Rav, I had a look at it after googling it. It looks quite capable. As for the base height thing I was thinking about building on an inclining road and also with ground floors starting at higher than the building next door (ie: not all on flat ground). I noticed while looking at the midieval town sample that they have that yopu must be able to do that. :)

Now to convince the wife that I NEED to get this......... ;)

04-16-2011, 12:10 PM
I haven't had much time recently to continue my work with CE, but I took some time off today. I took a break from the 3d stuff to see how it would cope with plain old top down 2d mapping and I was really pleasantly surprised.

CE has a 'scene light' (i.e. the sun) which you can position, adjust the shadows intensity for etc. It's pretty simple (no soft shadows, ambient occlusion etc) but it's good enough.
The camera angles allow for orthogonal views and you can adjust the field of view of the camera.

What is quite cool is that because adjusting the pitch of the roofs is an easy global operation, if you want the roofs to catch shadow and you don't want the shadows to be really long, you can make the pitch of the roofs really steep. You won't see the super steep roofs in a top down orthogonal view which is quite cool.

So here are some pics of the experiments showing top down orthogonal without texture, with texture and shadow (note how the shadows 'fall' properly over gabled roofs) and a forced perspective view. You can see how steep I've made the roofs in the first picture.

The 'beauty shot' is the second picture. You can switch the black wireframe lines on and off, leaving them on gives a more 'graphic' outline look. I'm experimenting here with 'L' shaped procedurally generated buildings. CE does default L shaped, U shaped and the good old rectangular shaped. If you want to get more complicated than that, its a case of more involved coding.

And here is a little video (http://www.youtube.com/watch?v=xwDLJPbq3xY)editing the streets on the fly. Note how the buildings redraw themselves to conform to the new street pattern.

04-24-2011, 02:44 PM
My word, I want this! 00

Normally, if I feel like building a modern Earth city, I turn to CitiesXL 2011, which is pretty sufficient. I've made one or two maps with it using screenshots, but this... THIS looks powerful! :)

I'll download immediately (assuming it's a free download. If not... *sniff*)!

04-25-2011, 01:33 PM
How do you find City Engine handles the street layout part? I've looked through some of their papers (even tried to implement some of their methods), and it seemed to me that their city layout stuff is predicated very heavily on the modern era - fast road transport, separate residential, commercial, and industrial areas, modern ideas of real estate pricing, and so on.

The buildings, at least, look very cool!

04-27-2011, 05:17 AM
Wow, I'd never heard of CitiesXL 2011 - thanks for the pointer.

You can do street layouts in a variety of ways in CE.
You can draw the streets yourself (adjust street width on the fly) you can have pavements/sidewalks if you wish (again you can adjust the width)
You can import a DXF image of a streetmap, but CE will ignore the width of the line and set them to a single default 'major street' width which you will have to adjust manually to make minor streets (select street, type a width value or use a slider).
You can get CE to generate a street pattern for you based on simple principles - radial, grid or organic. There are lots of options on max street length, splitting etc (although not as many options as in RPG City creator).

You can do a combination of the above, so for example you can draw your major roads and then get CE to generate the minor road network inbetween them automatically and then edit afterwards.

Modern cities are much easier to do, only because streets are less wiggly and the buildings are more uniform which makes them easier to texture. One thing I do like about it (haven't tried it yet) is that you can use map 'underlays' to provide building attribute probabilities. For example: If you want taller buildings to occur more in the centre of the city, you have a map underlay (say black on white) like a layermask. You can tell city engine that the darker an area on the underlay, the more likely buildings there should be taller. Or you could say that the darker the underlay the more likely they should be tudor style buildings in that area. That way you can define neighbourhoods quite well (that's the theory) - as I said, I haven't got to playing with that bit in earnest yet.

There is just so much in this software to learn, but most of all the biggest learning curve is the cga language to make buildings and texture them. Again, quite straightforward for modern skyscrapers (which are mostly just cubes) but a bit more challenging with older, more ornate styles. If you need a 'one-off' building (e.g. a Colosseum, Palace, Castle etc ), you would probably build those using a 3d modelling engine and drop them into the map rather than building them using procedural code...although eventually I would like to be able to make simple procedural castles.

06-03-2011, 09:47 AM
Any progress yet? I just ask because I've started to work with CE also, great tool!

06-03-2011, 10:12 AM
Hi Katto, afraid not, i took a break to do this months contest and lots of r/l stuff going on the moment.

Glad to hear you've got it though, I'm sure you'll produce some wonderful cities with it!!

06-04-2011, 04:28 PM
Sure I will but I will be beaten easily by the master of city creation and that's you :)

06-04-2011, 04:53 PM
lol! Very kind of you to say, but I am nothing special.

06-04-2011, 05:29 PM
Hey this is pretty neat Ravs! I wish I had more time on my hands, I'd love to give it a whirl myself.