Tyre Wear and Grip
So with the new ability to change tyres, and the new tyre model which models the surface type for tarmac/snow/ice etc., I needed to globally sort out the data behind the grip and wear and how they interact with the surfaces.
As each surface now has it's own tyre model, I need to make it so each tyre behaves differently on each surface. So with 6 surface tyre models and 9 selectable tyres, we have 54 combinations to test. I'd like to simplify this data to make it easier to manage otherwise it will all become a bit of a nightmare to manage.
For example I'll start with the tarmac based tyres, these come in 3 flavours, soft, medium and hard. the softer tyres will wear faster, but have a higher grip on the tarmac based surfaces. However when used on snow or ice, the grip and wear won't make much difference regardless of soft, medium or hard because the surface behaves totally different to tarmac. I like to keep data to a minimum when coding physics, less data and more maths means less room for error and less tweaking.
After doing my first pass on the grip and wear model, I noticed that when using a tarmac tyre in the gravel, it wore out faster than it did on tarmac, which made no sense, so I decided to graph it all out to visualise the data, and then instantly you can see that the final multipliers in my data were not right (see the large blue spike on the gravel column!)
Once I had graphed it, I decided to change the way the data is read into the game, so I could easily tweak the data in the spreadsheet, and bring it into the game. Once I had done this, the tyre model graph was much more pleasing to look at and it played much nicer! I also graphed the same settings with respect to tyre grip to check that tyres were interacting correctly with each surface based on their grip levels too.
This is what I ended up settling on, however this is likely to change once I start playing the game towards it's final stages.