Oversteer Racing: Dev blog #39 – The one where we stop the race from starting

This month has been pretty busy, as I suspect will be the case for a while now, and so I've not spent as much time on Oversteer Racing as I'd have liked. One of the tasks I've started looking at is the start of the race.

Currently the race starts as soon as the level/track loads which is obviously not what will happen in the actual game. I've yet to decide how the race should start. It could have a "fly-by" recap of the grid positions or maybe some sort of overlay on screen. I think it would also be useful to recap the race length, pit stop prediction etc. Once that's complete there will be a start light sequence and the race will begin. This month I added code to prevent the race starting immediately. This enables me to trigger when the race should start.

One other component of the race setup is the starting positions of the cars. I've now configured a ten place grid on the test track (so the code now matches the texture) and can control the position of cars on the grid. I still need to add code to support random grid positions and also some sort of qualifying session. I think the most likely format for this will be a one lap shoot-out where the player can do an "out lap" from the pits and then a single flying lap.

So much still to do...

Next month...

I want to carry on working on the start sequence and also improve some of the AI car behaviour when they stray off line.

Oversteer Racing: Dev blog #38 – The one where we stop the pushing

One of the key things I've been focussing on this month is the behaviour of the NPC cars when racing closely with other cars. To be honest they can get a bit fiesty under some circumstances but are a bit too passive in others. Getting the right balance so that going wheel to wheel is fun is tricky. I don't want it to appear that the NPC cars can be easily passed but, similarly, I don't want them to put you into the wall either. I think it's fair for them not to yield places easily and, if they have the better position for a corner, then the player will have to back out of a move or risk a collision. At times this can appear a little unfair to the player. You might go for an optimistic move but find the NPC will give up no ground and will take their usual line into the corner and the player has to avoid them. The NPCs do have a notion of "aggression" and I'd like some "drivers" to be found to be much harder racers that others. I'd like a situation whereby a player can approach an NPC and think "OK, I can dive up the inside here and they won't turn in" or "I need to work hard to pass this car because I know they will shut the door on me if they can so I'll have to get alongside before they'll give up the place".

This month I've done some work to improve how the cars race and that largely involved a lot of play testing and tweaking of settings to find a sweet spot. Some issues have been more obvious than others, for example, a car running into the back of another due to a tow and then pushing it along. Other situations require a bit more finesse and lots of fine-tuning such as how NPC cars detect cars that are close to them and how they react. I think the racing is better now than when I started this block of work but it'll still require some tweaks I expect.

Some of the other things I've worked on include the correct display of the lap counter for the player car. For some reason, I'd managed to overlook this and it wasn't updating properly and could also display the car as having completed more laps than were in the race. This is now fixed although I'm still using a very rudimentary user interface. I also worked on setting the correct starting position for cars on the grid. Cars can now be allocated a position and they will start from the correct grid slot.

Next month...

I want to start working on the start of the race. Specifically how the start is triggered.

Oversteer Racing: Dev blog #37 – The one where we work out why we stopped

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.

Next month...

I hope to finish off the code handling retirements of NPC cars.

Oversteer Racing: Dev blog #36 – The one where we go too long

I've been away for a lot of this month and, being the only person working on Oversteer Racing, that's meant that work has been slow.

Having said that I have done a bit of play testing and I discovered that NPC cars were taking on too much fuel at pit stops. This made the cars heavy once they had pitted and they were then slow. For a while I thought that there was an issue with the code that determined what the correct fuel load would be for the car to get to the end of the race.

After some debugging and testing I found that the code to determine the fuel loads was correct. The issue was actually far more simple. There was a bug that meant that NPC cars were not receiving the correct information for the race length at the start of the race. At the pit stop the cars were then fuelling up for the number of laps they were expecting but this wasn't the number of laps remaining in the race. It was a simple fix but a bug that took a little time to track down.

Next month...

I hope to do some work on handling retirements for NPC cars.

Oversteer Racing: Dev blog #35 – The one where cars block the pit lane

It's been another busy month but I did manage to spend some time fixing a few bugs in Oversteer Racing.

One of the things I discovered was that the game settings were not being used in the race. So, if I set the damage setting on then the car damage wasn't affected in race. This was also the case with the other settings that players could change before the race. This was relatively easy to fix once I'd noticed it.

Another issue I discovered was that NPC cars would some times crash in the pit lane. These crashes would then block the pit lane and prevent other cars from pitting. These crashes were caused by the pit lane limiter not being set correctly for NPC cars. As a result these cars were entering the pits too fast, missing the turn in point for their pit box and blocking the pit lane.

Next month...

I hope to do some more play testing and bug fixing.

Oversteer Racing: Dev blog #34 – The one where we tie up a few loose ends

It's been a fairly busy month but I have managed to work on Oversteer Racing, so that's a significant step forward from previous months ;-)

As it's been a while since I could put a reasonable amount of time in on the game I've been getting back up to speed by fixing a few minor bugs and tying up some loose ends. Most of this work has still been focused on the end of the race and making sure the data is correct. I've made sure that the race summary uses the correct driver and team names (as set by the player) and also made sure that the code correctly determines the time gaps between the cars.

I've also fixed a few minor bugs where data was being misrecorded (incorrect pit stop numbers, DNFs etc) and also fixed a bug that meant that smoke wasn't being shown when an engine failure occurred. I've also been working my way through all the settings scenes and making sure those settings are reflected in the game (i.e. if you switch on advanced handling then that is toggled on in the game).

