3D Pac-Man

This was a solo project done as an AI research. It used the OpenGL Utility Toolkit (glut).
This project emulates the AI from the famous game Pac-man.
The first part of the project was to do research on how the pac-man AI works:
Each ghost behaves in a different way, and this is accomplished by choosing different targets towards which to move. The red ghost always targets the player, while the pink ghost targets in front of the player.
The orange ghost targets either the player or the bottom left corner of the screen depending on his distance from the player.
The cyan ghost calculates his target based on a combination of the red ghost and the pink ghost’s target.
In the original pac-man, an overflow error was causing the pink ghost to aim above the player and to the left when the player was looking upwards instead of just upwards (hence, affecting the cyan ghost’s target too). This was replicated here to try and keep the AI as faithful to the original as possible.

After that, the next part was to get the level, the ghosts and the pacman rendering on the screen, do collisions and a very basic AI (the ghosts just tried to follow pac-man, not taking any obstacles into account).
The second part of the project was done after finishing the AI class, now, it was just about implementing an A* pathfinding algorithm, which allowed the ghosts to chase pac-man in the most effective way, going around the obstacles and choosing the target based on the research mentioned above. Multi-threading for the AI was also implemented in order to speed it up.