JavaScript-PacMan 3D – Modes & Features

 

The following table provides on overview over the various modes and supported features of JavaScript-PacMan 3D:

 

Feature Game Play / Modes   Special Levels
  Generic Pac-Man Ms. Pac-Man   Pac-Man Ms. Pac-Man Ms. Pac-Man Plus
3D levels and graphics + + +   + + +
Figures and sounds: JS-PacMan 3D + +   +
Figures and sounds: Ms. Pac-Man +   + +
Ghost personalities + + +   + + +
Generic A.I. +  
A.I. alike Pac-Man + +   + + +
Regular disposition of scatter targets + +   +
Irregular scatter targets (randomized) +   + +
Scatter mode timing JS-PacMan (generic) +  
Scatter mode timing Pac-Man +   +
Scatter mode timing Ms. Pac-Man +   + +
Frighten mode timing Pac-Man + +   + + +
Multiple levels + + +   + +
Multiple sets of levels + + +  
Shuffle play + + +  
Levels must be cleared twice   + +
Bonus fruits Pac-Man style + + +   +
Bonus fruits Ms. Pac-Man style   + +
Extra bonus for key level 11+ +   +
Static bonus fruit +   +
Moving bonus fruit + +   + +
Bonus fruit random appearance +   + +
Increasing difficulty per level +  
Difficulty relies on timing only + +   + + +
Ghosts slow down in tunnels (tele ports) + +   + + +
Ghosts reverse on changing modes + +   + + +
Ghosts reverse on encounters only +  
Clyde acting short-sighted +  
Clyde acting far-sighted + +   + + +
Ghost may not travel up over ghost pen
as they leave their home
+ + +   + + +
Ghost may never travel up over ghost pen
(in normal mode)
+ +   + + +
Ghost may never travel up at Pac-Man's spot
(in normal mode)
  +
Static random generator + +   + + +
Random generator reset at start of each level +   +
True random generator +  
True Pac-Man-style ghost pen handling + +   + + +
Dynamic ghost pen management +  
 
Generally unsupported features:
Variable speeds per level  
"Cornering"  
"Cruise Elroy" mode  

 

Just a few words on the A.I. models ...

JS-PacMan Generic A.I.

"JavaScript-PacMan 3D" employs a special game logic that is optimized for speed and relies mainly on table look ups. As opposed to the game engines of the original games, the "intelligence" of the ghosts — and therefor also the difficulty of the game play — increases from level to level. (In lower levels the ghosts movements are mixed with random decisions.)

Here is a quick overview of the individual ghosts' behavior

  • Blinky
    Blinky (the red ghosts) follows in your tracks, performing a straight forward chase. Should he be confronted with two possible solutions of the problem, he just picks a random guess from the best directions.
  • Pinky
    Pinky's (the pink ghost) target is in front of Pac-Man, trying such to "sandwich" him together with Blinky, who is following in his tracks. In contrast to the original games Pinky actually "knows" at which crossing you are to show up and heads for it.
  • Inky
    Inky (the cyan-blue ghost) is a bit of a surprise, in fact a mixture of the other ones. With increasing levels he shares Pinky's knowledge about Pac-Man's routes.
  • Clyde
    Clyde (the yellow ghost) is actually short-sighted. When he has no sight of Pac-Man, he just goes his own ways. Should he get near Pac-Man, he tries to close in. But again he is not in it with his heart and might just loose interest soon.

In fright mode (that is, when the ghosts turn blue) the ghosts will not only move at random, as with the original games, but will actually try to get away from you. Again, this behavior is a bit randomized in lower levels.

The Original Pac-Man A.I.

And here a quick overview of the ghost-logics of the original Pac-Man and Ms. Pac-Man games. For details have a look at Jamey Pittman's great guide: The Pac-Man Dossiers.

Again, each of the ghost's features its special "personality":

  • Blinky
    As in generic mode Blinky uses the most straight forward chase strategy by using Pac-Man's current position as the target. Thus it will follow in the tracks of the player.
  • Pinky (Pink Ghost)
    Pinky also utilizes Pac-Man's position for the evaluation of its target, but will add 4 tiles in the direction of Pac-Man's current direction. Thus it will try to get in front of Pac-Man to waylay the player.
    Due to a bug in the algorithm (or maybe a late correction to make the game more easy to play) Pinky will also add 4 tiles to the left in case Pac-Man is going up. (The same bug applies to Inky, see below.)
  • Inky
    Inky uses the most complex evaluation scheme by using the positions of both Pac-Man and Blinky. To get Inky's target, aim at the tile two tiles away from Pac-Man's position in the direction Pac-Man is moving, then add Blinky's offset from this tile in the opposite direction. (So if Blinky is 3 tiles right and 1 below of the intermediary target, add an offset of 3 tiles to the left and 1 up.).
    As for the same reasons as with Blinky the intermediary target will be 2 tiles up and 2 tiles to the left in case Pac-Man is going up.
  • Clyde
    Clyde's target evaluation depends on a distance-threshold: If Clyde's distance to Pac-Man is 8 tiles or more, it will target Pac-Man's position. If inside of this 8-step area, it will aim at it's scatter target in the lower left corner. Thus it will close in on Pac-Man and then turn away to the lower left corner in an endless loop.

