Ms Pac-Man Competition
(screen-capture version)

IEEE CIG 2011 Results
IEEE CIG 2010 Results
IEEE CIG 2009 Results
IEEE CEC 2009 Results
WCCI 2008 Results
CEC 2007 Results

See also: Ms Pac-Man versus ghost-team competition.


Latest news: IEEE CIG 2011 Results now available.

The aim of this competition is to provide the best software controller for the game of Ms Pac-Man.  This is a great challenge for computational intelligence, machine learning, and AI in general.

Unlike Pac-Man, Ms. Pac-Man is a non-deterministic game, and rather difficult for most human players.  As far as we know, nobody really knows how hard it is to develop an AI player for the game.  The world record for a human player (on the original arcade version) currently stands at 921,360 (read more).  Can anyone develop a software agent to beat that?

The Ms. Pac-Man competition will test the ability of computer-based players at the conference.  We are especially interested in players that use computational intelligence methods to address the problem, but the contest is open to any type of algorithm: you can hand-program it as much as you like.

The mode of interaction is as follows: about 15 times per second your program will be sent a pixel map of the Ms. Pac-Man window, and it then responds with an integer indicating the direction of the joystick.


<see video by Manuel Loth>


The winning entry will be the program that can achieve the highest score given the allowed number of attempts at playing the game. 

The submitted controllers will be run 10 times each prior to the finals.  The finalists will be the five controllers with the best high-scores on those runs.

During the finals, each controller will be run a further 3 times.  The winning controller is the one with the highest score over all 13 runs (the 10 from the heats plus the 3 from the finals).

For IEEE CIG 2011, all controllers will be run on the same machine - a Mac Book Pro, running either MacOS, or Windows 7 via bootcamp.  The aim of this is to provide a level playing field for all controllers.

The version that will be used is the Microsoft Revenge of Arcade port of the Ms Pac-Man game - see the screenshot below, or the webpacman version: .  Both emulators are believed to run the same ROM code.

Your program should interact with the game by capturing the screen pixels of the game window many times per second, and sending keyboard events to control Ms Pac-Man.  The software toolkit provided on this page is given as a useful starting point, but you are free to write your own controller in any way you choose, provided that the basic mode of operation is the same.  Your program should not noticeably slow down the game, and any software that does this may be disqualified.

The use of computational intelligence methods is encouraged, but any types of controller are allowed.

Screen Capture

The screen shot below shows a game in progress (right) together with a screen re-created from this by capturing and  processing the pixel map (left).  This youtube video shows the system in action. The small window at the top shows the currently selected direction.  On this particular run, the controller shown below went on to achieve a score of 2680.

Image Processing

The pixel map is captured as an array of int (i.e. of type int[]), size w * h, where w=> and h=?.

A connected component analysis is done to extract all the relevant game objects:

  • Ghosts
  • Pills
  • Power-Pills
  • Ms PacMan (also referred to as the Agent).

Some specific processing is applied to the location of the Agent, in order to find the distance to each wall.  This is done by looking up, down, left and right from the Agent's current position.  These distance are put into the Agent's d array, and are used to determine the possible directions of movement at each point in time.

This process is not perfect due to delays in the capture process: it is possible that since capturing the image, the agent has moved, and that a calculated possible direction of travel is no longer available.

This means that controllers for the agent have to cope with two sources of non-determinism: that inherent in the game of Ms PacMan, and that resulting from the scheduling of the screen-capture.

Sample Controller

A very simple hand-designed controller has been provided.  This finds the pill closest to the agent (closest in terms of Euclidean distance), and attempts to move towards it (as shown by the cyan line in the screenshot above).  This controller has been run several times on the game, and does occasionally clear the first level.

The main parts of the code are shown below.  Note that these two methods were extracted from; a future release of this toolkit may put these into a separate controller class.

  public int move(GameState gs) {
    // let's say we move towards the
    // simple controller that tries to move towards the nearest power pill
    // set up a rogue value for the move, and a large value for the closest pill
    move = -1;
    double best = 100000;
    for (int i = 0; i < dirs.length; i++) {
      if (d[i] > 12) {
        // System.out.println(i + "\t " + eval(tmp, gs));
        if (eval(tmp, gs) < best) {
          move = i;
          best = eval(tmp, gs);
    if (move < 0) {
      System.out.println("Move error: " + move);
    // the +1 is to map the move into a range of joystick actions
    // where '0' is centre position
    move += 1;
    return move;

  public double eval(Vector2d pos, GameState gs) {
    if (gs.closestPill != null) {
      return pos.dist(gs.closestPill);
    } else {
      return 0;

Software Kit

The current release is in its early stages but nonetheless provides a useful starting point for controlling games via the screen-capture and analysis technique.

download: (this also uses the Statistical Summary class of

Start by running Ms PacMan, and then running:

java pacman.MsPacInterface

Note that the expected position of the Ms PacMan window is written in the code, and assume that it is centred on a 1280 x 800 screen.  You may need to adjust the left and right settings in the MsPacInterface:

// change these to suit your screen position
static int left = 530;
static int top = 274;

CSharp Kit

Thanks to Jonas Flensbank and Georgios Yannakakis for this C# kit:

Alternative Kit

Manuel Loth from the Sequel Team, INRIA, has kindly supplied this version of Ms Pac-Man that uses the original ROM code on a Linux-based emulator.  The kit also supplied a sample controller, seen in action in the video.  However, the controller uses access to the emulator memory, whereas for the competition the system should be screen-capture based.

<alternative kit>

<mpeg video>

Unified Toolkit

I am developing a unified toolkit that will integrate the screen capture and parsing tools with a simulation of the game.  The simulation of the game will eventually enable Monte Carlo rollouts plus some other nice features. 

How To Enter

Submit your software together with instructions on how to run it, and a short description paper of how it works (e.g. 3 page PDF) to Simon Lucas (

Important Dates

IEEE CIG 2011: deadline for final entries: August 21, 2011.

Known Problems

Some of the visual effects in Windows Vista may slow down screen capture enormously.  For example, on a Dell XPS M1330 laptop, transparent window effects increase the screen capture time from approx 5ms to approx 100ms.  Be warned!


IEEE CIG 2010 Results
IEEE CIG 2009 Results
IEEE CEC 2009 Results
IEEE WCCI 2008 Results
IEEE CEC 2007 Results

end of page