Jump to content

Otoboke

Members
  • Posts

    4
  • Joined

  • Last visited

Otoboke's Achievements

Combat Commando

Combat Commando (1/9)

0

Reputation

  1. Just for clarity, you're talking about the post-energizer blue ghosts as they flee from Pac-Man here, and not the non-energizer Blue ghost known as Inky, correct? Otherwise, my analysis of Inky's AI code was WAY off! I tested it by playing through a few games, pausing periodically, and making sure the technique mentioned earlier accurately predicted Inky's turns though. I was satisfied after 20 consecutive predictions. Interesting analysis of the Ms. Pac "random home corner" trick, by the way. I haven't gotten around to looking at the Ms. Pac assembly yet. It does seem more like a thrown-together solution that happened to do the job, rather than a really elegant solution like what they were apparently trying for. Come to think of it, having every board start off with Blinky and Pinky running around like chickens with their heads cut off while the other two invariably go to the same corners is, almost literally, a half-assed solution. Too bad they were in such a hurry to get the Ms. Pac machines into the arcades.
  2. I believe you are right. Game designer Iwatani has said the hardest part for his team to get right was the ghost AI. Presumably they were endlessly tweaking the code for the ghosts and playtesting to see how it felt. Quirks like the "slides" were probably put in late in the process to give Pac-Man more of a fighting chance without going to the trouble of rewriting the ghost AI from scratch. The harder mod Midway put out, with the AI modifications on Pinky and Clyde discussed earlier in this thread, does indeed make the game more challenging. I find myself getting devoured by Clyde (Oh! the humiliation!) much more often in that version. The new AI is inferior in terms of making the ghosts interesting, however. Basically, Pinky and Clyde behave somewhat more like the red ghost. Boring! I am impressed with the elegant solution to the "patterns" problem that Ms. Pac-Man features. Randomizing the first two ghosts' movements for the first 7 seconds is enough to disrupt any large scale pattern the player would come up with, but then dropping those ghosts back into their normal AI afterward restores the element of skill to the game. Putting random elements into the ghost's permanent AI would have been a cop-out. I believe this is the mistake that many poorly designed Pac-Man clones make. The playability suffers. "Guzuta"
  3. Cool! That is an excellent illustration of what's really going on with that phenomenon. I'd be curious to play the game WITHOUT the AI override in those spots and see how much harder it makes it. I use those escape routes all the time in game play. It's worth mentioning that the ghost AI does NOT take the "slides" into account when a ghost is plotting a route to reach Pac-Man. Example: Blinky is at a decision point. His algorithm tells him to go north here (reducing the vertical separation between himself and Pac-Man). It would make more sense, and suit his "Shadow" character better, for him to go east, but he won't. Little does he know, the "slide" over the monster pen will force him to go all the way to the opposite side of the board. Sucker! Incidentally, for you devoted students of ghost psychoanalysis, if Pac-Man turns right here, Pinky will enter the tunnel. This absurd detour will keep him out of your hair for a while, and you can mop up that corner with only the much less menacing Inky and Clyde to worry about. Quick note to add: if a ghost's AI does not yield a decisive direction to head at a junction (e.g. Blinky reaches a spot where no direction he turns will reduce the parameter his algorithm is trying to reduce), the ghost's order of movement preference is up, left, down, right. I.e. he will go up if possible, left if he can't go up, down if he can't go either up or left, and right only if there is no other choice. An example of where this would happen in the illustration above is when Blinky finally gets over to the junction on the left side of the monster pen, while Pac-Man stays in the NE corner area of the board. Blinky is unable to reduce the horizontal distance between himself and Pac-Man (and remember that he is not "looking ahead" to realize that if he just kept going straight he could soon turn east under the monster pen... the ghosts do not assess their own future locations and turning possibilities when making decisions... they only look at the board at that exact instant). Blinky can't do a 180 and go up, so he does the next choice and goes left. It is possible to have fun with Clyde's "near" AI. If you stay near him, you can chase him from anywhere on the board to the lower left corner. While taunting Clyde like this gives me a guilty feeling - it's sort of akin to bullying Ralph Wiggum - it can be useful sometimes. Ah, Pac-Men can be so cruel at times... "Guzuta"
  4. Sorry for the possible breach of newbie ettiquette by jumping in at this point, but the topic is too dang fascinating to resist. Here is what I've been able to come up with about the ghost AI in the "attack" mode, to supplement what's in the "ghost psychology" link and the excellent observations you all have made. * Red ghost (Oikake): Input is Pac-Man's location. He doesn't consider which direction Pac-Man is going. He attempts to reduce the distance between himself and Pac-Man. He will turn in the direction that will immediately reduce whichever is GREATER of the horizontal distance or vertical distance between himself and Pac-Man. This usually has him tenaciously following Pac-Man, but will occasionally lead to a "stupid" choice (see illustration below). * Pink ghost (Machibuse): Input is four tiles in front of Pac-Man. Therefore direction Pac-Man is facing as well as actual location of Pac-Man determine Pinky's "target." Pinky attempts to home in on this target using the same logic as the Red ghost uses to home in on Pac-Man. This does indeed effectively "set up an ambush" if Pinky manages to get in front of you. At close range, the direction you face can mean life or death. If you're facing away from Pinky, he will chase you (his "target" is now in front of both you and him). If you face him or turn off to a side, he may turn away from you if that provides a shorter route to the target than running through you. Note that if the space four tiles in front of you is on the other side of a wall, he will go over there in preference to the side you are on. * Blue ghost (Kimagure): Inputs, as mentioned, are the square two tiles in front of Pac-Man, and the location of the Red ghost. (Edited out incorrect information here and replaced with correct information that follows-->) To envision Inky's target, draw a line from the Red ghost to the spot 2 tiles in front of Pac-Man. Now extend that line twice as far in the same direction and draw an "x" where it winds up. Inky wants to reach that "x." The fact that Inky's AI has two inputs instead of one makes his behavior more complex. On a fast-moving playing field with Pac-Man and the red ghost constantly changing position, that "x" can be jumping all over the place and sometimes Inky's behavior seems completely random - but it's not. No wonder his alternate name on the Puck-Man rom is "Stylist"! His regular name, Kimagure ("Whimsy") is also appropriate. It makes sense that the closer the red ghost is to Pac-Man (technically, the closer he is to the spot two spaces in front of Pac-Man), the more predictable Inky's behavior appears. Thanks to JamieVegas and Dav for getting this right the first time. Sorry I temporarily had completely wrong information on here! * Orange ghost (Otoboke): Has two modes, "near" (within 8 tiles of Pac-Man) and "far" (farther away than 8 tiles). In "far" mode, he heads toward Pac-Man using Blinky's logic. This gets him in the same general area of the maze, but then in "near" mode, he has a bizarre change of heart and decides to head for his corner of the maze (lower left island). Unless you happen to be in the lower left region, his about-face will soon take him into "far" mode again, and he will circle back toward your area. If you are in the lower left, he will circle his favorite island indefinitely. He will usually only "chase" you if you happen to be in the path between him and the lower left of the screen. Orange's "far" mode rarely leaves him doubled up on top of Red due to the fact that their home quadrants are on opposite sides of the map and "scatter" mode repeatedly separates them. Plus, red is usually close enough to you that orange will go into "near" mode if he gets close to red. Here's an illustration where all 4 of the ghosts' strategies work against them - Pac has been on the board long enough that there are no more "scatter" modes. The ghosts are in constant "attack." Since it's a cherry board, Red is not in accelerated "Cruise Elroy" mode, so all 4 ghosts are travelling at the same speed. This keeps Red just in front of Blue. The ghosts will go around these islands forever without finding Pac. Here's why - Red: When he reaches the SW corner of his island and could potentially approach Pac-Man by going straight rather than turning N like an idiot, his algorithm considers the following... his vertical distance from Pac is greater than his horizontal distance... turning N reduces that vertical distance while continuing W does not... therefore, go north! And around he goes again. Pink: As long as Pac stays still and doesn't turn W or S, Pink's target is a spot along the north side of the island. He'll go around and around forever, the shortest route to the target always being to keep going around since he can't reverse his direction. Blue: The spot two tiles in front of Pac-Man is approximately at the NW corner of the island Blue is circling. When Blue reaches the SW corner each time around, Red will always be just N of him. The line from Red to the spot two tiles in front of Pac-Man will point straight north. In fact, the "x" Blue is really aiming for would be drawn beyond the north end of the playing field (about where the "8" in the high score is). When this happens, treat the target as being at the extreme edge of the playing field. At any rate, Blue will head north. For hypothetical purposes, imagine what would happen if Red was situated where Pinky currently is when Blue reaches the SW corner. Now the line puts the "x" at a spot west of Pac-Man, Blue goest west, and Pac-Man very soon finds himself a very tasty morsel on Inky's dinner plate! Orange: As often happens, he's the weirdo of the bunch. At the NE corner of his island, he's in "near" mode. Yipes! Panic! Head for the corner of safety! (Go S.) But then when he reaches the next turn at the SE corner, he's removed enough to be in "far" mode. Loop back around toward Pac-Man (orbiting the small island is more direct than going around the sideways "T" island to orange's east). At the NW corner of the island, he's still "far," so he attempts to reduce the greater horizontal separation between himself and Pac in preference to the smaller vertical separation (i.e. he goes E instead of N here). But then he's back at the NE corner in "near" mode again. Yipes! Panic! Etc. Note that this "hold" will not work if there are still scatter modes left on the level, or if blue is not closely following red. If you set it up wrong, blue will invariably be the one that "breaks out" of his orbit and comes over to kill you. Try it! I believe the game will not allow the ghosts to go up the tunnels immediately above the monster pen and above where Pac-Man starts out even if the AI would otherwise direct the ghosts there. It's one of the easiest ways to shake Blinky if he's too close on your tail. I apologize for the length of this post, but I couldn't think of how to put it more concisely. In my opinion, the ghost AI was a key to this game's incredible success. Small sections of code (often 50 bytes or less) lead to complex phenomena that take paragraphs to describe and have players attributing it to the "personalities" of the monsters. It's what vintage gaming is all about. Those of you who have really analyzed the assembly code, you rock! If you've spotted errors in my analysis (I'm going more off playing experience than a solid understanding of Z-80 code), by all means put me in my place. Hope this helps- "Guzuta"
×
×
  • Create New...