Tuesday, 11 January 2011

Introduction to Transportation

Happy New Year!

Today is a short post as I'm still mulling this issue over a little bit.  I've started writing an early prototype of the economy code, and am quite happy with it.  I've paused just before the virtual companies in the simulation have to calculate their costs.  The reason is that the cost of transporting goods from place-to-place needs to be included, and that means we need a transport network!

This post won't go into huge details, but there are some early points that I'm pretty set on:


  • Transport conduits (be they roads, train tracks, etc.) will be layable as splines, straight lines, etc. and vehicle speed will respond to the curvature.
  • Conduits and intersections will have configurable properties relating to lanes, traffic lights, etc.
  • Traffic will be based on real journeys by real people or cargo - that is, vehicles will be travelling between locations based on a need to travel there rather than some random event for prettiness.
Some of these points pose some odd problems - how for example, do I calculate the curvature of a spline?

More importantly, how to I simulate traffic?  Road transport will be relatively simple, albeit not without its challenges because cars travel sequentially.  I'm looking in particular at some microsimulation techniques such as those described at http://www.myhomezone.co.uk/project/Report.htm to help with this.  

More complicated is allowing train networks to be built, because railways have awkward and different rules to obey.  Consequently, although all transport networks can fundamentally be represented in similar ways, their simulation will need to be handled differently.  I need to find a good way of doing these things in a way that meets the goals of this little project.

So over the next few posts, we'll deal with the issue of transportation.  Good news is that this means pictures! The bad news is that I'll have to draw them! :)

If anyone has any good resources or ideas, I'm all ears!

Fred

1 comment:

  1. Very interesting project... Have you ever played Tropico 3? It's currently one of the more realistic city building games. About the transport - Where will people's cars be? Parked at the nearest available parking space? And any other updates would be great. More people should know about this project, but hey - I guess developers only become well-known AFTER releasing a game, right? =)

    ReplyDelete