Ghost "seal" ai #3

Open
opened 2026-01-19 22:28:28 +00:00 by Nigel · 0 comments
Owner

AI:

at its core, the ghost AI in the original Pac-Man is deceptively simple, especially when viewed from a grid-based movement perspective. The basic behavior you described — move forward until hitting a wall, then turn — is the foundation. But the magic comes from how each ghost chooses its direction at intersections.


🧠 Core Movement Logic

  • Ghosts move tile by tile, not pixel by pixel.
  • At each intersection, they evaluate possible directions (excluding reverse).
  • They choose a direction based on their personality or targeting logic.

👻 Classic Ghost Behaviors (for flavor)

Ghost Nickname Behavior Summary
Blinky "Red" Directly chases Pac-Man’s current position.
Pinky "Pink" Tries to ambush by aiming 4 tiles ahead of Pac-Man.
Inky "Blue" Uses a vector between Blinky and Pac-Man to triangulate.
Clyde "Orange" Chases Pac-Man until close, then retreats to a corner.

These behaviors are implemented by choosing a target tile, then selecting the direction that brings the ghost closest to it (using Manhattan distance).


🧩 For Your Seals in Penger

You can start with:

  • Simple forward movement until a wall.
  • At intersections, pick a direction:
    • Random (for chaotic behavior).
    • Toward Penger’s tile (for chasing).
    • Away from Penger (for retreating).
    • Predefined patrol routes (for flavor).

Then layer in personality:

  • One seal could “sniff” Penger and ignore walls.
  • Another could “echo-locate” and bounce off walls in a pattern.
  • One could “slide” faster on ice tiles.

Want help designing a tile-based movement system that supports these behaviors, or sketching out how to store ghost state and decision logic?

AI: — at its core, the ghost AI in the original Pac-Man is deceptively simple, especially when viewed from a grid-based movement perspective. The basic behavior you described — move forward until hitting a wall, then turn — is the foundation. But the magic comes from how each ghost chooses its direction at intersections. --- 🧠 Core Movement Logic - Ghosts move tile by tile, not pixel by pixel. - At each intersection, they evaluate possible directions (excluding reverse). - They choose a direction based on their personality or targeting logic. --- 👻 Classic Ghost Behaviors (for flavor) | Ghost | Nickname | Behavior Summary | |-----------|----------|------------------| | Blinky | "Red" | Directly chases Pac-Man’s current position. | | Pinky | "Pink" | Tries to ambush by aiming 4 tiles ahead of Pac-Man. | | Inky | "Blue" | Uses a vector between Blinky and Pac-Man to triangulate. | | Clyde | "Orange" | Chases Pac-Man until close, then retreats to a corner. | These behaviors are implemented by choosing a target tile, then selecting the direction that brings the ghost closest to it (using Manhattan distance). --- 🧩 For Your Seals in Penger You can start with: - Simple forward movement until a wall. - At intersections, pick a direction: - Random (for chaotic behavior). - Toward Penger’s tile (for chasing). - Away from Penger (for retreating). - Predefined patrol routes (for flavor). Then layer in personality: - One seal could “sniff” Penger and ignore walls. - Another could “echo-locate” and bounce off walls in a pattern. - One could “slide” faster on ice tiles. --- Want help designing a tile-based movement system that supports these behaviors, or sketching out how to store ghost state and decision logic?
Nigel added the enhancement label 2026-01-19 22:28:28 +00:00
Nigel self-assigned this 2026-01-19 22:28:28 +00:00
Sign in to join this conversation.