We built this city

5 04 2010

Busy week my friends! Such a busy week! So, I’ve not had much time during the week to get much done with Cityscaper because of unplanned Tag visits, slightly more planned Leamington Spa visits, totally unplanned Newcastle visits and even less planned Edinburgh Waverly visits. But lo, this weekend I’ve stormed through and added loads of things! I think I shall put them in bullet point form for easier digestion and then expand a bit:

  • All geometry moved to Vertex Buffer Objects on the graphics card rather than display lists.
  • More efficent handling of generation so roads aren’t all generated at once.
  • Generation techniques seperated into 4 templates: Height based, grid based, radial based and organic.
  • Property Flags.

So, the first point is pretty self explanatory and has improved the framerate of the application quite a bit! Happy days! The second point I cheated a bit and put a limit on how far the framerate counter can go so all the roads aren’t given a tiny framerate and compensate by generating all their road at once which they used to do all at the same time leading to ugly spikes.

Different templates are now used. Grid is slightly improved now as it is locked to compass points rather than straight lines and perpendicular offshoots, this means that if a road stops being grid based and then starts again they can still follow on the same grid pattern. Height based is what the last post was about and is just building the roads based on the line of least inclination. Organic is the basic generation with few limits to where the roads can go so they appear to wander in a nice (organic) way. Radial is a template I just implemented in the past hour and is far from finished yet but it’s a good start. For the radial template roads try to form a circle around some middle point, well they should in theory, at the moment they just seem to spiral into it.

Finally Property Flags. This is what I’m most excited about. Property flags are user defined points with a user defined radius around them that hold settable properties for all the roads that come within the radius of these flags. This leads to super varied city structures with the ability to combine different templates and attributes for roads at different places on the map! Here’s some screenshots to show the flags:

Property flag around hill.

Property flag round hill with generated roads.

Here's a roadmap with a few different flags on it.

Road map with 2 organic flags one rather large and obvious the other much smaller!

And that’s that! I don’t think the screenshots really do the system justice cos it really is pretty darn nifty. Anyway, for the next week I shall:

  • Fix the radial template
  • Add in proper UI support for the Property Flags.
  • Make the road collisions a bit prettier.

You may have also noticed that there aren’t any buildings in the screenshots well I’ve decided I’m not too happy with them and they distract from the majesty of the road structure being formed so I’ve decided to leave them for a bit and redo them when I’ve got the roads out of the way. Until next time blog fans.

Advertisement

Actions

Information

3 responses

14 05 2010
Philipp Geyer

Thanks for the comment. Your project looks far more impressive than mine :P reminds me of trying to organise cities in oh so many sim games :P Yeah, very cool :) I like *Nistur’s Stamp Of Approval* :P

14 05 2010
Philipp Geyer

I just noticed… was curious… why is there a little smiley in the corner of the page? :)

15 05 2010
mattlacey

Thankyou, thankyou!

And I think you’re imagining that smiley!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.