Intelligent game-playing characters have been used in the game industry to harness the power of graph algorithms to navigate complex virtual environments, strategically analyzing interconnected nodes and edges to optimize their movements and decision making processes. By leveraging graph traversal techniques such as breadth-first search (BFS) and depth-first search (DFS), these characters can efficiently explore vast game worlds, identify optimal paths, and anticipate opponent movements.
In this coursework, you will use graph algorithms you have learned in
Lecture 10
to develop an effective approach to track and intercept a moving opponent in a (simplified version of the) 2D Game called Rogue
. You will also create a viable plan to evade interception from said opponent.
Rogue
The game Rogue was created by Michael Toy and Glen Wichman, who, while
experimenting with Ken Arnold's C library named curses in the late 1970s, designed a graphical adventure game shown below.
In 1984, CMU graduate students developed Rog-o-matic, an automated Rogue player, which became the highest-rated player. Rog-o-matic's algorithm prioritized avoiding monster encounters to facilitate health regeneration, posing an intriguing graph search challenge, which inspired this coursework.
Rules of the Game
The game of Rogue is played on an N-by-N grid that represents the dungeon. The two players are a rogue and a monster. The rogue
is represented with the character @.
The
monster
is represented by an uppercase letter A through Z.
The monster and rogue take turns making moves, with the monster going
first
. If the monster intercepts the rogue (i.e., occupies the same site), then the monster kills the rogue, and the game ends. In each turn, a player either remains stationary or moves to an adjacent site.
There are three types of sites:
1. Rooms represented by .
2. Corridors represented by +
3. Walls represented by (a space)
The movement rules are:
If a player is in a room site, then they can move to an adjacent room site in one of the 8 compass directions (N, E, S, W, NW, NE, SW, SE) or a corridor site in one of the 4 directions (N, E, S, W).
If a player is in a corridor site, then they can move to an adjacent room or
corridor site in one of the 4 directions (N, E, S, W).
The walls are impenetrable.
Consider the following two dungeons.
In the first dungeon above, the rogue can avoid the monster
I
indefinitely by moving N and running around the corridor.
In the second dungeon, the monster
A
can use the diagonal moves to trap the rogue in a corner.