Imagine that we need to come up with an enemy that needs to select different actions over time as the player progresses through the game and their patterns change, or a game for training different types of pets that have free will, to some extent.
For these types of tasks, there exists a series of techniques aimed at modeling learning based on experience. One of these algorithms is Q-learning, which will be implemented in the following recipe.