Why is 3333360 the maximum score in Pac-Man?

Why is 3333360 the maximum score in Pac-Man? - Football Players

According to the Wikipedia page for Pac-Man, the highest possible score is 3333360 points. It's called a perfect game and it was achieved by 3 different people already.

What I want to know is: WHY is it exactly 3333360 points? It must be a technical limitation, but this number makes no sense in my opinion.

I know the game has 255 levels. 255 is 11111111 in binary and level 256 (that seems to exist mystically) brings the 8-bit digit to an overflow, which ends in a crash of the game.

But, 3333360 just seems so random.



Best Answer

The score is limited because a glitch occurs on level 256 which overwrites half the screen with garbage. The game won't let a player advance from one board to the next without eating 244 dots and energizers, but the glitch overwrites many of the dots; this will leave the player unable to eat 244 dots and energizers, and thus unable to leave the level. In case you're wondering about why the glitch occurs, the machine code in Pac-Man to draw the fruits is similar to the C code:

unsigned char temp1, temp2;
unsigned char *ptr;

temp1 = level;
if (temp1 > 15) temp1 = 15;
temp2 = temp1;
if (temp2 > 7) temp2 = 7;
ptr = LOWER_RIGHT_ADDRESS;
do
{
  *ptr++ = shapes[temp1--];
} while(--temp);

Note that unlike many machines, Pac Man uses a rather curious screen memory layout which places consecutive bytes horizontally on the top and bottom of the screen, and vertically in the middle. This was most likely done to make it so that when drawing the main portion of the screen, memory addresses would be incremented by a power of two every eight scan lines (note that the "top" of the monitor is at the right side of the picture). Essentially, circuitry converted row/column indices to memory addresses with a mapping similar to:

//Using column values in the range 30 to 1, wrapping after 63...
address = (column & 32) ? 
          (row << 5) | (column & 31) :
          ((28 | (column & 3)) << 5)  | row);

but implemented in circuitry rather than code. This allowed screen addresses to be computed by using a pair of counters and a circuitry to select one of two permutations of those counters' bits. The hardware required to have memory address increase by 36 for each row rather than 32 would have been more complicated by comparison.




Pictures about "Why is 3333360 the maximum score in Pac-Man?"

Why is 3333360 the maximum score in Pac-Man? - Gathering Football Players
Why is 3333360 the maximum score in Pac-Man? - Man Holding White and Black Spalding Basketball Near Brown and White Basketball Hoop
Why is 3333360 the maximum score in Pac-Man? - Unrecognizable man near scoreboard during sports competition



Why is the max score in Pac-Man 3333360 points?

To achieve the game's maximum score of 3,333,360 points, Mitchell navigated 256 boards (or screens), eating every single dot, blinking energizer blob, flashing blue ghost, and point-loaded fruit, without losing a single life.

What is the highest possible score in Pac-Man?

William James Mitchell Jr. Holyoke, Massachusetts, U.S. In 1999, Mitchell was the first person to claim a perfect score of 3,333,360 points on the arcade game Pac-Man.



Pac-Man - Perfect Game 3,333,360




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Joe Calomeni, Pixabay, Mídia, Sides Imagery