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
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.
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.
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.
@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.
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.
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!
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!
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.
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 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
@@JoeMecca listening to all of this it sure sounds impressive lol, was curious what someone who sounds like they actually understand this stuff thought
@@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
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.
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.
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!
@@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.
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.
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.
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.
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.
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."
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.
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
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.
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.
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
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.
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!
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.
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
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.
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.
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.
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 👍
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 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.
@@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.
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
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.
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.
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
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!
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.
@@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 🤷♀️
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)
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. 😁
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.
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.
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 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.
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.
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.
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
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.
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
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!
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.
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
Thanks for the video! I always wondered how the ghost ai works.
Thumbs down for supporting Jack Conte's Internet censorship machine (i.e., Patreon).
Is this the same for Google pac-man or are they all just like blinky in that one?
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.
@@orangeparabola and king crimson nono yoku
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.
He may also get scared when Pacboy is about to get the big ball, but this was an idea about his personality
Clyde has commitment problems. He doesn’t wanna hurt anybody. Clyde is a precious lil cinnamon roll and is too precious for this world.
He’s just like me fr
I like how the animated series took how the ghosts in the game act and made it their personalities. Especially Clyde's
False. Cyde's Japanese name is Guzuta.
Saying Clyde's Japanese name is "otoboke" is like saying Clyde's English name is "pokey".
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.
Clyde is like "ok I made progress on my anxiety today, gonna go home and try again tomorrow."
@@ballisticboo7808 I'm making that the official cannon in my mind. Clyde is one of the best characters ever designed.
Clyde: I'm gonna get him, oh... nevermind.
this comment has 666 likes...
clyde is the accidental killer
Blinky is the chaser
Pinky is the ambusher
Inky is the trickster
Clyde is....just Clyde
@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.
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.
Clyde gives out Fresh Waters
ᗣ Shadow - "Blinky"
ᗣ Speedy - "Pinky"
ᗣ Bashful - "Inky"
ᗣ Pokey - "Clyde"
Right turn Clyde
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!
So you know his real channel is Dotsarecool, right?
@@clonefighter1996 "Real channel" lol ... and yes, and I referred to him as Dots in that comment.
This channel blows me away every time I watch a video... The clarity and insight is unbelievable
Reminds me of lemmino
Why is your profile pic a ruined epic face?
This is actually really interesting. One of those things I've always wondered about but never thought to look into
I'm actually actually.
@@Iliek what
@@xander0479 Actually.
i accidentally actually a whole actual accident
I'm actually extremely actual.
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!
Simple, yet brilliant!
Pac-Man is an impressive game.
Always simple when you know how.
I have wanted to make a pacman clone but I did not know how the AI worked. This was a big help.
Can I see it
PleaseDontWatchThese link us if you ever succeed
Hope it goes well!
Are you going to make sure your version also has the overflow bug?
If you make a pacman clone, this will happen in a different way:
The ghost will go to their nearest target
Blinky: Just TOUCH him Clyde!
Clyde: No, I don’t think I will.
Clyde doesnt refuse,hes just scared! =
@@ryangonzalez8121 Please tell me you're joking.
@@retrohero64butonhisphone80 no im not
@@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*
@@retrohero64butonhisphone80 Meh, that's really your opinion
Seeing the path predictions at the end was super interesting and cool! Another great video as always!
333Rich333 Personal Channel i could watch that all dat
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.
Its made of logic
Indeed
i wonder if there is an augmented reality app which overlays the best path to take....
Me at 11pm: “man I should probably go to sleep early tonight”
Me at 3am: “PAC-Man Ghost AI explained”
I was here at 1am today lool
Zigzagunz funny thing is that I made this comment at 3:00am
Me at 3am: *dEtAiLs Of My SeCtOrS eNeRgY sHoUlD bE bEtWeEn Me AnD mS pAc ThAnK yOu VeRy MuCh*
It's 11:01 for me
Am here at 12am oof
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
Is this impressive coding?
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
@@JoeMecca listening to all of this it sure sounds impressive lol, was curious what someone who sounds like they actually understand this stuff thought
@@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
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
Blinky: Chase
Inky: Close in
Pinky: Surprise
Clyde: *I'm just built different*
Clyde usually retreats if he sees u
@@jstarandomdude yea that's the joke
@abbiebabbles "I'm built different (incorrectly)"
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.
Well, yeah. That's the easy version everyone knows.
“Eh, I got close enough to catching that guy. I’m going home. Good night everybody.”
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.
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!
"Your videos make me fall asleep" sounds like the opposite of a compliment.
Me too. Either this or serial killer videos.
I love how at 18:29 Inky is like "Yeah, going far off the map will _probably_ help me catch Pacman."
He was thinking out of the box
@@why-ue1tu You're not a clown, you're the entire circus
@@why-ue1tu I am the 69th like.
@@why-ue1tu he's thinking outside of the house
Yeah, what if pac-man commits cheat?
Wow Thought it was:
Red: chase
Blue: trap
Pinky: guards power pellets
Orange: random
come to think of it, a ghost who guards the power pellets would be pretty neat
Loon She kinda does guard the pellets since you're usually going towards them and her strategy is to jump in front of you.
hmmm, i thought it was:
red: random
blue: random
pinky: random
orange: random
I thought it was...
All of them: chase
Andromedan Angel me to
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!
I think it's caused by arithmetic overflow.
@@Supermario0727 I mean, he does kinda explain it in the video
Amazing example of emergence. The rules are so simple, but the resulting patterns after figuring in pacman's movement are very complex.
Pac-Man is so amazing, even nowadays this game stuns me with it's AI.
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.
The original Pac-Man championship edition has the most developed and aggressive ghost AI
@@callinater6133 Isn't it identical to the original, just more dangerous with the longer hallways on the map?
@@corellioncrusaderproductio4679 technically you’re right but certain bugs that made the ghosts behave less intelligently were removed.
@@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.
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
🤣🤣🤣 I hate when Clyde gets me
@@chazlonewolff3320 You can see in his eyes, that he doesn't even know, what he's doin lmao
I literally will be in a arcade and be like fucking Clyde you lucky weak fuck 🤣
you're colorblind
@@ohwoah4324 Did you play on a 90's TV and on an actual device?
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
@@stayskeptic3923 Baby pacman's real dad.
@Like it says in the book. Too bad they didn't call Sue that in the second game, that would've worked perfectly!
No! This is Patrick!
Blinky: Hi I'm Blinky
Inky: Hi I'm Inky
Pinky: Hi I'm Pinky
Me: So you must be...?
Clyde:I like trains🚃🚃🚃🚃🚃🚃🚃🚃🚃🚃🚃
His parents were going to name him stinky, so yeah.. he lucked out.
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.
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!
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.
Because of Pac-Man, we're used to take AI path finding for granted in games ever since.
Nice video, as always!
Ah, another hoody.
Hello!
I'm quite curious how the ghosts react and determine which direction to go on level 256 (aka the killscreen).
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.
It's actually very easy to understand once you figure it out how either of these mechanics works.
They look at the absolute mess in front of them and charge forward and hope they don't become corrupted by it.
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.
The game has no boundaries at level 256, so the ghosts enter scatter mode and stay that way forever.
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."
Now I'm just imagining the other ghosts watching Blinky undergo a Super Saiyan transformation. Thank you for that mental image.
I always thought Blinky was the most vicious of the ghosts, and now I understand why.
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.
Pinky was always my mortal enemy. She's almost certainly killed me more than have any of the other ghosts. Blinky is probably second.
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
Ye , when I play pacman blinky and pinky are so aggressive and get me all the time. Inky and Clyde do nothing.
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.
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.
Pretty sure this is also why level 0x00 (256) has the garbage tiles beginning from the top right.
theundeadwolf0 Good point!
Clyde after almost getting to pacman: ight imma head out
Don't worry he has anexiety
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
Your voice is so soothing yet really intelligent, and makes everything so easy to digest.
I get chills every time I hear that intro jingle because I know I'm about to learn some cool shit.
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
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.
Inky gets me most often, too. His less predictable pathfinding is probably why.
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.
4:46 Pac-Man be like “OK WHOS BEEN MESSING WITH THE CLONE MACHINE?”.
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!
This is really well explained! I feel like I could make an open-source Pac-Man clone in a day now!
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!
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.
Yeah, once you enter patreon you automatically become a furry ^w^
@@ethohalfslab OwO
@@ethohalfslab :confused_staring:
@@adjacent_dollar >:3
@@ethohalfslabI don't get it...
I've heard so many times about the different ghost movements, but this is the best explanation by far. Fantastic stuff.
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
This is easily one of the best retro channels on UA-cam. Great content, man.
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.
Or... Leave it out to make things really annoying to pro players.
Can you do a video on Ms Pac-Man, and it’s differences to regular Pac-Man
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.
@@bigpboy1012 and level 257 is reachable
Fruits move.
You play as ms pacman
Pac man is dummy thicc
I like watching these to see how accurate the information is. This is the best one I've seen, nice video!
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.
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.
*enemy's
@@alkohallick2901 piss off.
What about enemies in 3d games like minecraft that have to pathfind around obstacles
Henry Zhang they don’t pathfind around obstacles they pathfind directly to the player if they are in range.
First time I am seeing Pythagorean's thereom being used outside of school. Pretty cool to see it used, and actually understand it
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 👍
Wow, simpler than I expected, but works really nice. Thanks for uploading this fantastic video.
Wow good job! Everything in the Pacman fonts too... Hats off to you.
Love your style. No annoying intros, outtros, music, or shilling. Feels like a it's out of a professional online course. Instant subscribe.
Request: Tim Follin's technique for making multi-channel music on a single beeper ZX-Spectrum.
This was so informative. I was able to beat pacman in 15 minutes with both eyes closed, lefty flip. Thank you.
Bet
Not only the AI's algorithm is really impressive for it's time, also this explanation and visualization is absolutely brilliant. Thanks!
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!
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.
5:21 what does this mean?
Regardless of whether they are in frightened mode or not? Isn’t that the point?
@@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.
@@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.
@@corellioncrusaderproductio4679 I thought so :)
@@TheRedSmarty thank you :3
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
The quality and precision of your animations never cease to amaze me!
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.
I absolutely adore all your videos.
My man, you deserve a Nobel Prize for figuring this whole thing out. Mad kudos to you!
I find it exceedingly unlikely that this entire video is original research.
How would Pac-Man avoid the ghosts if he was controlled by AI?
If you put AI in charge of all the movement you can do anything.
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.
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
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!
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.
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!
Did I just watch a 20 minute video about ghosts in a video game?
Yes, I did.
I'm not complaining..
This comment sounds sarcastic, but I genuinely found this video interesting.
20 minutes? I think it was 2... it could be 2 hours... !
@@Uchuma74 You can't hear my voice in a comment, you can only read it, so I may be serious....
@@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 🤷♀️
This, was a lot less complicated than I thought....
I now feel like a god at Pac-Man.
Pac-Man: is being chased by Pinky
Pac-Man: *Turns around*
Pinky: *Run away, frightened*
This brings up the question… what would happen if it was just you and inky in a level?
Pinky ambushes you
Blinky chases you
Inky helps blinky
Clyde is wondering if mayonnaise is an instrument
Great explanations and visuals as always! I kinda wanna randomly say that the tiny ghosts walking around is surprisingly cute u.u
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)
I think Pokey is another word for 'stupid'.
So Clyde is just called Stupid.
Maybe pokey as in he "pokes" at pacman by getting close then running off
@@pegleg759Late reply but this is a good one
Your animations are amazing and excellent at being illustrative of the points you're making. That animation at the end was super fun.
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. 😁
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.
You should do a video on the Gen 2 cries of Pokemon Gold and Silver.
Hah
Not necessarily since it still the same coding as Gen 1 since that games is base of, but with more cry noises.
Loved this video. It was rather fascinating actually. You also did an amazing job explaining everything with the animations!
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.
This video is why I love UA-cam. I had no idea the AI in Pac Man was so complex! Great video.
Beautiful video. New to the channel and, frankly, I'm obsessed! Keep up the insightful and brilliant videos!
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.
Big question: did they fix Pinky's offset values for Ms Pacman?
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.
Ms. Pac-Man was a mod and was stolen by Namco.
@@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.
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.
Last time I was this early Billy Mitchell still had credibility
I doubt you were around in the Stone Age
Who the heck is that and why has he lost credibility
@@WetDogSquad Pretty sure Billy Mitchell was recently caught faking scores.
Hahahaha billy
"Blinky chases, Pinky ambushes, Inky scares easily, and [Clyde/Sue] isn't very smart." - Namco Museum (GameCube version)
One question in mind: Could various Pac-Man rip-offs at that time -- when Pac-Man hit the scene -- implement these behaviors?
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.
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
ua-cam.com/video/yuVx4QI6fIM/v-deo.html
I shudder to think how much time went into programming for the video. Well done!
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.
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
this is one of my favourite videos on youtube i’ve come back here so many times
I would like to see you take on the ghost movement in pacman.exe
Its not official tho
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!
Hey, so now I know how I behave. Great video!
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.
"You're so stupid that even Clyde can catch you."