Next month...

I hope to finish off all the work on the code to handle the end of the race and correctly record the results and update player stats etc.

Oversteer Racing: Dev blog #33 – The one where we get the move done and fix things

As mentioned last month I had to spend some time moving my website over to a new host this month. As I was moving the site I took the opportunity to try and simplify things a bit. The old site used WordPress and that's great but it requires some effort to maintain (software updates, database backups etc). As I needed to move the website anyway I chose to stop using WordPress and use Jekyll (a static site builder instead). This should pay back in terms of time but offer similar functionality.

I have managed to do some work on Oversteer Racing over the last few weeks too. I'm still working on the code to handle the end of the race. I've made good progress and the code is handling most of the scenarios I'd previously outlined for the end of the race. It still needs a lot more polish but it's been good to make some progress again.

Next month...

Further work on the end-game code and I also want to make sure that, if users change the names of drivers and teams, these are reflected in the end-game scenes.

Oversteer Racing: Dev blog #32 – The one where we plan a move

It's been a difficult month and I'm really struggling to think of any tasks I've completed on Oversteer Racing. I've been away which dramatically reduced the amount of time I could spend on the game and I've also had some other tasks that have demanded my attention.

One of the issues is that the web host I use for this site (and a number of others I run) has been bought out by GoDaddy. For a variety of reasons I'm not keen to be a customer of GoDaddy (feel free to check out their page on Wikipedia as that covers a number of the issues). As a result I've had to start looking for a new host. That process has also resulted in me reviewing a number of the things that demand my attention to see if I can reduce my time commitment by changing how I do things. The idea is that by reducing some of the complexity of the sites I support I could get a 'pay back' in terms of time. Quite a few of the websites I run rely on a database (or many) and some other software such as WordPress (for example). This has a knock on in terms of finding good web hosts and supporting the sites as I need to make sure the sites are up-to-date (in terms of software updates) and also to take automated backups etc.

In an attempt to reduce the amount of time I spend looking after websites I've decided to convert some of my sites to using Jekyll (which is a static site builder). I've decided to use this site as a test site as it's small. The idea being that I can build the site in a Vagrant VM and check in the site files to Git and then just deploy them to a simple, static site (something that's offered by many hosts).

So, sorry for the lack of progress or a conventional dev blog but it's one of those times where other tasks take priority.

Next month...

Hopefully I'll have moved this site, will be well on the way to moving the others and will then have more time to work on Oversteer Racing.

Oversteer Racing: Dev blog #31 – The one where it's never ending

Unfortunately it's been a really busy month for a variety of reasons. I've found it very difficult to find regular blocks of time to work on Oversteer Racing and so progress has been very slow.

When I have been able to work on the game I've been looking at the end of the race and producing the race summary. I have code to track the race finishers and retirements. The main issue is dealing with cars that are yet to finish the race and, even more tricky, predicting the race result if the player retires before the end.

I did also find time to fix a slightly annoying issue that's been present for some time. When the player car turns, the front wheels of the car rotate to reflect the turning of the steering wheel, this was not the case for the rival cars. If you look closely in any of the game play videos to date you can see that the rival cars steer straight ahead even when turning. I have now fixed this so that the wheels on the rival car rotate correctly too.

Next month...

I'll continue working on the code to handle the end of a race.

Oversteer Racing: Dev blog #30 – The one where we look at the end of the race

February has been another busy month because I've needed to work on my fantasy F1 competition and haven't been able to spend much time on Oversteer Racing. In the time I have managed to find I've been working on the end of the race. On the face of it this might seem a pretty simple task, show the positions of the cars and add up championship points, but it's actually a lot more tricky than it might first seem.

The main complication around the end of the race is determining the positions of the cars. There are two scenarios to consider:

  1. The player completes the race normally - In this situation the finishing position of the player is known, as is the position of all the cars that finished before the player did. However, although we allow the race to run for a few seconds after the player crosses the line we cannot be sure all the cars have finished (unless the player is last). As not all cars will have finished then we need to look at the cars that are still running whilst also accounting for others that might've retired and determine the complete finishing order. In the simplest case we could just assume that the remaining cars finish in the same order as they are currently running but should the result always be predictable in that case?
  2. The player retires or crashes - In this situation determining the final race order is much more tricky. It may be that some cars have crashed out but there will always be some cars that are still running. If none of the cars have pitted or all of the running cars have completed their final pit stops then determining the order is relatively easy (it's a similar task as the first scenario). That said, if the race is still in its early stages then we should include some degree of unpredictability as the finishing order is unlikely to remain the same as the current running order. If the race is part way through and some cars have pitted but others have not then the current running order when the player retired is not representative of what the running order should be once all the strategies have played out. This is a more complicated scenario to model as we must also take into account cars on different strategies. In order to do this we need to work out what cars are out of position, determine if that is due to a scheduled stop or due to a stop for a replacement wing etc and then work out the expected running order once all of the cars have pitted. We then need to predict the final result and this may also have an unpredictable element to it (i.e. just because a car will be leading after the pit stops doesn't mean it will always win the race).

So, in summary, not only is there the practical task of storing race data there is also a task to model/predict the result of the race in some cases. At the moment I'm just focusing on the simplest case since even that includes some element of result modelling and, once that's done, I'll look at the more complicated situation.

Next month...

I'll continue working on the code to handle the end of a race.