Presentation is loading. Please wait.

Presentation is loading. Please wait.

Intelligent Pac-Man Ghost AI

Similar presentations


Presentation on theme: "Intelligent Pac-Man Ghost AI"— Presentation transcript:

1 Intelligent Pac-Man Ghost AI
CPE 480 – Fall 2008 Bill Hess Brian Mark Richard McDaniel Wesley Hamilton Evin Thompson Bill

2 Objective To create a new AI for the ghosts in the game Pac-Man.
This AI must be more difficult than the original. It should implement several concepts from Artificial Intelligence. The ghosts should act cooperatively. Bill

3 Original AI We modified the source for the Pac-Man game found at Original ghosts moved only based on best-first search Ghosts would move to the cell with the closest absolute distance to Pac-Man. Ghosts not allowed to go back the way they came. Ghosts have a simple check to not follow each other down corridors. There is a 50% chance that ghosts will take the next-best direction at intersections. Brian

4 Evaluation Criteria Percent of rounds won (by the player).
Should be as small as possible Points won by the player. Time taken to complete a round to a win. Should be as large as possible. The AI should prevent the player from winning as long as possible Time taken to complete a round to a loss. Should be as small as possible. The AI should defeat the player as fast as possible. Richard

5 Testing Environment We modified the game environment to include a Testing Mode This allows testers to play alternating rounds against the original AI and the new AI with a reset round each time. Evaluation results are recorded and displayed in a window after all testing rounds are finished Richard

6 Smart AI – Uniform Cost Search
Our AI uses a uniform-cost search to find a path to Pac-Man. Cells are all given a weight of 1 at the beginning of the traversal. The closest ghost to Pac-Man (found by using a breadth-first search) is chosen and finds a path using the uniform-cost search. All cells the ghost walks over has its cost increased by 2. The next closest ghost is chosen and the uniform-cost search is run again. This search is performed each time a ghost crosses a cell Bill

7 Smart AI – Uniform Cost Search
Advantages: Ghosts can now change directions quickly if Pac-Man makes a sudden change in direction. Ghosts can follow each other for short periods of time and split up later. Ghosts begin to take different paths earlier in the pursuit. Ghosts can search to the next intersection that Pac-Man is headed towards in order to predict his movements. Bill

8 Smart AI – Other Behaviors
Objective Guarding Ghosts will stand over power pellets and food pellets when there are only a few left on the map. This forces the player to think ahead about leaving behind pellets or when to use a power pellet Evin

9 Smart AI – Other Behaviors
Fleeing Behavior All but the closest ghost will flee early if Pac-Man is near a Power Pellet. This prevents the player from sitting next to a pellet and eating all the ghosts once they get close. Once Pac-Man has eaten a Power Pellet, all ghosts will flee up to a certain distance based on how much time is left until the Power Pellet runs out. This means that ghosts will resume pursuing Pac-Man before the Power Pellet times out. Evin

10 Smart AI – Commander Class
Appoints tasks to all ghosts every time they cross a cell Tasks are represented by a destination location Tasks are appointed in order of priority Priority of tasks Leave room, enter room, flee Chase Pac-Man Defend food/Power Pellet Back off, block intersections Wes

11 Smart AI – Commander Class
Gives all ghosts a direction to move based on their task The ghosts are only given the first step of the path to their final destination. Ghosts must ask the Commander for the next direction each time they move to a cell. The Commander uses uniform-cost search and breadth-first search to pick the next direction for each ghost when the ghosts request one. BFS is used for leaving and entering the room. UCS is used for all other tasks.

12 Smart AI – Results Bill

13 Smart AI – Results

14 Future Improvements Blind testing environment Improve fleeing
Make it so the tester doesn’t know which AI is being played against. Randomly choose the AI to be played against. Improve fleeing In level 1, ghosts tend to bunch together. Make ghosts run away from each other as well as the player. Bill

15 Demo Brian


Download ppt "Intelligent Pac-Man Ghost AI"

Similar presentations


Ads by Google