Back in 2004 I was taking a Masters course in Virtual Environments. For the final project we were asked to develop a driving simulator, where the user could drive a car (or other such vehicle) down a street. The environment was supposed to simulate all the various controls one would have in the car: steering, braking, shifting transmission etc. I thought it might be more fun to take a similar, already working environment but completely re-engineer it. So I convinced my professor to allow to to start with the Torcs racing simulator (http://www.torcs.org) and work from there. Here's what progressed...
I started with the track generator. The track generator was designed to quickly generate tracks based on a set of ground rules, and a file that described the general shape and layout of the track. From this it would construct a model which would later be rendered during the simulation. Race tracks have no concept of intersections, speed limits, stop signs, elevations etc so all of these concepts had to be added.
Once that was in place I pulled apart the racing AI and reprogrammed it to simulate a typical driver: one who obeys traffic laws, stay in their lane, stops at intersections and stop signs, keeps a safe distance from other cars etc.
Lastly I updated the physical characteristics of the car 'BOTs': both internally and externally. I modified the braking code to give them ABS style features, rewrote the engine and transmission dynamics to mimic everyday vehicles based on real-world vehicle specifications, and used 3D models of such vehicles in place of the included race-car models.
All in all it came out very nicely. You were able to drive around the track and observe traffic patterns by the other cars and explore the city at your leisure. The project is long since completed but I did manage to find some screen captures I had made as I was developing the project.
The following is a screen grab from the original simulator:
Here's some screen grabs during my development work.
NOTE: I had turned of the ranking display, and instrument cluster during development so you won't see them here. I also reduced some of the texturing and lighting features to make the simulation run faster)
Top-view of track:
Close up of intersection:
BOT making a turn at an intersection using new AI:
Found an archive of the source I used for this project. You can find it here.