AI Agent for Ms Pac-Man

ai-ms-pac-man-icon

Dates

Technology

OO Analysis/Design, OO Programming, Java, AI, Tree Search Algorithms, Rule-Based System, Fuzzy Logic, Visual Paradigm, Eclipse

Info

I developed an Artificial Intelligent (AI) application (or AI Agent) that played Ms Pac-Man for my Master’s dissertation, using an iterative development lifecycle so I could iteratively improve my AI Agent by using measurable metrics. The agent I developed was a Fuzzy Logic, Rule-Based System combined with multiple Tree Search Algorithms.

My dissertation did not allow me to acquire the Ms Pac-Man game state (e.g. where Ms Pac-Man was, where the ghosts were), by reading the game’s memory. I was only allowed to acquire the game state by making my AI Agent app take a screenshot of the game (multiples times a second) and extracting the game state from it.

Research

As my dissertation was based on an annual competition, I started by reading through all 32 earlier papers that had been submitted to the competition by past participants. I organised them into a spreadsheet by the different AI techniques they employed. I then statically analysed the spreadsheet data. I documented any resulting correlations or patterns, and explored possible reasons why, while using graphs and charts to illustrate key points.

The areas I researched were:

  • Papers from Past AI Competitions
  • Published Research Papers on AI Used in Games
  • AI Techniques

Planning

I started by prioritising all AI techniques used by past competition participants to decide which AI techniques I should attempt to implement. I then grouped the ones I selected into iterations. I started each iteration by specifying requirements, which stated what AI techniques I would implement and how I would implement them. I then proceeded with analysing the requirements and designing a solution.

Images

During the first iteration, I focused primarily on visually extracting the game state from the Ms Pac-Man game:

During the second iteration, I added ‘intelligence’ to my AI application: