CPSC 220 Assignment 7
Graphs
Due Before Class on Friday, December 4th

In this assignment you have a choice between two different applications of a graph for controlling non-player characters in a game. The first, path planning, uses a graph to route non-player characters around static objects. The second, artificial intellegence, uses a graph to determine the state and actions of non-player characters.

Path Planning Details

Create a graph class that represents locations that a non-player character could move to. Each vertex in the graph represents a location and each edge represents the path between two nodes. A non-player character that wants to move to another point must first find the vertex that is closest to it and then move between graph nodes along the shortest path until it reaches the vertex nearest its destination.

AI Details

Create a graph class that represents the state of a non-player character. Each vertex in the graph represents a different behavior (eg. wander, follow, or flee) and each edge represents the condition for state transfer (eg. player character within distance or random probability). For every frame of the game the non-player character is updated according it's current state and transitions out of the state are tested.

Your game should also include something new that improves the game in addition to the above requirements. Be prepared to demo your game in class on Friday including a description of the graph.

Hand In: Tar and email your code and an executable jar file to your instructor with a subject of cpsc220 assign 7 before class on Friday, December 4th.