It's been another hectic month but one of the things I have been focussing on is the reason why non-playing character (NPC) cars stop.
There are a number of reasons why an NPC might not finish the race although the commonest reason is that there is a collision between the player and the NPC or between two NPCs. At the moment the code can detect if a car has spun and attempt to recover it back onto the race track. I've now started looking at what happens if the NPC car has crashed out or, for some other reason, cannot continue. The code will now retire an NPC car if required and record the reason for the retirement. This reason can then also be displayed to the player at the end of the race. The situations under which a car should be retired are reasonably easy to define (such as a crash, out of fuel etc) but the code will also handle situation where a car has spun and, for some reason, cannot recover back to the track. One thing I now need to decide is how to represent this in the game. For example, should the cars that have retired remain at the side of the track for the rest of the race? Also, at what point should the race be red-flagged due to the number of cars remaining? It won't be a lot of fun if there's a big crash and only a couple of cars can carry on. In this case I may look at the rules for some forms of motorsport to see what the "cut-off" is.
One other thing I've been working on is finishing off a few loose ends. These have become more obvious recently due to the lack of time I've been able to put into the project. As I've been playtesting I've noticed things that were not working correctly. On investigation I've discovered that I've not completed various tasks and that's why feature 'x' wasn't working! So I've finished off some of the UI and the code to supply data to that in addition to fixing some bugs and tidying up other bits and pieces.
I hope to finish off the code handling retirements of NPC cars.