Game AI, Summer 2013:
Project 1. Ms. Pacman Ghosts
Due: 5/22/13 at 11:55pm
Knowing the best place for an agent to move at any given time is a key element to almost any game AI. First person shooters, sports games, real-time strategy games, turn-based strategy games, etc. all share this common problem of needing to evaluate the current situation and decide where in space to move next and what action to take. This individual assignment focuses on movement in a semi-continuous 2D environment: Ms. Pac-Man.
This project will be using the IEEE Ms. Pac-Man vs. Ghost Team infrastructure for implementation. The description and distribution of the software can be found here: http://www.pacman-vs-ghosts.net/
This is an individual student project. You are to implement the 4 ghosts in a way that replicates the behavior of the original game. See http://gameinternals.com/post/2072558330/understanding-pac-man-ghost-behavior for a description of the original ghost behavior AI. (Note that when you read about the ghosts you will see that there was an error in the code resulting in ghosts that occasionally path planned to the wrong location. You may choose to replicate the bug as a feature, or correct the bug in your own implementation. In your write up, please indicate whether you are implementing the bug/feature or not.)
All ghosts are controlled by a single controller object that inherits from Controller. Modify pacman.entries.ghosts.MyGhosts so that it implements the behviors of the original ghosts. Create a single argument constructor for MyGhosts that takes a boolean that, when true, draws a line of the appropriate color (Red, Pink, Blue, or Orange) from the ghost to the cell on the game board that it wishes to travel to. This is for grading purposes; you will receive an "F" if you cannot draw the appropriately colored lines when the boolean is true.
One of the skills involved in this class is learning how to deal with integration issues with pre-existing engines. You are responsible for obtaining the code and using the resources provided with the competition. Please use Piazza for all online conversations and questions for the class community.
You will be given a little over 1 week for this assignment with suggested milestones:
- M1: BY THURSDAY. Download and run game. Experiment with different example ghosts and understand how they work.
- M2: BY TUESDAY. Finish the ghosts.
Get up and running
- Unzip PacMan_v6.2.zip in a good spot. (original, with javadoc)
- Follow the quick starter guide under the "Run Software" tab. The "Import Files" step may be a little different for you, depending upon your version of Eclipse.
- Run the game engine (pacman.Executor)
- Modify pacman.entries.ghosts.MyGhosts
- Modify main() in pacman.Executor to use your implementation; you may also want to turn on human control of PacMan: exec.runGameTimed(new HumanController(new KeyBoardInput()),new pacman.entries.pacman.MyGhosts( true ),visual)
Hints
- Look at the examples in pacman.controllers.examples
- Look at the tutorials
- Look at http://www.pacman-vs-ghosts.net/software for the game engine API.
- All ghosts are implemented by the same object (MyGhosts); in particular, the only method that needs implementation is getMove.
- Use pacman.game.GameView.addLines(Game game,Color color,int fromNnodeIndex,int toNodeIndex) to visualize where each ghost is going. For example: addLines(game, Color.RED, game.getGhostCurrentNodeIndex(ghostType), myComputedGhostDestination);
- Path planning is precomputed with getShortestPath(), getNextMoveTowardsTarget(), and getApproximateNextMoveTowardsTarget().
- You may find it convenient to map between the node indexing scheme built into the engine and an X,Y coordinate system. There are functions to convert from node indices to X,Y coordinates. But there is no convenient way to convert back to node indicies. You may want to implement your own technique for doing so.
Writeup
Include a .txt or .pdf file that describes the following:
- Exact instructions for how to run your agent (if these are not included, you may receive an F).
- Any assumptions you made when interpreting the descriptions of ghost behaviors.
- The major challenges you met during the project and how you overcame them.
- Answer the following questions:
- Explanation why the design of the ghost AI was effective, or why it was not. In your answer, give consideration to the tradeoff between fun vs. challenge and the constraints of computer processing power at the time.
- Given the processing power of modern computers, would you re-design the ghosts? Why or why not?
Submission
Submit via T-Square everything needed to run your agent, including the native pacman code, and your writeup.
Grading
This project is worth 20% of your final grade.
- One-argument constructor for turning on/off lines depicting ghost paths: 0 points (see above instructions)
- Ghost implementation: 4 points (1 point for each ghost)
- Writeup: 6 points
- Instructions to run your code: 0 points. But you may receive an F if you do not specify exactly how to run your code.
- The assumptions you made when interpreting the description of the ghost behaviors: 1 point.
- The major challenges you met and how you overcame them: 1 points.
- The two questions: 2 points each.