Managing race difficulty using a rubber-band system
We usually want to create experiences that adapt to the player, and racing games are a good field for this, given that there is the capacity for the cheater agent.
In this case, we will explore the middle ground for this by using a framework that allows you to come up with your own heuristic for managing the speed of the vehicle given its status. It doesn't matter whether it is an arcade racing game or a simulation; the framework aims to work in a similar fashion for both cases.
Getting ready
It is important to have grasped the basic skills from Chapter 1, Behaviors – Intelligent Movement, to be able to develop a strategy to extend the framework for your own needs, that is, understanding the principles of how the agent class works, and how the behaviors help the player move toward an object. In a nutshell, we are talking about vector operations.
How to do it...
We will implement three different classes for handling low-level and high-level...