Navigation Systems in Video Games

This series explores navigation systems in video games and how they work under the hood.

math for game developers

Navigation mainly refers to the set of systems and techniques that enable characters to move efficiently through virtual environments.

Imagine the following situation: your character is standing in the middle of a bustling medieval marketplace filled with merchant stalls and NPCs going about their daily routines. You click on the far edge of the square, and your character confidently begins moving toward the destination, skillfully navigating around obstacles.

How exactly does that happen?

game navigation path
Navigation system in a video game dictating path

Somehow, it successfully builds a complete path from the starting position to the target, while avoiding both static obstacles such as merchant stalls and dynamic ones, like traders and other shoppers making his way toward the destination while skillfully avoiding obstacles.

Errors in navigation can lead to all kinds of immersion-breaking behaviour: characters getting stuck in doorways, walking in circles, clipping through walls, or “fence dancing” near entrances. Another classic example is “bonking”, when a character repeatedly bumps into a wall while trying to move forward.

If you've played The Elder Scrolls V: Skyrim, you probably remember the horses walking on air or climbing sheer cliffs.

elder scrolls horse bug
Errors in navigation can cause unexpected bugs

Another example of bugs in navigation are the endless traffic jams in Cyberpunk 2077.

cyberpunk traffic jam
Cyberpunk endless traffic jam caused by bad navigation

These are all navigation system failures.

Besides pathfinding, navigation also encompasses several other important areas. One example is cover generation. These systems automatically detect and mark cover positions based on the level geometry: low walls, cars, corners, columns, and so on.

Detecting cover positions based on level geometry

Navigation also includes more advanced elements that allow characters to move between different parts of the world in non-standard ways. For example, a character may travel between floors using an elevator, jump across gaps, climb ladders and ledges, use ropes, moving platforms, or even vehicles. Such elements require the navigation system not only to find paths across surfaces, but also to understand special transitions and movement rules. In modern games, these connections are often represented as special navigation links or smart objects.

Crowd simulation is also an important part of navigation systems. In such systems, each individual character knows its direction and destination, but all agents must still move together through shared space in an efficient and believable way. They avoid collisions with one another, navigate around moving obstacles, adapt to changing situations, and maintain natural movement even in dense crowds. Without such systems, a crowd quickly turns into a chaotic mass of NPCs getting stuck inside each other, twitching nervously. Like in the public transport during rush hour.

Many different algorithms are used to implement and optimize such systems. Some are responsible for global pathfinding, others handle local collision avoidance, while additional systems manage spatial distribution and movement flow. Depending on the game's requirements, developers may use navigation meshes, flow fields, steering behaviors, velocity obstacles, flocking algorithms, and many other approaches. Choosing a particular solution is almost always a compromise between performance, realism, and behavioral complexity. The main thing is to save the illusion and do it quickly.

We'll break down how these systems actually work: from classic A* pathfinding and navigation meshes to crowd avoidance, smart links, and large-scale AI movement in modern games.