July 2024

Hide and Seek NPC Pathfinding

A* Pathfinding with occupancy map for AI behavior.
Custom engine provided by professor.

A combination of two course projects resulting in a Hide-And-Seek demo

tools & resources used

  • Rabin Engine (custom engine by professor).
  • C++.

A* Pathfinding

Implementing A* algorithm with a grid-based layout allows the player and NPC to find the shortest path from one point A to point B

A* code snippit

Occupancy Map

When the NPC doesn't know where the player is, the last known player position starts propegation (red) to guide where to search

Code snippet of propegation

NPC vision is restricted to a certain degree by dot product and unable to look through walls with checking line segments