How I like to progress my game's design through playtesting
Checkpoints and Counting Laps:
The track has 2 types of checkpoints:
-Respawn Checkpoints
-Key Checkpoints
Respawn checkpoints are simple checkpoints, once a ship passes through its hitbox, the ship will save the checkpoints position, once the ship gets the signal to respawn itself, it will go to the latest touched respawn checkpoint.
Key Checkpoints are made to verify a full lap has been driven. It 2 rules to achieve this:
-All key checkpoints must have been checked off when the ship passes the start/finish line (including the start/finish line itself).
-The key checkpoints must be checked off in the correct order, this makes backwards lap invalid.
Finding out the correct positions for the key checkpoints was a result of lots of playtesting to find out what positions disallowed corner cutting the most.
Key Checkpoints
Respawn Checkpoints
Other regions and borders in the track design:
CPU Slow Zones
Out Of Bounds Zones
Behind the CPU's of Project AG Racer:
I am still actively working on the CPU's but I've gotten the basic way how they function done.
Each CPU has 2 main parts:
-A NavMeshAgent (NMA) (Using Unity's AI Navigation)
-A ship
The NavMeshAgent's job is to follow an ideal path, it also picks the path at the start of every lap from a set list of racing lines. Each racing line contains a list of nodes. To see some code snippets about how the NMA chooses its path click here. The Agent also slows down to ensure it doesn't lose the ship behind, it will also speed up when the ship is close.
The ship uses the same physics as the player, and tries to follow the NMA to the best of its ability.
Some optimizations include slow zones, where the ship gets a speed limiter.
Another is that the Ship doesn't target the exact position of the NMA but rather a set units in front of where the NMA is facing. This way the ship turns earlier which is required for good turning with the physics and controls of the game.
I frequently test my CPU's and tweak the racing lines, other values like the slow zone speed limit or amount of units the ship looks in front to make the CPU's navigate the track better and better.
back to Project AG Racer