Pac-Man Ghost AI Explained

Поділитися
Вставка
  • Опубліковано 21 лис 2024

КОМЕНТАРІ • 1,6 тис.

  • @RGMechEx
    @RGMechEx  5 років тому +798

    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: ua-cam.com/video/Pc_fdSEWRJM/v-deo.html

    • @heheheiamasuperstarwarrior9281
      @heheheiamasuperstarwarrior9281 5 років тому +5

      Thanks for the video! I always wondered how the ghost ai works.

    • @paulthompson9668
      @paulthompson9668 5 років тому +3

      Thumbs down for supporting Jack Conte's Internet censorship machine (i.e., Patreon).

    • @bfdicremurumu1581
      @bfdicremurumu1581 5 років тому +1

      Is this the same for Google pac-man or are they all just like blinky in that one?

    • @nobodynada_
      @nobodynada_ 5 років тому +8

      Here's a website I came across a few years ago that has similar interactive simulations: masonicgit.github.io/pacman/
      You can observe a single ghost in isolation by selecting "Learn" mode, or you can start a game in "Practice" mode and enable paths and targets in the cheats menu.

    • @lefmike
      @lefmike 5 років тому +1

      @@orangeparabola and king crimson nono yoku

  • @diacosiapentacontahex
    @diacosiapentacontahex 4 роки тому +1383

    Fun Fact: Clyde's original Japanese name "Otoboke" literally means defocused, as in Clyde literally just doesn't care about getting Pac-Man and wants to do his own thing. I personally found that really cute.

    • @salomeheredia9885
      @salomeheredia9885 Рік тому +49

      He may also get scared when Pacboy is about to get the big ball, but this was an idea about his personality

    • @AngryBird762
      @AngryBird762 Рік тому +120

      Clyde has commitment problems. He doesn’t wanna hurt anybody. Clyde is a precious lil cinnamon roll and is too precious for this world.

    • @themorgue3836
      @themorgue3836 Рік тому +48

      He’s just like me fr

    • @Exportasjpeg
      @Exportasjpeg Рік тому +45

      I like how the animated series took how the ghosts in the game act and made it their personalities. Especially Clyde's

    • @razi_man
      @razi_man Рік тому +13

      False. Cyde's Japanese name is Guzuta.
      Saying Clyde's Japanese name is "otoboke" is like saying Clyde's English name is "pokey".

  • @RadiantSharaShaymin
    @RadiantSharaShaymin 5 років тому +1904

    So Pinky is always jumping in front of you, Blinky is always chasing you, and Inky is always doing math to work together with Blinky.
    Oh, and Clyde tells himself he was close enough, time to go home.

    • @ballisticboo7808
      @ballisticboo7808 3 роки тому +207

      Clyde is like "ok I made progress on my anxiety today, gonna go home and try again tomorrow."

    • @RadiantSharaShaymin
      @RadiantSharaShaymin 3 роки тому +108

      @@ballisticboo7808 I'm making that the official cannon in my mind. Clyde is one of the best characters ever designed.

    • @xboydubose7254
      @xboydubose7254 3 роки тому +41

      Clyde: I'm gonna get him, oh... nevermind.

    • @noiwont4081
      @noiwont4081 3 роки тому +1

      this comment has 666 likes...

    • @reclaimer0018
      @reclaimer0018 3 роки тому +19

      clyde is the accidental killer

  • @homemadepro
    @homemadepro 5 років тому +3805

    Blinky is the chaser
    Pinky is the ambusher
    Inky is the trickster
    Clyde is....just Clyde

    • @leathernluv
      @leathernluv 5 років тому +92

      @Jake Shattuck LAMP = Linux, Apache, MySQL, PHP.
      Clyde is a geek, not a premeditated killer!
      Clyde just knows that Pac Man is a trespasser, and the game is in TX.

    • @Codricmon
      @Codricmon 5 років тому +257

      I like to think of Clyde as the Wannabe, he tries to be as courageous as Blinky, but when he actually gets close to Pac-Man, he runs away to his home corner to hide.

    • @nespeon5279
      @nespeon5279 5 років тому +52

      Clyde gives out Fresh Waters

    • @CrashCubeZeroOne
      @CrashCubeZeroOne 5 років тому +136

      ᗣ Shadow - "Blinky"
      ᗣ Speedy - "Pinky"
      ᗣ Bashful - "Inky"
      ᗣ Pokey - "Clyde"

    • @sometimessnarky1642
      @sometimessnarky1642 5 років тому +21

      Right turn Clyde

  • @Kris18
    @Kris18 5 років тому +1514

    In every video, the graphics and animations are simple, elegant, purposeful, and functional while the commentary is insightful and well-written. There's few channels that can rival the quality of those put out on this channel. As always, I thoroughly enjoyed this video, Dots. Thank you!

    • @clonefighter1996
      @clonefighter1996 5 років тому +2

      So you know his real channel is Dotsarecool, right?

    • @Kris18
      @Kris18 5 років тому +6

      @@clonefighter1996 "Real channel" lol ... and yes, and I referred to him as Dots in that comment.

    • @nihilsson
      @nihilsson 5 років тому +2

      This channel blows me away every time I watch a video... The clarity and insight is unbelievable

    • @kys9332
      @kys9332 5 років тому

      Reminds me of lemmino

    • @garlicfromplantsvs.zombies3285
      @garlicfromplantsvs.zombies3285 4 роки тому +1

      Why is your profile pic a ruined epic face?

  • @xander0479
    @xander0479 5 років тому +938

    This is actually really interesting. One of those things I've always wondered about but never thought to look into

    • @Iliek
      @Iliek 5 років тому +15

      I'm actually actually.

    • @xander0479
      @xander0479 5 років тому +9

      @@Iliek what

    • @Iliek
      @Iliek 5 років тому +9

      @@xander0479 Actually.

    • @omgomgomgd
      @omgomgomgd 5 років тому +10

      i accidentally actually a whole actual accident

    • @Iliek
      @Iliek 5 років тому +7

      I'm actually extremely actual.

  • @sanseverything900
    @sanseverything900 2 роки тому +277

    I always wondered how they coded the ghosts to have some sort of 'plan' to trap Pacman back in the early 80s when video game AI was barely in its infancy. Turns out it's actually quite simple!

    • @ag2023en
      @ag2023en Рік тому +29

      Simple, yet brilliant!
      Pac-Man is an impressive game.

    • @johnmc3862
      @johnmc3862 Рік тому +1

      Always simple when you know how.

  • @pleasedontwatchthese9593
    @pleasedontwatchthese9593 5 років тому +836

    I have wanted to make a pacman clone but I did not know how the AI worked. This was a big help.

    • @alienxotic5028
      @alienxotic5028 5 років тому +13

      Can I see it

    • @bluespam-number-4224
      @bluespam-number-4224 5 років тому +39

      PleaseDontWatchThese link us if you ever succeed

    • @Pixelbitie
      @Pixelbitie 5 років тому +8

      Hope it goes well!

    • @oppo210
      @oppo210 5 років тому +25

      Are you going to make sure your version also has the overflow bug?

    • @manjuegazos4672
      @manjuegazos4672 5 років тому +8

      If you make a pacman clone, this will happen in a different way:
      The ghost will go to their nearest target

  • @pepperonipizza8200
    @pepperonipizza8200 5 років тому +988

    Blinky: Just TOUCH him Clyde!
    Clyde: No, I don’t think I will.

    • @ryangonzalez8121
      @ryangonzalez8121 4 роки тому +46

      Clyde doesnt refuse,hes just scared! =

    • @retrohero64butonhisphone80
      @retrohero64butonhisphone80 4 роки тому +7

      @@ryangonzalez8121 Please tell me you're joking.

    • @ryangonzalez8121
      @ryangonzalez8121 4 роки тому +16

      @@retrohero64butonhisphone80 no im not

    • @retrohero64butonhisphone80
      @retrohero64butonhisphone80 4 роки тому +5

      @@ryangonzalez8121 He is called stupid by the game, not scared
      AND his character trait is BEING STUPID
      He isn't scared he is just *STUPID*

    • @bluberrydee6205
      @bluberrydee6205 4 роки тому +11

      @@retrohero64butonhisphone80 Meh, that's really your opinion

  • @333Rich33
    @333Rich33 5 років тому +1922

    Seeing the path predictions at the end was super interesting and cool! Another great video as always!

    • @MrTrombonebandgeek
      @MrTrombonebandgeek 5 років тому +6

      333Rich333 Personal Channel i could watch that all dat

    • @FoxerTails
      @FoxerTails 5 років тому +18

      I'd actually like to see this be implemented as a fan game or mod. It could help people be better at Pac Man or be used to train... for people that need it I guess.

    • @Pēm̐cā
      @Pēm̐cā 5 років тому +2

      Its made of logic

    • @qwhale
      @qwhale 5 років тому +2

      Indeed

    • @RandomPsychic
      @RandomPsychic 5 років тому +3

      i wonder if there is an augmented reality app which overlays the best path to take....

  • @huntergreer3599
    @huntergreer3599 5 років тому +2303

    Me at 11pm: “man I should probably go to sleep early tonight”
    Me at 3am: “PAC-Man Ghost AI explained”

    • @ori5_
      @ori5_ 5 років тому +9

      I was here at 1am today lool

    • @huntergreer3599
      @huntergreer3599 5 років тому +6

      Zigzagunz funny thing is that I made this comment at 3:00am

    • @inkfire2236
      @inkfire2236 5 років тому +6

      Me at 3am: *dEtAiLs Of My SeCtOrS eNeRgY sHoUlD bE bEtWeEn Me AnD mS pAc ThAnK yOu VeRy MuCh*

    • @liamsamonte7666
      @liamsamonte7666 5 років тому +1

      It's 11:01 for me

    • @coolcreeper5434
      @coolcreeper5434 5 років тому

      Am here at 12am oof

  • @JoeMecca
    @JoeMecca 5 років тому +728

    This is a crazy great illustration of these mechanics. You do a good job helping me visualize these things. as a developer myself, it really adds a new layer to the code that is a lot harder to imagine just in my head

    • @earthwormjim91
      @earthwormjim91 5 років тому +3

      Is this impressive coding?

    • @JoeMecca
      @JoeMecca 5 років тому +37

      earthwormjim91 Well yea definitely. Given the hardware limitations these guys had at the time, engineers had to come up with extremely efficient solutions. People who made games back in the day were extremely intelligent and talented people

    • @earthwormjim91
      @earthwormjim91 5 років тому +6

      @@JoeMecca listening to all of this it sure sounds impressive lol, was curious what someone who sounds like they actually understand this stuff thought

    • @earthwormjim91
      @earthwormjim91 5 років тому +3

      @@KieferSkunk damn you're making me wanna look more ibto this guy lol. I did keep finding myself throughout the video thinking how impressive it is all these little things coming together into one intuitive whole is incredible

    • @portablerefrigerator4902
      @portablerefrigerator4902 5 років тому +1

      one day i shall make a game that is 10 times better than anything you make! just wait! i have begun my quest only recently but i... I HAVE THE MEMZ

  • @xboydubose7254
    @xboydubose7254 3 роки тому +222

    Blinky: Chase
    Inky: Close in
    Pinky: Surprise
    Clyde: *I'm just built different*

    • @jstarandomdude
      @jstarandomdude 3 роки тому +8

      Clyde usually retreats if he sees u

    • @xboydubose7254
      @xboydubose7254 3 роки тому +3

      @@jstarandomdude yea that's the joke

    • @kemcolian2001
      @kemcolian2001 9 місяців тому +2

      @abbiebabbles "I'm built different (incorrectly)"

  • @deepfriedcabbage
    @deepfriedcabbage 5 років тому +266

    So the ghosts' main differences are: Blinky chases you (usually from the back), Pinky tries to attack from the front, Inky works with Blinky to ambush you, and Clyde chases you unless he gets too close, making him head to the bottom left.

    • @Burn_Angel
      @Burn_Angel 5 років тому +23

      Well, yeah. That's the easy version everyone knows.

    • @SonicMaster519
      @SonicMaster519 Рік тому +8

      “Eh, I got close enough to catching that guy. I’m going home. Good night everybody.”

  • @hexyoutubeaccount
    @hexyoutubeaccount 5 років тому +341

    Yo, With the most gratitude in the world, I wanted to tell you that i've been falling asleep to your videos for the last month.
    My life has been extremely stressful and my anxiety is at an all time high but SOMEHOW these videos calm me down 100% of the time. The tone and cadence of your voice is so soothing to me, and the subject matter is so interesting that it pulls me away from all the stressful stuff in my life just enough so i can finally relax. I promise I always come back and rewatch the videos when i'm fully awake too :P
    I just wanted to say thanks. seriously. Thank you for this channel. Not only is it extremely fascinating, educational, and high quality, it's helping me get some damn sleep.

    • @leathernluv
      @leathernluv 5 років тому +10

      Thank you for finally giving me insight as to why some of my friends want to fall asleep on the phone. They tell me I have a soothing voice (to them, not to many others.) I agree with most people, there is nothing great about my voice or cadence. If someone can sing and hit notes perfectly but they sound like Fran Drescher and high pitch, not many buy that album. (I do not sound like Fran Drescher.) One friend used to call me nearly every night, and even asked me to move in. I couldn't put my finger on it, but you just did, thank you!

    • @SonicLoverDS
      @SonicLoverDS 5 років тому +17

      "Your videos make me fall asleep" sounds like the opposite of a compliment.

    • @alkohallick2901
      @alkohallick2901 4 роки тому

      Me too. Either this or serial killer videos.

  • @That_Guy977
    @That_Guy977 5 років тому +201

    I love how at 18:29 Inky is like "Yeah, going far off the map will _probably_ help me catch Pacman."

    • @why-ue1tu
      @why-ue1tu 3 роки тому +87

      He was thinking out of the box

    • @Nico_com_c
      @Nico_com_c 3 роки тому +13

      @@why-ue1tu You're not a clown, you're the entire circus

    • @micahscott3895
      @micahscott3895 8 місяців тому +2

      @@why-ue1tu I am the 69th like.

    • @ERRORRubiksZeraBrand
      @ERRORRubiksZeraBrand 7 місяців тому

      @@why-ue1tu he's thinking outside of the house

    • @Jackaboy3695
      @Jackaboy3695 3 місяці тому

      Yeah, what if pac-man commits cheat?

  • @AFXffs772
    @AFXffs772 5 років тому +252

    Wow Thought it was:
    Red: chase
    Blue: trap
    Pinky: guards power pellets
    Orange: random

    • @TSwany
      @TSwany 5 років тому +51

      come to think of it, a ghost who guards the power pellets would be pretty neat

    • @dundee6402
      @dundee6402 4 роки тому +43

      Loon She kinda does guard the pellets since you're usually going towards them and her strategy is to jump in front of you.

    • @jakubwegrzyn3798
      @jakubwegrzyn3798 4 роки тому +29

      hmmm, i thought it was:
      red: random
      blue: random
      pinky: random
      orange: random

    • @andromedanangel6042
      @andromedanangel6042 4 роки тому +14

      I thought it was...
      All of them: chase

    • @baitthewhoosh5739
      @baitthewhoosh5739 4 роки тому +3

      Andromedan Angel me to

  • @supercomputer276
    @supercomputer276 5 років тому +164

    I knew about how the targeting worked, but I didn't know exactly how the offset error for facing up occurred or about the safe tiles. Thanks!

    • @Supermario0727
      @Supermario0727 5 років тому

      I think it's caused by arithmetic overflow.

    • @zandbergx9747
      @zandbergx9747 5 років тому +6

      @@Supermario0727 I mean, he does kinda explain it in the video

  • @TheRationalPi
    @TheRationalPi 5 років тому +93

    Amazing example of emergence. The rules are so simple, but the resulting patterns after figuring in pacman's movement are very complex.

  • @TheCow-j1l
    @TheCow-j1l 5 років тому +407

    Pac-Man is so amazing, even nowadays this game stuns me with it's AI.

    • @nemplayer1776
      @nemplayer1776 5 років тому +84

      The AI is amazing as it's so simple, so effective and so fun to play against at the same time. It's honestly a masterpiece.

    • @callinater6133
      @callinater6133 2 роки тому +4

      The original Pac-Man championship edition has the most developed and aggressive ghost AI

    • @corellioncrusaderproductio4679
      @corellioncrusaderproductio4679 2 роки тому +2

      @@callinater6133 Isn't it identical to the original, just more dangerous with the longer hallways on the map?

    • @callinater6133
      @callinater6133 2 роки тому +7

      @@corellioncrusaderproductio4679 technically you’re right but certain bugs that made the ghosts behave less intelligently were removed.

    • @corellioncrusaderproductio4679
      @corellioncrusaderproductio4679 2 роки тому +1

      @@callinater6133 Bugs? the only movement bugs the ghosts had was where the y tile for pinky and inky was mirrored to the x coordinate as well. I wasn't aware of any other bugs in the ghosts movement?
      Unless you mean they patched out the 'loops' that you can force them to go in, but that has nothing to do with glitches or issues with the intelligence of the model, that's intentionally designed because of certain areas in the map that they can't turn up at.

  • @Scrubermensch
    @Scrubermensch 5 років тому +432

    How I remember this
    Red is the fastest
    White/pink is the smartest
    Blue is the slowest
    Brown/orange doesn't care and kills pac-man accidentally lol

    • @chazlonewolff3320
      @chazlonewolff3320 5 років тому +24

      🤣🤣🤣 I hate when Clyde gets me

    • @Scrubermensch
      @Scrubermensch 5 років тому +45

      @@chazlonewolff3320 You can see in his eyes, that he doesn't even know, what he's doin lmao

    • @chazlonewolff3320
      @chazlonewolff3320 5 років тому +22

      I literally will be in a arcade and be like fucking Clyde you lucky weak fuck 🤣

    • @ohwoah4324
      @ohwoah4324 5 років тому +7

      you're colorblind

    • @Scrubermensch
      @Scrubermensch 5 років тому +6

      @@ohwoah4324 Did you play on a 90's TV and on an actual device?

  • @chowdog8184
    @chowdog8184 5 років тому +1044

    Blinky: Hi I'm Blinky
    Inky: Hi I'm Inky
    Pinky: Hi I'm Pinky
    Me: So you must be...?
    Clyde: Of course it's me Clyde

    • @TheRationalPi
      @TheRationalPi 5 років тому +54

      @@stayskeptic3923 Baby pacman's real dad.

    • @ChristopherSobieniak
      @ChristopherSobieniak 5 років тому +30

      @Like it says in the book. Too bad they didn't call Sue that in the second game, that would've worked perfectly!

    • @LKDesign
      @LKDesign 5 років тому +19

      No! This is Patrick!

    • @chawae55schannel54
      @chawae55schannel54 5 років тому +38

      Blinky: Hi I'm Blinky
      Inky: Hi I'm Inky
      Pinky: Hi I'm Pinky
      Me: So you must be...?
      Clyde:I like trains🚃🚃🚃🚃🚃🚃🚃🚃🚃🚃🚃

    • @johndorian4078
      @johndorian4078 5 років тому +26

      His parents were going to name him stinky, so yeah.. he lucked out.

  • @williamdeford292
    @williamdeford292 3 роки тому +13

    One thing you might add is that when you are in the hiding spot and think you are safe, a switch to scatter mode can get you eaten. Clyde can get you if he reverses while in his vertical loop by coming across where the fruit appears. Inky can get you if he loops around the lower right energizer area. This has happened to me when I've left a game to go do something else and it waits long enough for the 4th scatter. Great video! Usually, though, if I have Clyde in his horizontal loop, I make it through fine--probably because the 4th scatter is too short for Inky to do anything harmful.

  • @TheAtmonauti
    @TheAtmonauti 4 роки тому +22

    The animation at the end showing the ghosts pathing is one of the coolest things I've ever seen in a retro game explainer video. Outstanding work!

  • @WaterShowsProd
    @WaterShowsProd 5 років тому +51

    I've heard before about how the ghosts target different points relative to Pac-Man, but this is the first time I've seen an explanation of how exactly that targeting translates to their navigation. Thank you very much. It's impossible really to explain just how much of a revelation Pac-Man was when it first arrived.

  • @MakotoIchinose
    @MakotoIchinose 5 років тому +178

    Because of Pac-Man, we're used to take AI path finding for granted in games ever since.
    Nice video, as always!

  • @truepixelgamer8779
    @truepixelgamer8779 5 років тому +150

    I'm quite curious how the ghosts react and determine which direction to go on level 256 (aka the killscreen).

    • @Trimint123
      @Trimint123 5 років тому +33

      Because the kill screen doesn't have walls that will letting them know to turn 90 degrees, they just endlessly moving and had no way to chasing Pac-Man.

    • @Trimint123
      @Trimint123 5 років тому +10

      It's actually very easy to understand once you figure it out how either of these mechanics works.

    • @iceypumpkinhead
      @iceypumpkinhead 5 років тому +28

      They look at the absolute mess in front of them and charge forward and hope they don't become corrupted by it.

    • @Slash0mega
      @Slash0mega 4 роки тому +2

      Its not to complication, the ghosts don't see cordores, it sees collision. it will update its target, then check for tiles that count for collision around it as per normal (down and left is blocked, must move up. left, up, and right is open, check target, take closest path). only wildcard would be a dead end.
      edit, remembered this article, blog.danielwellman.com/2008/10/real-life-tron-on-an-apple-iigs.html
      same thing happens kindof, a light cycle escapes into "memory" and starts driving by weather or not random bits of memory looks like a wall or not and navigates that way. of course, that guy had the added quirk of rewriting whatever code it drove over.

    • @oatmeal0
      @oatmeal0 4 роки тому +13

      The game has no boundaries at level 256, so the ghosts enter scatter mode and stay that way forever.

  • @pinballwiz45b
    @pinballwiz45b 5 років тому +49

    1:50 At this moment, Blinky changes his name to Cruise Elroy and unleashes his full potential.
    The other ghosts: "What did it cost?"
    Cruise Elroy: "Everything."

    • @ballisticboo7808
      @ballisticboo7808 4 роки тому +7

      Now I'm just imagining the other ghosts watching Blinky undergo a Super Saiyan transformation. Thank you for that mental image.

  • @carultch
    @carultch 5 років тому +59

    I always thought Blinky was the most vicious of the ghosts, and now I understand why.

    • @reillywalker195
      @reillywalker195 2 роки тому +21

      In Pac-Mania, he's also the fastest ghost contrary to what artwork on the cabinet might suggest. Outrunning Blinky in that game without the speed pellet is impossible. You can jump over him if you time it right, though.

    • @Mitsuraga
      @Mitsuraga Рік тому +12

      Pinky was always my mortal enemy. She's almost certainly killed me more than have any of the other ghosts. Blinky is probably second.

    • @travanforbes8989
      @travanforbes8989 11 місяців тому +11

      Blinky is the most aggresive and hardest as he almost never stops chasing you, and Pinky doesn't make it any better because she seems to be in the perfect place to trap you

    • @mohammadayubkhan999
      @mohammadayubkhan999 5 місяців тому +1

      Ye , when I play pacman blinky and pinky are so aggressive and get me all the time. Inky and Clyde do nothing.

  • @philrod1
    @philrod1 5 років тому +14

    Beautiful explanation! Ms. Pac-Man uses the same targeting system but has added random behavior rather than a fixed target during scatter mode. This makes the game less predictable.

  • @Justin-TPG
    @Justin-TPG 5 років тому +21

    For anyone coming here wondering why the game counts tiles from the top right instead of the usual top left (and therefore why moving in a positive horizontal direction is calculated with a -1), this is because Pac-Man is a game which has the monitor rotated 90 degrees clockwise, making it vertically oriented. This provided a ‘vertical’ resolution of 288 rows instead of the 224 this hardware was capable of, allowing for the production of a tall maze. Internally, the game logic doesn’t change and the hardware operates as if the screen was in horizontal orientation, so when you move right, you’re really moving upwards. Conversely, when you move left, you’re really moving down the screen, hence this is calculated with 01 rather than -1.

    • @ephemeralViolette
      @ephemeralViolette 5 років тому +4

      Pretty sure this is also why level 0x00 (256) has the garbage tiles beginning from the top right.

    • @Justin-TPG
      @Justin-TPG 5 років тому +2

      theundeadwolf0 Good point!

  • @soursugar4867
    @soursugar4867 4 роки тому +63

    Clyde after almost getting to pacman: ight imma head out

    • @maximkoneva6517
      @maximkoneva6517 3 роки тому +8

      Don't worry he has anexiety

    • @atrain818
      @atrain818 3 роки тому +4

      If you watch one of those perfect pac man runs by one of those top players (like Billy mitchell) Clyde give them the most trouble by far

  • @davidtaylor9999
    @davidtaylor9999 5 років тому +21

    Your voice is so soothing yet really intelligent, and makes everything so easy to digest.

  • @Windveils
    @Windveils 5 років тому +21

    I get chills every time I hear that intro jingle because I know I'm about to learn some cool shit.

  • @hanthonyc
    @hanthonyc 3 роки тому +6

    Finally, someone who gets into the nitty-gritty technical aspects I've always wanted to learn more about. The visual graphics are super helpful too, and very nice looking

  • @wkbj7924
    @wkbj7924 5 років тому +8

    This video explains so much. Back when I played Pac Man in the arcade, if I was stuck between ghosts, I used to jiggle the joystick between the two available directions, and the ghosts would sometimes go away. Now I understand why this happened. I'm pretty sure Inky is the ghost that got me the most often, though.

    • @reillywalker195
      @reillywalker195 2 роки тому +2

      Inky gets me most often, too. His less predictable pathfinding is probably why.

  • @carprincess
    @carprincess 5 років тому +4

    Thanks for explaining the game mechanics for the ghosts so thoroughly. I knew they all had different movement patterns but never knew to what extent.

  • @AF.281OldChannel
    @AF.281OldChannel 4 роки тому +12

    4:46 Pac-Man be like “OK WHOS BEEN MESSING WITH THE CLONE MACHINE?”.

  • @chauntikleer
    @chauntikleer 4 роки тому +2

    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!

  • @FLYNN_TAGGART
    @FLYNN_TAGGART 5 років тому +29

    This is really well explained! I feel like I could make an open-source Pac-Man clone in a day now!

  • @Rationalific
    @Rationalific 2 роки тому +5

    Man, I didn't know that this kind information could be turned into such entertainment, but honestly, these types of videos are more entertaining to me than about any movie or TV show out there. It's great that such content is being made!

  • @voxelfusion9894
    @voxelfusion9894 5 років тому +67

    After signing up for Patreon I finally realized why so many of the patron icons at the end are foxes...
    Fantastic video, I always thought the pacman ghost AI was complex, but it turns out it's far simpler!
    With those excellent animations to visualize it, it makes a lot of sense and does a good enough job, considering the limited cpu power.

    • @ethohalfslab
      @ethohalfslab 5 років тому +36

      Yeah, once you enter patreon you automatically become a furry ^w^

    • @KusaneHexaku
      @KusaneHexaku 5 років тому +10

      @@ethohalfslab OwO

    • @adjacent_dollar
      @adjacent_dollar Рік тому

      ​@@ethohalfslab :confused_staring:

    • @ethohalfslab
      @ethohalfslab Рік тому

      @@adjacent_dollar >:3

    • @blueyandicy
      @blueyandicy 10 місяців тому

      ​@@ethohalfslabI don't get it...

  • @ninjacell2999
    @ninjacell2999 5 років тому +3

    I've heard so many times about the different ghost movements, but this is the best explanation by far. Fantastic stuff.

  • @TheBellKeeper
    @TheBellKeeper 5 років тому +13

    i hated seeing this in my recommendations because i dont want to hear how pacmans AI works for the hundredth time... but your presentation is very clear and unique. so good job

  • @Noah-ost
    @Noah-ost 5 років тому +8

    This is easily one of the best retro channels on UA-cam. Great content, man.

  • @astral2048
    @astral2048 5 років тому +9

    Really comprehensive! I'm going to try to make my own version of Pac-Man with the same mechanics now. I might leave the Pinky targeting offset bug but in all existing game-engines, it'll probably already be fixed (since they won't be using 2 bytes only and interpreting them as one 16-bit number). Also, most engines have pathfinding functions built-in to it. So I'll have to make that bug into a deliberate feature.

    • @kh6853
      @kh6853 Рік тому

      Or... Leave it out to make things really annoying to pro players.

  • @HelenFire420
    @HelenFire420 5 років тому +51

    Can you do a video on Ms Pac-Man, and it’s differences to regular Pac-Man

    • @bigpboy1012
      @bigpboy1012 5 років тому +15

      The biggest differences are that the ghosts move randomly for the first 7 seconds, and losing a life doesn't reset the Random Number Generator.

    • @usualunusualkid7149
      @usualunusualkid7149 5 років тому +13

      @@bigpboy1012 and level 257 is reachable

    • @Burn_Angel
      @Burn_Angel 5 років тому +1

      Fruits move.

    • @tapatorta
      @tapatorta 4 роки тому +1

      You play as ms pacman

    • @nickkenny5263
      @nickkenny5263 4 роки тому +1

      Pac man is dummy thicc

  • @KingofKong
    @KingofKong 5 років тому +8

    I like watching these to see how accurate the information is. This is the best one I've seen, nice video!

  • @TheMrRuttazzo
    @TheMrRuttazzo 5 років тому +72

    The enemies' AI from 40+ years ago was already more complex than in most of the current games. Not even kidding. There are exceptions, sure, but how many times have we seen those cannon fodder cookie-cutter enemies that have two behaviors: 1. Hiding/shield up and 2. Shooting/shield down, most of them have literally nothing more in their virtual brains.

    • @WaxxyOne
      @WaxxyOne 4 роки тому +19

      The restrictions imposed by older hardware forced game developers to think outside the box and find creative solutions to gaming problems. By doing some very simple calculations, they were able to come up with four very different AI behaviors that made the ghosts seem smarter and less predictable as a result.

    • @alkohallick2901
      @alkohallick2901 4 роки тому +2

      *enemy's

    • @Tokmurok
      @Tokmurok 4 роки тому +5

      @@alkohallick2901 piss off.

    • @henryzhang3961
      @henryzhang3961 4 роки тому

      What about enemies in 3d games like minecraft that have to pathfind around obstacles

    • @chickenbokernot2598
      @chickenbokernot2598 4 роки тому +1

      Henry Zhang they don’t pathfind around obstacles they pathfind directly to the player if they are in range.

  • @Majoris239
    @Majoris239 5 років тому +25

    First time I am seeing Pythagorean's thereom being used outside of school. Pretty cool to see it used, and actually understand it

    • @wessmall7957
      @wessmall7957 4 роки тому +10

      It's used a lot in videogames. Distance between two vectors is the square root of the sum of their squared x and y offsets. Even works in 3D. And if you only want to compare two distances, you don't even need to take the square root. Optimized Pythagorean's theorem 👍

  • @fmilioni
    @fmilioni 5 років тому +12

    Wow, simpler than I expected, but works really nice. Thanks for uploading this fantastic video.

  • @donaldklopper
    @donaldklopper 5 років тому +10

    Wow good job! Everything in the Pacman fonts too... Hats off to you.

  • @TheBrendanMcCoy
    @TheBrendanMcCoy 5 років тому +1

    Love your style. No annoying intros, outtros, music, or shilling. Feels like a it's out of a professional online course. Instant subscribe.

  • @DerpDerp3001
    @DerpDerp3001 5 років тому +7

    Request: Tim Follin's technique for making multi-channel music on a single beeper ZX-Spectrum.

  • @dunkinnatalie
    @dunkinnatalie 5 років тому +42

    This was so informative. I was able to beat pacman in 15 minutes with both eyes closed, lefty flip. Thank you.

  • @Nightshft42
    @Nightshft42 3 роки тому +3

    Not only the AI's algorithm is really impressive for it's time, also this explanation and visualization is absolutely brilliant. Thanks!

  • @bojosev5845
    @bojosev5845 5 років тому +14

    After playing PacMan for long enough, I could tell their patterns, and I always wondered how they all worked. Now I know, after many years! Thank you!

  • @SleepyAdam
    @SleepyAdam 3 роки тому +10

    It's impressive that even if you don't know exactly how the AI works, they gave the ghost's their own personalities that sort of help you understand how they're gonna try and come at you. Pac-Man really was one of the first games with character and it ties in directly to the gameplay.

    • @mattybrunolucaszeneresalas9072
      @mattybrunolucaszeneresalas9072 3 роки тому

      5:21 what does this mean?
      Regardless of whether they are in frightened mode or not? Isn’t that the point?

    • @TheRedSmarty
      @TheRedSmarty Рік тому

      @@mattybrunolucaszeneresalas9072 The ghosts turn around when Pac-Man gets a power pellet. This still happens if the ghosts were already frightened before the pellet is collected.

    • @corellioncrusaderproductio4679
      @corellioncrusaderproductio4679 Рік тому +1

      @@mattybrunolucaszeneresalas9072 Basically no matter what, a power pellet means the ghosts will reverse. Even in later levels where they cannot be in fright mode, they still reverse. The only exception is when they are in the ghost house. They do not reverse until exiting the pen in this case.

    • @mattybrunolucaszeneresalas9072
      @mattybrunolucaszeneresalas9072 Рік тому +1

      @@corellioncrusaderproductio4679 I thought so :)

    • @mattybrunolucaszeneresalas9072
      @mattybrunolucaszeneresalas9072 Рік тому +1

      @@TheRedSmarty thank you :3

  • @TheWASHINGMACHINEBOY
    @TheWASHINGMACHINEBOY 5 років тому +1

    to simplify the ghosts’ chase behaviors, blinky simply targets the tile pac-man is on, pinky targets the tile four tiles in front of pac-man, inky works like blinky does except his target tile is affected by the location of blinky and clyde works like blinky too but he only chases pac-man if he is not within an eight-tile radius around pac-man

  • @Maltanx
    @Maltanx 5 років тому +9

    The quality and precision of your animations never cease to amaze me!

  • @superpi2
    @superpi2 3 роки тому +2

    Just a random connection I made... in PAC-MAN 99, about halfway through each match, arrows appear above the ghost house and the spawn area. I never knew what these meant until watching this, but it seems that they appear to signify that the intersection turn restrictions mentioned at 13:12 are disabled in order to eliminate the ability to exploit the ghost/jammer AI. I may be completely wrong about that, but if that is the case then that's pretty cool.

  • @mahj
    @mahj 5 років тому +8

    I absolutely adore all your videos.

  • @elcarajito6929
    @elcarajito6929 5 років тому +2

    My man, you deserve a Nobel Prize for figuring this whole thing out. Mad kudos to you!

    • @isavenewspapers8890
      @isavenewspapers8890 2 роки тому +1

      I find it exceedingly unlikely that this entire video is original research.

  • @iceypumpkinhead
    @iceypumpkinhead 5 років тому +35

    How would Pac-Man avoid the ghosts if he was controlled by AI?

    • @kalbert9367
      @kalbert9367 5 років тому +8

      If you put AI in charge of all the movement you can do anything.

  • @MotiviqueStudio
    @MotiviqueStudio 5 років тому +1

    This is way more engrossing than it should be, but having grown up with this game, it's like looking behind the curtain.
    The visualization at the end of this video is simply amazing.

  • @dastardlyman
    @dastardlyman 3 роки тому +2

    amazing. im old and bought a small paperback book called "mastering pacman" way back in the early 1980s. i still have it. i play pacman on emulators like mame to this day. your video explains a lot. best wishes

  • @trickysoft
    @trickysoft 9 місяців тому +1

    Great explanation of the artifact that I saw when writing pacman for the BBC micro. I implemented the pathfinding from a doc I found explaining it, so didn't have the overflow and always got the calculation "correct". John Studley, one of the perfect pacman players played my version and before long had found a place where you can sit and no ghosts will get you. I checked the original code and found the maths was "wrong" but have left it "as planned" in my version. Who would have thought a simple optimisation would have caused such a useful "bug". Maybe they knew, we may never know!

  • @BinaryHedgehog1
    @BinaryHedgehog1 5 років тому +4

    I once read a great write-up of the ghost AI, but seeing it in action is even better. I did get a bit better once I better understood the ghost patterns.

  • @totallynotabot151
    @totallynotabot151 3 роки тому +1

    I remember reading write ups of the ghost behaviors & overflow bug a long time ago, but your animations make it a lot more intuitive. Thank you!

  • @markusTegelane
    @markusTegelane 5 років тому +131

    Did I just watch a 20 minute video about ghosts in a video game?
    Yes, I did.

    • @kenrickkahn
      @kenrickkahn 5 років тому +2

      I'm not complaining..

    • @Uchuma74
      @Uchuma74 5 років тому +5

      This comment sounds sarcastic, but I genuinely found this video interesting.

    • @ffccardoso
      @ffccardoso 5 років тому

      20 minutes? I think it was 2... it could be 2 hours... !

    • @markusTegelane
      @markusTegelane 4 роки тому

      @@Uchuma74 You can't hear my voice in a comment, you can only read it, so I may be serious....

    • @Uchuma74
      @Uchuma74 4 роки тому

      @@markusTegelane True, I can only hear myself repeating the comment back to myself. "Seems" would have been a better word, which is evident with the trailing periods and how you hid the bottom line under a "see more" tab.
      I would say you're splitting hairs on this, but whatever 🤷‍♀️

  • @zitou2170
    @zitou2170 5 років тому +5

    This, was a lot less complicated than I thought....
    I now feel like a god at Pac-Man.

  • @euginarex5649
    @euginarex5649 3 роки тому +4

    Pac-Man: is being chased by Pinky
    Pac-Man: *Turns around*
    Pinky: *Run away, frightened*

  • @TheSameGoobyGuy
    @TheSameGoobyGuy 2 роки тому +2

    This brings up the question… what would happen if it was just you and inky in a level?

  • @Thetrainbloke
    @Thetrainbloke 2 роки тому +12

    Pinky ambushes you
    Blinky chases you
    Inky helps blinky
    Clyde is wondering if mayonnaise is an instrument

  • @KusaneHexaku
    @KusaneHexaku 5 років тому +6

    Great explanations and visuals as always! I kinda wanna randomly say that the tiny ghosts walking around is surprisingly cute u.u

  • @bluberrydee6205
    @bluberrydee6205 5 років тому +14

    The real names of the ghosts may or may not give hints about their AI
    Blinky - Shadow (Since Pac Man is the target and a shadow follows something, this implies that Blinky will follow Pac Man)
    Pinky - Speedy ( I guess Pinky will "speed" ahead of Pac Man, though Blinky speeds up after a certain amount of pellets are gone)
    Inky - Bashful ( I guess he's to scared to face Pac Man alone so he goes with Blinky)
    Clyde - Pokey ( Idk how this has anything to do with his AI but its better that Clyde which sounds like Collide which is the last thing you expect Clyde to do)

    • @qaaris4280
      @qaaris4280 4 роки тому +2

      I think Pokey is another word for 'stupid'.
      So Clyde is just called Stupid.

    • @pegleg759
      @pegleg759 4 роки тому +1

      Maybe pokey as in he "pokes" at pacman by getting close then running off

    • @bluberrydee6205
      @bluberrydee6205 2 місяці тому

      @@pegleg759Late reply but this is a good one

  • @lamelama22
    @lamelama22 5 років тому +1

    Your animations are amazing and excellent at being illustrative of the points you're making. That animation at the end was super fun.

  • @ezioauditore4120
    @ezioauditore4120 5 років тому +3

    Wow! I never knew there was a pattern for the ghosts and it was guided mathematically. Now I understand more how a game is and how hard to program it behave in a manner the devs wanted it to. Thanks for this information. 😁

  • @MrJBRPG
    @MrJBRPG 5 років тому +2

    This is a great start on game AI on the arcade section. Have you consider doing Joust next? Joust does have AI that not only have path-finding, they also behave exactly like the player in movement and controls. The Pterodactyl is the only exception.

  • @StageCraftBeast
    @StageCraftBeast 5 років тому +33

    You should do a video on the Gen 2 cries of Pokemon Gold and Silver.

    • @alienxotic5028
      @alienxotic5028 5 років тому

      Hah

    • @Trimint123
      @Trimint123 5 років тому +1

      Not necessarily since it still the same coding as Gen 1 since that games is base of, but with more cry noises.

  • @AndyAndromedaArt
    @AndyAndromedaArt 5 років тому +2

    Loved this video. It was rather fascinating actually. You also did an amazing job explaining everything with the animations!

  • @MidnightMechanic
    @MidnightMechanic 5 років тому +4

    I wonder if it's possible to download an overlay to show their paths and targets as the end of the video showed, that looks like a cool mod, with Pacman constantly with a target and reticle on his back.

  • @Tysonyar
    @Tysonyar 5 років тому +1

    This video is why I love UA-cam. I had no idea the AI in Pac Man was so complex! Great video.

  • @squidnipendleton3765
    @squidnipendleton3765 5 років тому +4

    Beautiful video. New to the channel and, frankly, I'm obsessed! Keep up the insightful and brilliant videos!

  • @genesorianoautor3973
    @genesorianoautor3973 2 роки тому +1

    That sequence at the end when all the ghosts are tracking pacman and Blinky has a circumference around pacman is dope. Some robocop type shit.

  • @TheGerkuman
    @TheGerkuman 5 років тому +13

    Big question: did they fix Pinky's offset values for Ms Pacman?

    • @danhouse1989
      @danhouse1989 5 років тому +13

      They did not fix Pinky for Ms Pac. The rest behave in a similar fashion but the programming issue wasn't fixed between the games since MS Pacman was a daughter board that was added on to a Pac Man. If you take off the daughter board and put a Z80 I think it was in its place, you can deconvert it back to Pacman.

    • @SumRandomDewd
      @SumRandomDewd 4 роки тому +1

      Ms. Pac-Man was a mod and was stolen by Namco.

    • @reillywalker195
      @reillywalker195 2 роки тому

      @@SumRandomDewd I wouldn't call Ms. Pac-Man "stolen" since Pac-Man was and is a Namco property. Namco's choice to license Ms. Pac-Man to Midway rather than sue the game out of existence was really rather sensible.

  • @Stilgarsan
    @Stilgarsan Рік тому +1

    15:33 more practical ways than the hiding spot? Given that the hiding spot is the only way to "pause" the arcade game when having an extended session, I think it is pretty practical.

  • @gretarreynisson3280
    @gretarreynisson3280 5 років тому +34

    Last time I was this early Billy Mitchell still had credibility

    • @thecrimsoncreep6665
      @thecrimsoncreep6665 5 років тому +11

      I doubt you were around in the Stone Age

    • @anselmschueler
      @anselmschueler 5 років тому

      Who the heck is that and why has he lost credibility

    • @catlover10192
      @catlover10192 5 років тому +7

      @@WetDogSquad Pretty sure Billy Mitchell was recently caught faking scores.

    • @deg6788
      @deg6788 5 років тому

      Hahahaha billy

  • @LendriMujina
    @LendriMujina 9 місяців тому +2

    "Blinky chases, Pinky ambushes, Inky scares easily, and [Clyde/Sue] isn't very smart." - Namco Museum (GameCube version)

  • @neetrain
    @neetrain 4 роки тому +7

    One question in mind: Could various Pac-Man rip-offs at that time -- when Pac-Man hit the scene -- implement these behaviors?

  • @SmugMatty
    @SmugMatty 5 років тому +1

    You did a very good job doing a breakdown on how each ghost's AI actually works and really enjoyed seeing the ghost's AI in real time.
    Wonder if it's possible to make a plugin for it on a emulator to show real-time ghost AI.

  • @PrimitiveOs
    @PrimitiveOs 5 років тому +7

    Ir you ever have the chance do a tutorial on your explaining animations. It is amazing how your graphics helps to understand concepts and would ve great even for my job. Great work

    • @cheersluv5510
      @cheersluv5510 5 років тому +3

      ua-cam.com/video/yuVx4QI6fIM/v-deo.html

  • @BrekMartin
    @BrekMartin 5 років тому +2

    I shudder to think how much time went into programming for the video. Well done!

  • @pauldeddens5349
    @pauldeddens5349 2 роки тому +3

    It makes me wonder if it would make any significant difference if the targeting offset on Pinky and Inky were fixed. It looks small, but leads to pretty significant issues a really good player can take easy advantage of.

    • @02DooD
      @02DooD 2 роки тому +1

      There's a specific Pac-Man port they used in the older Namco Museums on N64 up until the PS2 (Including the Pac-Man World games) that was based on the original source code, but was slightly different. The upward offset was actually changed to be identical in all 4 directions

  • @jinxedcupcakes
    @jinxedcupcakes 4 роки тому

    this is one of my favourite videos on youtube i’ve come back here so many times

  • @TerraRuneOfficial
    @TerraRuneOfficial 5 років тому +8

    I would like to see you take on the ghost movement in pacman.exe

  • @stephenl2146
    @stephenl2146 2 роки тому

    Thanks for the great description of the logic of pac-man. Back in the day (when I was a kid), I wanted to master pac-man. There were books that told you what "patterns" were needed on each level of the game. I memorized the patterns and actually became quite good at the game. That was after many "joystick blisters" though. I seem to remember something about the patterns changing for "fast games" or "slow games". That was a LONG time ago. Thanks for the memories!

  • @therealmonczak
    @therealmonczak 5 років тому +10

    Hey, so now I know how I behave. Great video!

  • @kilroy987
    @kilroy987 8 місяців тому

    This is excellent. If I ever feel compelled to code Pac Man, I'll absolutely come back to this video.
    I coded Gauntlet a few years ago, but I never really understood the rules for the point multipliers, how long they last, when each character will vocalize, the rules for the narrator, etc. so I didn't bother with those aspects.

  • @Mingura666
    @Mingura666 5 років тому +3

    "You're so stupid that even Clyde can catch you."