Pac-Man Ghost AI Explained

13 jul 2019
767 381 visningar

Ever wondered how exactly each ghost follows Pac-Man around? It's all explained right here.
LINKS
Twitter (updates): twitter.com/RetroGameMechEx
Patreon (support): www.patreon.com/rgmechex
Discord (discussion): discord.rgmechex.com
SOURCES & MORE INFO
cubeman.org/arcade-source/pacman.asm
donhodges.com/pacman_pinky_explanation.htm
gameinternals.com/post/2072558330/understanding-pac-man-ghost-behavior
www.gamasutra.com/view/feature/132330/the_pacman_dossier.php
PATRONS
Thank you everyone who supports the channel on Patreon!
Ange Albertini, Sten, 333Rich333, Glenn Sugden NPC, Jordan Wiens, Alex Yancey, David Mazarro, Avi Drissman, Steven, LiraNuna, null, Ryan, Corey Ogburn, Martin Trozell, Scott Harper, Garret Kelly, Mike Gerow, Jake Hickman, Larry Koubiak, Narskogr, Joel Kuhn, Joshua Goyder, Dan Shedd, Sembiance, Tina Wuest, Xander, 4F Panda, Max Roncace, David, Owen Christensen, A Sentient JDAM, Gynvael, Alec Johnson, Brian Henriquez, Travis Nellor, Seth Tierney, Zach Hugethanks, Sijmen Schoon, FFVIMan, Buddy, Mikely Whiplash, Chris Margroff, Yakov, Joseph M, Oxygen Chen, Israel Jacquez, Brandan Lennox, RetroReversing.com, Nik, yuriks, Chris Apple, Ceres, Jason Hughes, Nicholas, Diamond Ice, Jeremiah, F. Murmel, jesugtz, Chris Post, Chris Roy, Chris Connett, Mark, Cypher Signal, Matthew, Shannon Potter, Rupix, sapslaj, Jonathan Scott, Gescheit Gespielt, Gabe S, krivx, Tao Schreiner, Seth N. Hetu, Xkeeper, Bjoern Hansen, Walter Huf, ers35, Pixy011, Daniel Bernard (ReckedCat), Vier Ladair, Bwangry, Jared Johnstone, Phil Clayburn, zephyrin, Kit Spindler, Johnathan Roatch, David Spalding, Jeremy Wright, Acceleration Shark, David Johnson, newnintendo64, Brandon, Matt Shepard, Gary Fenstamaker, Felix Freiberger, Sypwn, Rory Kelly, William Thomas, Carl Cassler, Niles Rogoff, Kusabi, Joe Mecca, Reflet, Michael Greb, tripper, Kefen, nightcap, leftler, Drew Fitzpatrick, Ly Fecha, Dan Salvato, Paxton Sanders, Eugene Bulkin, Walter Weaver, Gethiox, Zoë Mettauer, nexilar, Articate, Julian Meinking, Julien Oster, Braydon Kains, Juniper, Foxchild, buzzert, & Scott Beca

