Due 12/4 at 11:59pm
Where are the ghosts now?
Engage dynamic tracking,
Glorious revenge.
Pacman no longer knows where the ghosts lurk. But, he is now the hunter, with an endless supply of power pellet juice. Did we mention he has a laser? In Pacman's Revenge, your goal is to eat as many ghosts as possible in the time allowed, knowing only how far away each ghost is (from their endless banging and clanging) and what is directly in front of you (from your laser). This new first-person perspective will require your agent to track the ghosts in order to determine their approximate positions, just like in Battleship.
This final Pacman project will be structured as a contest. Participation in the contest is voluntary, but recommended for all students interested in pursuing artificial intelligence. Entering the contest will reflect positively on the participation component of your course grade.
The contest will have two tracks: one for agents in the fully observed, original pacman setting and one for new revenge agents. As a result, the code base has grown slightly from the previous Pacman project. The code for this project contains the following files, available as a zip archive.
| Pacman | |
pacman.py |
The main code for the game of Pacman. You should familiarize yourself with the general outline of this code, which you will be interacting with for the rest of Project 1. |
layout.py |
Board layouts. You can ignore this file. |
keyboardAgent.py |
Interactive controller. You can ignore this file. |
graphicsDisplay.py |
Plug-in for the gui interface. You can ignore this file. |
textDisplay.py |
Plug-in for the text interface. You can ignore this file. |
graphicsUtils.py |
Graphics utilities. You can especially ignore this file. |
| Search | |
search.py |
Generic search code, including our solution to checkpoint 1.1. You may use this, or your own search code. |
util.py |
Useful data structures and functions. |
distanceCalculator.py |
A convenient module for computing distances in a maze. (new) |
| Agents | |
pacmanAgent.py |
A home for your original Pacman agents. |
firstPersonPacmanAgent.py |
A home for your Pacman's Revenge agents. (new) |
inference.py |
A home for inference methods supporting your first-person agents. (new) |
The original Pacman contest allows you to extend and fine-tune your agents from project 1.3. The grand prize will be awarded to the agent that scores the most points using the following command:
python pacman.py --layout originalContest --pacman contest --ghosts directional --timer 1
The new layout will require a clever agent to navigate successfully, but offers plenty of ghost-eating opportunities. Notice the new command line option timer. You'll be limited to 1 second for every decision your agent makes. After two warnings, your game will be terminated prematurely if your agent thinks for too long.
Here's where the real action is. Your agent will be responsible for making decisions in an uncertain environment based on noisy observations of ghost positions. At each time step, your agent receives a reading of its Manhattan distance from each ghost. But, this reading may be off by one or two squares. The only sense your agent can truly trust is its laser, which detects ghosts directly in front of it.
You can play Pacman's Revenge with the following command:
python pacman.py --layout hunt --rampage --firstperson
The numbers at the bottom of your display are approximate distances to each ghost. They are used to generate the colored diamonds that overlay the board, which each mark a set of squares that are equidistant from Pacman. As one of the diamonds grows smaller, Pacman is likely approaching a ghost.
The grand prize of this contest will be awarded to the agent that eats the most ghosts within the time limit (currently 250 moves). We will evaluate your agents using the following command:
python pacman.py --layout bigHunt --rampage --firstperson --pacman contest --inference ContestInference --timer 1
Again, your agents actions will be timed; three violations of the 1 second time limit will lead to premature termination of the game. You are welcome to use any approach you want in this contest. We expect that some approximate inference algorithm will be the foundation of any successful entry.
Happy hunting!