Ms. Pac-man - Perfected!
Playback of an unofficial world record performance and 'perfect game' of Ms. Pac-man
A perfect game is achieved by scoring the maximum possible points of 1,923,760 over 141 levels without losing a single life.
A perfect game of Pac-man was first recorded back in 1999,
but a perfect game of Ms. Pac-man is considered almost impossible, and a holy grail of classic arcade gaming.
The official world record is only 933,580 (factory settings), which is less than half the perfect score.
This is mostly due to the random fruit bonuses which vary between 100 and 5000 points starting at level 8 for the remaining 134 levels of the game until the 'Kill Screen'
at level 142 where the game crashes.
The probability of getting the maximum fruit bonus is
⅛268
or roughly 1 chance in 10242
(yep, that's a 1 with 242 zeroes after it).
To give you an idea of the scale, you have 1 chance in 3,838,380 to win a 6 ball Lotto draw (1 line) and there are roughly 1023 stars in the known universe!
So with those kinds of odds how was this 'miracle' performed then?
Basically, I modified a Ms. Pac-man emulator and employed an informed search algorithm using a search tree, rules engine, emulator save states, game RAM snooping, a little
graph theory, and a lot of trial and error.
The technical term for this is 'cheating' :)
Through the use of save states (snapshots of the game's memory and cpu state) the search algorithm can backtrack from dead ends and try different routes through the maze until it succeeds.
The direction and exact timing of each turn is recorded so a successful route through the maze can be played back.
To solve the random fruit bonus problem I simply have to backtrack until I get the fruit I want.
This works because backtracking and choosing a different direction will change the
timing at which certain dots are eaten. It's this timing that determines which fruit is 'randomly' chosen.
By the way, what you are watching is not a video but the actual game being emulated in software. (It's a JavaScript port of my C# emulator and playback code)
The software is simply 'moving the joystick' in a specific direction at a specific time as determined by the playback file.
The game itself has not been modified in any way.
The game ROMs are exactly the same as those used by the original arcade game and other emulators like MAME.
This has been a passion project of mine since 2010.
The first perfect game was achieved in January 2012 but playback was over 5 hours.
This version, recorded in March 2014, is just under 3 hours but is being played back here at double speed.