Kommentarer
  • I made a lua script that lets you see the ghosts' target tiles and path projections in real-time! You can check it out here: seworld.info/will/hpvDy8m3e4qEr30/video

    Retro Game Mechanics ExplainedRetro Game Mechanics ExplainedÅr sedan
    • @Fatal Wreck Ms. Pac-Man's ghost logic is similar, but not quite the same. The ghosts in that game still pick target tiles and generally make the same decisions on how to get there, but some intersection decisions are pseudo-random during Chase mode, which precludes the use of memorized patterns. I don't recall off the top of my head if each individual ghost's AI is the same - I believe their rules are a bit different.

      Matt KellnerMatt Kellner3 månader sedan
    • I've seen enough. I'm satisfied.

      Arfan Eka DiandraArfan Eka Diandra5 månader sedan
    • Do these same guidelines also apply in Ms. PacMan?

      Fatal WreckFatal Wreck7 månader sedan
    • Why Lua?

      James LarroweJames Larrowe11 månader sedan
    • How does the ghosts work at level "0" (or 256,512,768...)

      Kirsty JenesonKirsty Jeneson11 månader sedan
  • Did mark brown Plagiarised this video?

    chuletitos chuletaschuletitos chuletas2 dagar sedan
  • Huh you know this is really cool

    Taunt TitanTaunt Titan3 dagar sedan
  • _Pac-Man ghost ai for dummies_ *Red: chase* *Pink: block* *Blue: strategize* *Orange: fuck it*

    GreenGreen3 dagar sedan
  • Clyde was a dude in the 80's cartoon, but was rumored to have a crush on pac-man in the original game. _I think this means something..._ *(Thonk)* Probably not.

    GreenGreen3 dagar sedan
  • This is a great example of how you can achieve an emergent complex behaviour with a few simple rules - something where modern games with optimized pathfinding engines, hierarchical bevahiour trees and hundreds of "ai"-states often enough fail.

    RadonatosRadonatos3 dagar sedan
  • I just realized that Clyde is trying to do the "old school ghost way", only scaring, going away and back to scare again

    Spring DavidSpring David7 dagar sedan
  • I'm only here because I wanted to make Pac-man themed OCs and I feel like I just got a psychological look at the Ghosts right now.

    mateus pedrosa da silvamateus pedrosa da silva7 dagar sedan
  • So that's why they camp the corners

    Logan FarmerLogan Farmer7 dagar sedan
  • 5:08 What's up with level 17?

    DrPumpkinzDrPumpkinz7 dagar sedan
  • The sad thing is I know a bit of this because I watched the PIXELS movie ._.

    Laromlab MaybeLaromlab Maybe14 dagar sedan
  • Shadow=always chases you (duh) Speedy=Ambushes you Bashful=always tries to block off your path Pokey=Chicken

    J P M RobloxJ P M Roblox15 dagar sedan
  • Never knew Pinky was a female. Or had any gender at all…

    Florian KochFlorian Koch16 dagar sedan
  • It's amazing that 40 years ago they can program the AI like that Also Pacman is first RGB color videogame

    Jezrel John PerasolJezrel John Perasol16 dagar sedan
  • Things you can trust the ghost in Pac-Man for: Being manipulated Things you can’t trust Clyde for: Defending you from the R34 artists. Give it a second...

    TippexTippex17 dagar sedan
  • I love how they managed to implement their own personalities in a very limited way. Just by using color and their attack patterns and methods.

    Flandre ScarletFlandre Scarlet17 dagar sedan
  • Dude wish youd posted this 39 years ago XD

    Saturday Night MonsterSaturday Night Monster19 dagar sedan
  • Pac-Man ghosts names: Blinky, Inky, Pinky, and Clyde

    Dominic Mestas-WilsonDominic Mestas-Wilson21 dag sedan
  • lkijuhytfdrtyuijhvcxcvbnm,mnbvcdfvghjklkjhgfdfghjkjh

    Ezra EvansEzra Evans22 dagar sedan
  • blinky: come on! hit him! clyde: *but my mom said no*

    Orochi's Life -Orochi's Life -22 dagar sedan
  • so clyde is canadian

    Orochi's Life -Orochi's Life -22 dagar sedan
  • blinky chases you pinky tricks you inky has ADHD clyde kills you on accident

    Orochi's Life -Orochi's Life -22 dagar sedan
  • everybody gangsta till ghosts turn 180 degrees all the time

    L0AD1NG YTL0AD1NG YT23 dagar sedan
  • basically, all of this guy's other videos are basically this: (insert retro game here) (insert retro game mechanic here) Explained

    Tannermations // Tanner The Object, Inc.Tannermations // Tanner The Object, Inc.25 dagar sedan
  • gamegan is the begging of doom

    Liam JacksonLiam Jackson26 dagar sedan
  • Does anyone know if this same AI is used for other versions of the game? I’m specifically playing around with the NES port, and when I go into the safe spot, the ghosts loop differently than in the diagram here. The AI in general feels a little off.

    TheSBWproductionsTheSBWproductions26 dagar sedan
  • What's the logic to determine how long they are in the ghost box?

    Ali MuzaffarAli Muzaffar26 dagar sedan
  • 4:47 I imagine animating this would be a nightmare but I think you just cloned characters

    the life firethe life fire27 dagar sedan
  • I used to be a god at google pacman, I knew all of the ghost paths and where I could hide from them. For example, if you hide in the G, they won't spot you until they specifically enter it from the entryway above the G

    President NathanPresident Nathan29 dagar sedan
  • 1928 we will have flying cars in the future! 2020: ghost ai

    Diary of a wimpy kid fan! Last name!Diary of a wimpy kid fan! Last name!Månad sedan
  • 8:29 you said XFF instead of YFF Wait you said hex not x sorry

    Timmilton PlaceholderTimmilton PlaceholderMånad sedan
  • This is outstanding. Sub'd

    Some DudeSome DudeMånad sedan
  • And now you know why they're also called Shadow, Speedy, Bashful and Pokey: chasing, getting ahead, in-between, slow on the uptake. Also cool to know that they each have their own little corners to patrol on a regular (albeit temporary) cycle. Dat Pinky glitch doh.

    Carbon Roller CacoCarbon Roller CacoMånad sedan
  • The real question is:HOW DOES PAC-Man EAT THOSE GHOSTS

    Mikaail MussaMikaail MussaMånad sedan
  • ──▒▒▒▒▒────▄████▄───── ─▒─▄▒─▄▒──███▄█▀────── ─▒▒▒▒▒▒▒─▐████──█──█── ─▒▒▒▒▒▒▒──█████▄────── ─▒─▒─▒─▒───▀████▀─────

    ツLoli BootyツツLoli BootyツMånad sedan
  • Scatter Mode placement Blinky: Upper right Pinky: Upper left Inky: Lower right Clyde: Lower left

    Richard EubanksRichard EubanksMånad sedan
  • Can you do pac man e.x.e move patern?

    EveryoneEveryoneMånad sedan
  • I love how each of the ghosts were given their own personalities.

    Mr SpiffyMr SpiffyMånad sedan
  • this is my favorite game of all time lol

    epic donnyepic donnyMånad sedan
  • PAC man: just wants food Blinky: imma find you…. And imma kill Pinky: so do you want me to kill you or Blinky? Inky: *GHOSTS TOGETHER STRONG cylde: yeah imma get him IMMA GET HIM IMMA GE-AAAAAAAAAH HEEESS SOOOOO SCARRRY!!!!!!!

    SIS & BRO OMG!SIS & BRO OMG!Månad sedan
  • They could've made the AI sooooo much more simple. The concept was solid enough to carry the game on its own already. In all likelihood, nobody without a trained eye could tell the difference. *I* would've made the AI more simple if I were one of the people on the development team. But they took the time to fine-tune the difficulty, to make the ghosts distinct, and to make the game the best it could possibly be. And I respect that.

    Eric LeeEric Lee2 månader sedan
  • I watched the video while pac-man set in the safe spot

    The Wind Waking HeroThe Wind Waking Hero2 månader sedan
  • I did the first exception and do I remember you saying that Inky goes into different loops that one per each game

    Don’t SmokingDon’t Smoking2 månader sedan
  • God loves you, so smile!

    Vic FletcherVic Fletcher2 månader sedan
  • Billy figured this out a long time ago and cheated to the top lol

    Justin CollinsJustin Collins2 månader sedan
  • Petition to rename orange ghoust into stinky.

    Lonely GuyLonely Guy3 månader sedan
  • Yo, yo, yo, yo, yo! What it is, motherfuckers!

    W00TmooW00Tmoo3 månader sedan
  • Is there a formula for Inky's chase pattern? I understand the result and can summarize it (Inky's marks 2 tiles ahead of Pac Man, looks at Blinky, and goes toward the position opposite Blinky from the mark), but I would like to know how to write that out mathematically.

    ShrikeswindShrikeswind3 månader sedan
  • Ok so let me get this straight In chase mode Blinky: i will simply try and get Pac-Man mainly causing me to be behind Pac-Man Pinky: i will simply go in front of Pac-Man Inky: I will simply try and help Blinky Clyde: I don’t need to deal with Pac-Man today screw this

    New JusticeNew Justice3 månader sedan
  • clyde is social distancing

    Nathan NNathan N3 månader sedan
  • Skip to 10:36 to skip the boring stuff

    ThatFamiIiarNightThatFamiIiarNight3 månader sedan
  • I find it interesting how blindly is kinda of the leader since since he’s the one on the offensive and inky and pinky help play to his strengths by trapping and pincering you and clyde is more of area control than an offensive threat

    Terryranisauras RexTerryranisauras Rex3 månader sedan
  • Clyde is me trying to ask for some directions literally anywhere at any time

    Daniel CastilloDaniel Castillo3 månader sedan
  • For a possible Halloween special, you could maybe do a video similar to this that explains the ghost AI and audio cues of BerickCook's Pac-Man game.

    BBHood217BBHood2173 månader sedan
  • "Pinky has the next simplest way to figure out her target tile" it should be "Pinky has the next simplest way to figure out his target tile"

    RandomPerson744 teh Object thingyRandomPerson744 teh Object thingy3 månader sedan
  • Learning this will give me an edge next time I play. And those safe zones are a god send

    Scott PeltierScott Peltier4 månader sedan
  • Me explaining to my teachers why video games are educational:

    kgd dragokgd drago4 månader sedan
  • So what’s the deal with Sue the purple ghost in Ms. Pac-Man. Is it just a recolor basically or are the mechanics different?

    EyItsNaeEyItsNae4 månader sedan
  • Pinikes AI when you go up You just got vectored

    Lionheart XDLionheart XD4 månader sedan
  • this doesn't apply to google's fake pacman :(

    Nguyen Khanh DuyNguyen Khanh Duy4 månader sedan
  • 14:39 I get a feeling that with a little bit of calculus you can cañculate that mess And I think that in scatter mode they are actually protecting the power pills from you

    Stray OrionStray Orion4 månader sedan
  • Inky Blinky pinky and of coursestinky-NOOOO IM THE NEW ONE AND MY NAME IS CLYDE

    SIS & BRO OMG!SIS & BRO OMG!4 månader sedan
  • What are the parameters of (W^X) + (Y^Z) ?

    Dev HonkingDev Honking4 månader sedan
  • The path prediction clip at the very end was totally bad ass. What a great idea.

    jwdonaljwdonal4 månader sedan
  • Billy Mitchell: I dont need any math.

    Glenn BonaguaGlenn Bonagua5 månader sedan
  • Wow I never knew there was so much to it

    Damaris HrabDamaris Hrab5 månader sedan
  • Wouldn’t this mean that Pac-man isn’t reliant in patterns to play well, but by abusing the ghosts AI to move certain ways?

    Haunt23Haunt235 månader sedan
  • And here I thought they just walked around aimlessly until they got close enough to pac-man

    dead memedead meme5 månader sedan
  • Dude, I can't believe you ended with him dying!!! What a twist ending- I love it! 👍👍 Thanks for the video, super interesting.

    Tyler JanesTyler Janes5 månader sedan
  • I played a game showing how the ghosts work (in chase mode) and I learned nothing. Thanks for the info!

    this is a guythis is a guy5 månader sedan
  • yo u gotta wonder how many times this mans played pacman to figure this out also this man could be completely wrong and we would never know

    ZorryMarsZorryMars5 månader sedan
  • Clyde: gaming's first Tsundere.

    CerealCereal5 månader sedan
  • Can you make a video about Pac-Man cornering techniques?

    KdKd5 månader sedan
  • 1000th comment!!!

    ᪶ ᪶᪶ ᪶5 månader sedan
  • 999th comment

    Corey LoveCorey Love5 månader sedan
    • I got 1000th!

      ᪶ ᪶᪶ ᪶5 månader sedan
  • I've read about the ghost behaviors many times, but this is the first time I've seen it presented in-game - it's much easier to visualize. Thank you!

    JW LJW L5 månader sedan
  • The way each ghost is described really does match the actual math behind Pac Man's code. Blinky: Aggressive and likely the leader. His main goal is to catch Pac Man at all costs. Pinky: Likes to ambush Pac Man, possibly out of shyness with being behind him. Can get nervous in certain situations if her strategy is turned against her. Inky: While not the most dangerous, he is quite cunning and tries to set himself up to ensnare Pac Man. Clyde: Just plain stupid. He's Clyde; what did you expect?

    DaBluePittooDaBluePittoo5 månader sedan
  • The game plays quite a bit differently when you patch the ROM and fix the Pinky and Inky AI bugs as described on Don Hodges site.

    William KrickWilliam Krick5 månader sedan
  • 666k views...

    JustARandomIdiotJustARandomIdiot5 månader sedan
  • How did you possibly figure all this out ? I'm impressed.

    Kraft WerkKraft Werk5 månader sedan
  • This was great.

    Anthony JarvisAnthony Jarvis5 månader sedan
  • Kid: dad i’m hungry Dad: you see that haunted house over their? Kid: yeah Dad: eat this, then go in their

    Basty Bacon filmsBasty Bacon films5 månader sedan
  • Blinky chases you Pinky likes to cut you off Inky helps blinky and is the trickster Clyde is the odd one out

    That switchy FanThat switchy Fan5 månader sedan
  • 4:48 try to beat pac man with this

    Bait the whooshBait the whoosh5 månader sedan
  • Do the ghosts behave the same way in MS. Pac Man?

    4bitsystem4bitsystem5 månader sedan
  • Wow.. this video is awesome. You break it down perfectly man. I really never understood how technical the game is.. how the ghosts 👻 have certain patterns. I remember memorizing their pathways somewhat but never did i realize it was this beautiful complex dance between Paxman and the angles and routes he went that determined how each ghost 👻 would chase and scatter and move on the board... awesome 👌 video man. Can't wait to try some of this. I have a gameboy advance SP game that I will try it on. I had a table top Pacman but I sold it and now I wish I wouldn't have ..

    Christopher EspinosaChristopher Espinosa5 månader sedan
  • 1:00 Would've been nice to know what the signifiers next to the numbers mean. The only context we get is that the numbers without signifiers are frames.

    NoriMoriNoriMori6 månader sedan
  • This applies to Ms.Pacman as well?

    Nocruz 237Nocruz 2376 månader sedan
  • One question in mind: Could various Pac-Man rip-offs at that time -- when Pac-Man hit the scene -- implement these behaviors?

    neetrainneetrain6 månader sedan
  • 4:43 That is a LOT of ghosts for Pac Man to handle!

    Asif KabirAsif Kabir6 månader sedan
  • So how does this behavior differ in Ms. Pac-Man and Jr. Pac-Man? Peace.

    MuzikJunkyAESMuzikJunkyAES6 månader sedan
  • Trying to code Pac-Man in Java this vid really helped thanks :P

    GhomezAnonimousGhomezAnonimous6 månader sedan
  • So pinky is a girl?

    Tommy IrwinTommy Irwin6 månader sedan
  • How do you do the simulations with tons of ghosts?

    Fuley-la-jooFuley-la-joo6 månader sedan
  • Do the same thing but on level 256

    corey Inmancorey Inman6 månader sedan
  • So that’s why ScottFalco said Pac-Man mains are “Master(s) of 4D Chess”

    My name is M&M and I’m here to say,My name is M&M and I’m here to say,6 månader sedan
  • Very nice video. I really enjoy your rgme playlist :D Can you provide for more information about teleporters? I am curious on why they would enter them. From my understanding, it seems like they are not really aware of them and just enter them because of their target/direction choosing algorithm during chase and frightened mode. Scatter and eyeball would never result in using the teleporters even if it would make it more efficent.

    Jimmy BeaubienJimmy Beaubien6 månader sedan
  • I love that there is a "I need to use the restroom" spot to leave Pac Man in the maze.

    Morgan423ZMorgan423Z6 månader sedan
  • I like when Clyde was replaced by Sue, because then I can tease the Sue I know. :P

    bsharpmajorscalebsharpmajorscale6 månader sedan
  • The ghosts were going well. The names were great: Inky, Blinky, Pinky. Cute names. then they fucking named one *clyde* of all things like wtf lol

    wonkstagerwonkstager6 månader sedan
SEworld