AI


I started creating AI for my game about 7 months ago. Since then it's taken a back seat but now it's time to get a version working where at least the car goes round the track. I'm using a spline method but was having real CPU issues. Then I found that every single car in the game had a camera as it was the player's car with an AI script. So I stopped being a putz and changed the AI prefab and now it runs OK. It's complete crap but it more or less follows the ideal line set out for it. I had to make the car understeer more so it wouldn't keep spinning but I think in time it'll take shape.

I also started on the level editor. Before I drew objects on a new texture so green was trees, purple was grid boxes but this became very complicated with use of compute shaders and in the end a bit restrictive. I've decided to go the other way by creating an in game editor which allows you to place objects then saves them in JSON format. 

You create levels by drawing them in a 2d art package, that texture sits on a 3d plane ( I use Blender to create ), then in Unity I'll create the objects, trees, houses, people, checkpoints, pitlanes, gridboxes etc etc. 

Currently you can create trees by clicking or holding on the map or creating a polygon and filling using Perlin noise. Checkpoints you create by clicking twice, once for each side of the checkpoint.

Next on the menu is to get AI to be sensible then to create a race weekend with practice, grid placings, 3 lap race and results...

Leave a comment

Log in with itch.io to leave a comment.