Cityscape – update 14

So, we’ve got a road layout – now we just need to add some buildings to it. For a first pass, I just add simple blocky buildings; one per lot, with a height equal to the minimum of the width or height of that lot, and it looks like this:

…which isn’t bad, I guess, but there’s these enormous monolithic slab like buildings all over the place, and it looks really homogeneous again. So, let’s add the other building types back in and see what that looks like:

Well, that’s a bit better, but it still looks a bit Bladerunner-ish – the big buildings are still far too big, and I’m getting scene-dominating and unrealistic massive wedges still. It just doesn’t look realistic – I need to reduce the size of some of the buildings.

So, the next step is that once I’ve done my initial load of lot-splitting, as documented in the previous entry, I then loop over all the lots I’ve created, and if any of them are bigger than a certain maximum size, or have a length:width ratio of greater than 5, then the lot is split again, and this repeats until all the lots are a sensible size/ratio. And the final result of that is this:

…which I’m much happier with. I’ve also played around with the fogging a bit, which means the buildings don’t start to fade out until they’re much farther away; I’m not totally convinced it helps – especially on the NC10, which these screenshots were taken on – it just makes the scene busier and adds more visual noise. I’m also a bit unhappy that the buildings still all seem to blend into one – it looks better in motion, but perhaps I need to increase the amount of colour modulation that happens with the windows? The other this is that there’s no street lights or roads yet – I’m hoping that these might help to break the city up a bit more, and that’s the next step.

(note that the framerate in all these screenshots is ridiculously poor – this is because I took the screenshots on my little Atom-powered Intel-integrated-graphics netbook – on a machine with a sane graphics card, we’re still getting close to 60fps – although not close enough that I’m happy to leave it without future optimisations)

In the meantime, you can, as ever, check the code out of the bzr repo – we’re up to revision 45 now.

Tags: , , , ,

9 Responses to “Cityscape – update 14”

  1. JonT says:

    Have you considered leaving a few lots empty to mimic real cities? Or design a carpark object. Plus, in older cities not all buildings are the gleaming-glass-and-chrome variety. Some are old-fasioned block and concrete grey. Might be worth changing the color of the underlying object from black to grey on a select few clustered buildings (since historic buildings tend to be in the heart of a city).

  2. tam says:


    just tried to compile and run the current version. Build without any issues, but running on my current laptop doesn’t show anything at all apart from the text about the FPS and polygons. The machine is a Core Duo with an integrated intel 945 GMA graphic Chipset. Any pointer would be very welcome. 😉


  3. Chris says:

    Tam: That’s because the camera is currently initialised pointing away from the city – hold down the right arrow key and eventually the city will swing into view 🙂

    (WSAD to move around, arrow keys to rotate the camera, Shift and/or Ctrl to speed movement and rotation up)

  4. Chris says:

    JonT: Those are useful suggestions – yes, I’d thought about leaving some lots empty as parks and things – I might give that a go once I’ve got the road-drawing code in so I can given them a different colour. Changing the building colour might be interesting too, but a bit hard under the current architecture….

  5. tam says:

    That is very funny to pock around with your code indeed. I’ve added some bits here and there to see if I could have fun with the 360 controller I have kickin’ around. It works prety well, although the camera seems to be a bit bumpy when moving forward.



  6. theorbtwo says:

    Perhaps when you get a plot that is very long and fairly narrow, instead of forcing an ordinary subdivision on it, you should ‘build’ N identical buildings? This would seem to echo what actually happens in cities to me.

  7. foobario says:

    This is a great series of posts, and I look forward to seeing where it goes.

    Just tried to get the source, but the directory is empty(?). Or maybe its the Bazaar thing, not sure.

  8. lagattack says:

    It looks pretty sweet so far. I followed the original Pixel City for a while and enjoy the more in-depth discussion here. I noticed that you are using FPS as a measurement of speed, but FPS vs Time Per Frame might be worth taking a look at. Other than that it is pretty sweet. Although I am getting only about 15 fps (~67ms / frame, unless I did the conversion wrong) on a desktop with a Radeon X800. According to NProf, most of the time is in DrawUserIndexedPrimitives in BuildingBatch. Good luck with completing the project.

  9. AmazinJay says:

    The last of the city scape XNA updates!?