Steering for movement
Steering behaviors are widely used in games to manage the dynamic and smooth movement of characters, such as NPCs or vehicles. Typical steering behaviors include tasks such as seeking, fleeing, arriving, and wandering, where an AI character adapts its movement based on environmental factors or specific objectives.
To better understand how steering controls an NPC’s movement and maneuvering, we use Figure 9.5 to illustrate an example of an NPC avoiding overlapping with the player character:

Figure 9.5 – An NPC steering move example
Let’s understand what’s going on in Figure 9.5, as follows:
- a: Both the player and the NPC are moving at speeds Vp and Vn, respectively, and their paths intersect, leading to a potential collision.
- b: When the player and NPC come close enough to block each other’s movement, a push-away velocity (Vpush) is applied to the NPC to resolve the obstruction.
- c: The...