Each of the ghosts will try to reduce its distance from its current target (see above). Should it be confronted with two or more equivalent solutions, it will prefer directions in the following order: up, left, down, right.

Quote from the Pac-Man Dossiers:

Rumor has it Toru Iwatani and his team spent months doing nothing but tweaking and refining the ghost A.I. routines before releasing Pac-Man to the world. Their efforts show in the final product: Itawani's team created the illusion of complex pathfinding by using very simple logic and very little code.

In fright mode the ghosts will act on random. But Pac-Man's random isn't exactly random: As a ghost encounters a crossing or junction is will request a direction from a pseudo-random generator. Should this direction be blocked, it will search for an open passage in the following order: up, left, down, right. (Yes it's the same order of directions as above.) Since this random-generator is reset at the start of each level, it is possible to work out reproducible patterns for each level with the original Pac-Man game. (As the random generator is never reset in Ms. Pac-Man, there is much more real random involved. The only definite state of the game is, when you've just switched on the machine.)
In both Pac-Man mode and Ms. Pac-Man mode the span of time for which the ghosts remain in fright mode will decline faster with advancing levels as in generic mode, until they just turn blue for merely a second.

Generally all ghosts take their decisions one step in advance. In the original games you may even see their eyes pointing to the new direction as they approach a crossing. This isn't only for a nice visual effect, but also allows the player to perform some tricky moves to outmaneuver the ghosts in the last moment ...

Unsupported Features

The list above also mentions some features of the original games, which are not supported by "JavaScript-PacMan 3D". Here is a short glossary of them:

  • Variable Speeds:
    The original game play relies heavily on a complex scheme of interleaved timings: Generally Pac-Man moves slower than the ghosts while he munches food, but moves as fast or faster as them while moving along free passages. Ghosts on the other hand loose speed in tunnels and in frightened mode. The relation of these individual timing patterns change from level to level. (Or nearly. in fact there are 4 different schemes: For level 1, level 2 - 4, level 5 - 20, and levels 21+.) While "JavaScript-PacMan 3D" supports the slow down of ghosts in tunnels and in frightened mode, it does not support Pac-Man's variable speeds and the changing relations of the timing patterns. But as an extra users may change the overall speed of the game and the quality of the animations to accommodate to their machine's and browser's abilities.
  • Cornering:
    This term describes the players ability to gain some speed by "steering ahead". Generally Pac-Man will loose some speed while munching a pellet of food, making him likely to fell to prey to any ghost in his tracks. But as the player already steers him to the new direction as he approaches a corner, Pac-Man will glide around it, bringing some extra distance between him and any ghost following closely. Since "JavaScript-PacMan 3D" doesn't support variable speeds, this feature doesn't make much sense to the game play.
  • Cruise Elroy:
    In the original game Blinky (the red ghost) will speed up from time to time to become as fast or faster as Pac-man as he travels along food-free passages. In this special state Blinky is known as "Cruise Elroy". Again this feature is unsupported by "JavaScript-PacMan 3D" for the lack of variable speeds.

Ms. Pac-Man Plus

Ms. Pac-Man Plus is a classic hack of the original Ms. Pac-Man game (by Two-Bits Score), reported to have surfaced in 1981. This hack provides a new set of 4 levels that are to played in the same sequence as those of the original game. A series of bugs adds some entirely new features to the game: Since the fruits' path information remained unchanged, fruits will move on the imaginary grid of the original mazes, eventually passing through the walls of the new levels. For a similar bug ghosts slow down on some spots without reason as they pass the locations of tunnels found in the original levels. "JavaScript-PacMan 3D" provides a set of levels like those of Ms. Pac-Man Plus, but does not emulate the bugs of the hacked game.

Dimensions and Timing

"JavaScript-PacMan 3D" uses a smaller grid of tiles than the original games. (It's roughly 2/3 the size of the original layouts.) The timings for scatter mode, frightened mode, the ghost pen management, and bonus appearances were adjusted to match the smaller grid and closer distances involved.

High-Scores and Settings

High-Scores are treated separately for any individual combination of mazes and game play settings. So there is a separate high-score as you are playing "JavaScript-PacMan 3D" using shuffle play in Pac-man mode and yet another if you're playing all mazes sequentially in generic mode. (As there are 5 primary maze-modes to be played with any of the 3 game engines and 3 special modes with forced A.I., this adds up to 18 different high-scores in total.) All high-scores and settings are stored permanently between sessions using cookies. Use the link at the end of the introduction (below the actual game) to reset the high-scores on your computer.

 

Back to JavaScript-PacMan 3D.

 

N. Landsteiner, June/Aug. 2009
mass:werk – media environments
www.masswerk.at