42A Rubber-Banding Systemfor Gameplay andRace Management
Nic Melder

42.1 Introduction
42.2 Rubber-Banding
Implementation
42.3 Power-Based andDifficulty-BasedRubber-Banding
42.4 Power-BasedRubber-Banding Issues
42.5 Disabling Rubber-Banding
42.6 Rubber-Banding inSplit-Screen Multiplayer
Modes

42.7 Improved
Rubber-Banding toReduce Bunching
42.8 Choosing the Parameters42.9 Special Case—First Place
Rubber-Banding
42.10 Rubber-Banding andLong Races—Race PaceSystem
42.11 Conclusion

42.1 Introduction
Rubber-banding is a technique used in racing games to keep the AI drivers near to the­players in order to maintain the excitement in races. In simple terms, when an AI-controlledvehicle gets too far in front of the player, it will slow down to allow the player to catch up
and, similarly, AI-controlled vehicles behind the player will gain a boost to their speed tohelp them catch up to the player. In this way, the AI-controlled vehicles will appear to beattached to the player via a rubber band, never getting too far from the player, hence theterm rubber-banding.
507

1.4
Rubber-Banding Multiplier

1.3
1.2
1.1
1
0.90.8
Region a–200–150

Region c0.7

Region b–100–50

0.60

Region d50100

Region e150

200

Distance from Player
Figure 42.1
Rubber-banding effect versus distance from the player.

When done correctly, this effect can be unnoticeable to the player while keeping theracing feeling close and exciting. However, when done poorly, it can leave the player feeling cheated, especially if the AI, racing in the same car as they, obviously has more speed.
This article describes methods to facilitate rubber-banding, discusses some of the special
cases that will be encountered, and explains how it can be extended into a fully comprehensive race pace system suitable for longer races.

42.2 Rubber-Banding Implementation
To implement rubber-banding, we want to reduce the speed of the vehicles in front of theplayer and speed up the vehicles behind the player; the further away from the player, themore we will want to speed up or slow down the vehicles. Figure 42.1 shows a typical graphof what we want to achieve.
Within region c, rubber-banding is disabled. In practice this means any vehicles aroundthe player will behave normally so the player will not see any obvious differences between
his vehicle and the AI’s vehicle when in close competition. Region d shows a linear negative effect on the cars, causing them to slow down as they get further in front of the player
until region e, where the level of negative effect is then maintained. This is referred to as
forward banding. Similarly, region b shows a linear positive effect on the cars, causing
them to speed up until region a is reached. This is referred to as reverse banding. It should
be noted that a linear relationship is not the only option; the use of a sigmoid or otherfunction would also work.

42.3 Power-Based and Difficulty-Based Rubber-Banding
There are two main methods that can be used for speeding up or slowing down the AIvehicles. Method one modifies the power that the cars have. Cars in front of the player will
508

Part VI. Racing

1.4
Rubber-Banding Multiplier

1.3

–300

1.2
1.1
1
0.9
0.8
0.7
–200–100

0.6

0100

200300Distance from Player
Difficulty multiplierPower multiplier

Figure 42.2
Power and difficulty multipliers versus distance from the player. Note how the power
multiplier only starts changing once the difficulty multiplier has reached its minimum or­maximum value.

have reduced amounts of power, reducing acceleration, and top speed. Similarly, vehicles
behind the player will gain power, and so will have better acceleration and will possibly
also have a higher top speed.
Method two modifies the driver’s skill level. In order to make cars in front of the playerslow down, their driver skill is lowered. Depending upon how difficulty is implemented,
this can cause the AI to brake earlier than normal, to slow down more for corners, and toaccelerate out of corners less vigorously. The overall effect of this lower driver skill is that
the AI car will be slower; conversely, increased driver skill will assist in catching up.
In practice, the best approach is to use a combination of the two methods, as they eachhave distinct advantages and disadvantages. As a rule, it is better to modify the driver skill
to slow down or speed up the vehicles, as the drivers are still in the same cars and so no“cheating” is happening. However, the only way to increase the speed of the cars, when thedriver skill is already at maximum, is to add extra power to the cars. A similar situation
occurs at the lower end where the driver skill is already at a minimum; further slowdown
can only be achieved by reducing their power. Figure 42.2 shows how the two methods
should be combined to achieve the maximum effect.

42.4 Power-Based Rubber-Banding IssuesDepending on the depth of the underlying physics simulation, power-based application
can lead to a number of issues. The severity of these problems is largely a factor of how
large the power changes are and include:
1. The AI is unable to control the cars due to the additional power overwhelming
the available tire grip, in particular spinning the car when exiting a corner.
42. A Rubber-Banding System for Gameplay and Race Management509

This can be countered by setting up the cars to drive with the extra power
enabled at all times. Alternatively, extra grip can be added to make it harder tobreak traction.
2. Underpowered cars are unable to accelerate up hills or change gears.
3. Audio issues if the audio is directly controlled by the car’s physics. With extra
power, the car will accelerate quicker, which can sound abnormal. Similarly, there
is a much greater likelihood that the car will be able to hit the limiter when in thetop gear, causing audio to play the limiter effect constantly.

