Some kind of avatar (car, motorcycle, boat, tank, spaceship, bicycle, character or whatever) compete against other avatars in a series of different tracks or levels. The goal is reach the end before everyone else. Most common form of avatar is some form of vehicle.
Realistic Vs Arcade
Racing is often put on a scale from Arcade to Realistic. A realistic racing game is like a simulation where things should play out like in real life. In a arcade racing game you can plow straight into a wall at high speed and still keep going.
Pure Vs Powerup
In a pure game the focus on the racing only. Only the driving matter, drive best, get first. In a powerup style game the players can use powerup to boost his own progress or nerf others. It can be in the forms of mines, rockets or speed boosts. The powerups can be picked up on the track or bought before the race.
Race alone to get the best time on a track. Checkpoints that show how far ahead or behind the player currently is to the best time. In a online game there is three times to beat. Personal best, best time of friends and best time in the world. Some racing games have this as the only mode as it is not possible to directly compete with others.
In a arcade style game a respot feature can be used to put the player vehicle back on the track. This can be needed if the player flip his car upside down, get stuck or if it crash and explode. It can be a button the player use when he choose to or it can be done automatically when a failure state is detected, like falling of a cliff. It places the player on the track a bit back from where here where. It might be stationary or put the player back with some speed to get him going as fast as possible. If the player failed in a area where great speed is needed, like a jump, the player might need to start further back to have time to build the speed needed for the jump.
To avoid the player simply backing up over the start line and driving it over it for each checkpoints are used. The player must pass them in order and they then makes it possible to give time updates compared to the last lap. The checkpoints need to be placed at choke points so there is no risk that the player miss them. In a open world game with a less strict track the checkpoints can be made into visible markers in the game world so the player can see where to go next.
To avoid the player driving the wrong way one can track how far along the player is along the track. If the player is decreasing his progress one can show a wrong way sign that suggest to turn around. These checks can also be done at checkpoints if the player is not passing them in the correct order.
Alternate paths of the track that can be faster in the right circumstances. It can be as simple as a split in the road and if everyone goes right you might save some time going left where there is less traffic. There can be hidden shortcuts that you can learn after a day on the internet so they are not that secret for long. Risky shortcuts are not always better. It can be a train crossing and you might get hit by a train and loose time.
In a open world setting there can be many ways to get to the next waypoint so a GPS system can be used to guide the player. It can be shown on a minimap or in the game view as arrows or other markers on the road. The GPS always show the most direct path to the goal.
On a open world setting there can be traffic that is in the way of the player. They might follow the traffic rules even if the player do not.
Realistic physics is when the cars or whatever behave like they would in the real world. That is not the same as the physics used in the game is true to physics formulas. For performance and gameplay reasons they are often not.
This simulates a wheeled Vehicle by using a raycast for each wheel instead of creating a real physics objects that are spinning against the ground. This is done to get better performance.
Flying in the air and rolling 7 times is fun in a arcade game. Landing on the roof at the end is not. This system is trying to make sure the car lands with the wheels down or on the side and fall down the correct way. It needs to do that without being to obvious.
Rubber banding is a system that try to keep the AI agents around the player. It does so by increasing the speed of those behind the player and reducing it of the agents in front of the player.