Friday, 25 February 2011

Transportation: Road Networks Part 1

I've been working flat out on working out what I think would be good for a transport network within the game, and then (for the most part) trying to work out if it's technically achievable.  The end-result is that I have a billion ad one technical notes and code snippets that test out some practical points, but this probably won't shine through in this format!

So we start with road networks - an arbitrary choice, perhaps, but it's an important part of realistic city simulation and is probably the more complicated of the network types we have to create.  This is because, unlike say rail or air that have fixed entry/exit points (stations and airports), a car driving along the street can stop at buildings along the street.

And that statement has somewhat given the game away - individual cars will be simulated with individual departure points and individual destinations.  Overcoming the performance issues of this has caused the largest headaches for the past month or two, but I made it in the end!  Not only that, but we'll also be simulating driver behaviours on roads, such as:

  • overtaking
  • tailgating
  • individual speed decisions
These are quite complex, but will add a level of realism to the simulation, and will include a large number of parameters that could be tweaked externally.

The roads will also come with several static properties attached to them, such as:

  • number of lanes
  • maximum speed
  • surface properties (e.g. initial quality of surface, etc.)
These are coupled with dynamic properties that can be determined by several aspects of the simulation such as:

  • surface quality - the more cars that drive over it, the more the surface degrades and the harder it is to drive over.  Might be restored by some form of re-surfacing...
  • friction - if weather is simulated, then rain or ice might also make it harder to drive, influencing the driving behaviour of road users.
So over the next couple of posts, I'll expand on these, ideally with some diagrams - and if you're unfortunate, I'll include some small mathematical points about how some of these things will be done.  I'll also cover (in a very high-level way) the way that I can do all of this while not requiring each of you to buy a Cray Supercomputer to play this game!

I should point out that I'm now programming a lot of this while I type.  I'll want to show things off to you folks during development.  Question is, could you cope with really horrible and crude graphics while I get the underlying detail good?  If not, I'll sort out some nicer 3D stuff for the journey - but I might ask if any of you know anyone who can do some 3D graphics work!  Let me know!

Cheers,
Fred

No comments:

Post a Comment