42.5 Disabling Rubber-Banding
There are a number of situations when you do not want power modifiers to be applied toa vehicle. If any of these are present, then all rubber-banding effects should be disabled.
These include the following situations:
1. Race start. One of the biggest problem areas with racing AI is racing into the firstcorner, where multiple vehicles need to slow down and navigate the corner simultaneously. Ideally, you want cars to be spread out and be in single file by the timethey reach the first corner to avoid pileups, crashes, and blockages. Obviously,
forward rubber-banding will cause them to bunch together more, which is theantithesis of what we want to happen. In fact, giving the vehicles in front of theplayer extra power to help spread them out is actually desirable (i.e., applying
reverse banding to the cars in front).
2. Low speed. If a vehicle is far in front of the player and its power has been reduced,
it will be unable to accelerate effectively. From a standing start (e.g., after a crash)
the car may not actually have enough power to get the car to start moving.
3. Being lapped. On a circuit, it is possible that an AI may lap the player. In this case
the AI will be so far in front of the player (in terms of track distance) that it will
be racing with maximum negative rubber-banding being applied (i.e., on lowest
driver skill and lowest power). This has the effect that the car will be driving very
slowly around the track in a very uncompetitive manner. In this case, it is better
to disable rubber-banding on that vehicle so that it is not obvious to the player thatrubber-banding is occurring.

42.6 Rubber-Banding in Split-Screen Multiplayer Modes
If there is more than one human vehicle on the track, it is unclear which one should beused as the reference for rubber-banding. A good solution is to treat the rearmost player
car as the reference for reverse banding, and the foremost player car as reference for theforward banding, with any AI between the player cars having no rubber-banding applied.

42.7 Improved Rubber-Banding to Reduce Bunching
A side effect of forward banding, especially when using large changes in driver skill/powerover short distances, is that the AI vehicles can become bunched together. If the player510

Part VI. Racing

quickly catches up with them, they will still be in a bunch even though they will haveminimal rubber-banding affecting them. This is undesirable as it can enable the player toovertake many vehicles at once. As a player, part of the fun with racing games is battling
against the AI to gain position; being able to overtake many opponents at once is detrimental to the player’s experience. Two antibunching methods are:
1. Use the front vehicle distance as the max distance. As previously described, anyvehicle past the maximum distance will have the maximum rubber-banding effectapplied. Instead, by using the greater of the maximum defined distance or the distance of the furthest vehicle from the player, the effect of the rubber-banding canbe implemented over a greater distance. This does not eliminate the bunching, butslows it down because of the greater distance that the effect is scaled over.
2. Average positions. By taking the average position of all the vehicles in front of
the player, past a threshold distance, and then affecting all those vehicles thesame amount (based upon their average position), the entire pack will reduce
their speeds simultaneously. Because multiple vehicles are being affected in thesame way simultaneously, they maintain the same spacing while being affectedby the rubber-banding.

42.8 Choosing the Parameters
It is important that sensible parameters are chosen when setting up the rubber-banding
system, as this can have a large effect on both the difficulty of the game and the perceptionthat the player will have towards the AI. In general, you want to make sure that there is norubber-banding being applied when close to the player, otherwise power advantages canbecome visible. It is therefore essential to choose the width of the dead zone in region cso that the AI has no undue, visible advantage, but also so that the AI can still catch up towithin the player’s rear view.
The rubber-banding system can also be used as part of the difficulty balancing. By
having a negative minimum distance for the forward banding, this will allow the player
to more easily overtake the AI as, when side by side, the AI will always have less power
than the player. Similarly, by adjusting the maximum distance that the rubber-banding
operates over, the AI will become more spread out, reducing the number of overtaking
opportunities compared with a smaller maximum distance.

42.9 Special Case—First Place Rubber-Banding
The fastest times will always be generated when there is only one vehicle on track, as it
is possible to drive the perfect racing line without needing to overtake other vehicles.
Essentially, this is the situation that the vehicle in first place is in and so a large gap will
normally form between the first vehicle and the rest of the pack. This can be reduced byhaving additional rubber-banding that only applies to the vehicle in first place. This works
in the same way as previously described, but the distance used is between the first andsecond place instead of the AI and the player.

42. A Rubber-Banding System for Gameplay and Race Management511

42.10 Rubber-Banding and Long Races—Race Pace System
The purpose of the rubber-banding system is to slow down or speed up the AI vehicles
around the player. Essentially, it makes an AI faster or slower, based upon some predetermined criteria. By adding to these criteria, we can expand the rubber-banding implementation into a system that can adjust the race pace over long races. Across a 50-lap race,a racer will typically race hard for the first 10 laps, then relax (slow down) for the next
30 laps before racing hard for the last 10 laps. If pit stops are involved, then it may be desirable for the AI to race hard on the lap before the pit stop and the lap after, before goingback to its relaxed state of driving. These additional rules can be added into the systemalready described in order to create a much richer AI management tool that can be used
to control the pace across the length of an entire race. More ideas on implementing a race
pace system can be found in other sources [Jimenez 09].

42.11 Conclusion
This article described a rubber-banding system that works by varying both the driver skill
and the vehicle power to keep the AI competitors around the player. Only manipulating
the driver skill will allow the AI to stay around the player without appearing to cheat.
However, in the situations where the AI just can’t go fast or slow enough, power-based
rubber-banding can be used. The problems of this approach (in particular, uncontrollability and apparent cheating) have been described, as well as how to avoid them.
Improvements to the basic rubber-banding system are also shown (avoiding bunching, thefirst place lead, working with multiple players) as well as how this system can be further
extended into a fully functional race pace system.

References[Jimenez 09] E. Jimenez. “The Pure Advantage: Advanced Racing Game AI.” http://www.
gamasutra.com/view/feature/3920/the_pure_advantage_advanced_.php, 2009.

512

Part VI. Racing