Jump to content

Photo

Pac-Man ghost AI question


89 replies to this topic

#51 JamieVegas OFFLINE  

JamieVegas

    Combat Commando

  • 9 posts

Posted Sat Jul 7, 2007 10:28 PM

I'd love to hear if they did an equally deep bit of ghost psychology for the recent Pac-Man CE on Xbox Live....


One would think they'd at least include a "classic AI" mode.

The differences in the "maze architecture" suggest that they've "revamped" the AI. Some of the more interesting "faux AI" tricks wouldn't work correctly in a huge 16:9 maze, nor would they work with mazes that greatly deviate from the interlocking architecture ("'T', 'L', and '+' based," for want of a better phrase.) Not to mention, "home corner mode" might not bode as well on maps that large.

#52 Bryan OFFLINE  

Bryan

    Quadrunner

  • 10,927 posts
  • Cruise Elroy = 4DB7
  • Location:Chesaning, MI

Posted Sat Jul 14, 2007 8:57 PM

Question for you Z80 guys...

Why does Pac-Man frequently use and a then sbc? Isn't sub easier if you don't want carry?

-Bry

Edited by Bryan, Sat Jul 14, 2007 8:57 PM.


#53 supercat OFFLINE  

supercat

    Quadrunner

  • 6,401 posts

Posted Mon Jul 16, 2007 12:52 AM

Why does Pac-Man frequently use and a then sbc? Isn't sub easier if you don't want carry?


There isn't a 16-bit SUB instruction. Thus, when using 16-bit math, one must use SBC. That restriction may have influenced some programmers even when using 8-bit math.

#54 Bryan OFFLINE  

Bryan

    Quadrunner

  • 10,927 posts
  • Cruise Elroy = 4DB7
  • Location:Chesaning, MI

Posted Mon Jul 16, 2007 6:37 PM

Why does Pac-Man frequently use and a then sbc? Isn't sub easier if you don't want carry?


There isn't a 16-bit SUB instruction. Thus, when using 16-bit math, one must use SBC. That restriction may have influenced some programmers even when using 8-bit math.


I guess that makes sense. I'm okay at reading Z80, but I'm not ready to speak it. :) Thanks!

-Bry

#55 MikeDX_ OFFLINE  

MikeDX_

    Combat Commando

  • 6 posts
  • Location:Earth

Posted Tue Nov 27, 2007 5:05 PM

I've found this thread whilst looking for some info on the pacman ghosts AI for my pacman-ce remake using SDL, aimed at linux primarily but obviously welcome ports to other platforms.

Just wanted to say thanks to those involved in pulling it apart, and a big thanks for the very description explanation of how the ghosts move.

Since there is no current doc on the movement of the ghosts in pacman-ce on the 360, I'll make mine use the "classic" AI of the ghosts...

I'll keep you all up to date, in another thread though as I dont want to hijack this one.

#56 Heaven/TQA OFFLINE  

Heaven/TQA

    Quadrunner

  • 11,197 posts
  • Location:Baden-Württemberg, Germany

Posted Wed Nov 28, 2007 9:00 AM

i have to say...cool stuff guys... :)

#57 xmila OFFLINE  

xmila

    Combat Commando

  • 1 posts

Posted Sun Jun 22, 2008 5:52 PM

also thanks very much for all this information.
i just want to say that i added some text about ghost ai on wikipedia based on this discussion. if you want to change it somehow feel free to do it on http://en.wikipedia.org/wiki/Pac-Man

#58 jpittman OFFLINE  

jpittman

    Space Invader

  • 25 posts
  • Location:Atlanta, GA

Posted Sun Dec 14, 2008 10:25 AM

Hi all,

Taking much inspiration from this and the Twin Galaxies forums, I have attempted to assemble and create the most comprehensive document yet on Pac-Man's gameplay design and ghost A.I. Although still a work in progress, 90% of what I set out to find has been tested, re-tested, and documented now, so I'd love to hear some feedback on what I've compiled so far. One of the more interesting quirks discussed in the text is how Pinky's target offset is actually different when Pac-Man is facing upwards than the other three directions. Also, I have codified the general logic for the ghosts' target-seeking A.I. into six simple steps - all others found online are mostly correct but fall apart in several cases. More revelations include: there are *two* Cruise Elroy modes per level, the correct speed values for Pac-Man and the ghosts per level and more.

Attached with this message is a .PDF of what I have dubbed 'The Pac-Man Dossier'. I hope you, the contributors to this thread, get some benefit out of this and I would appreciate any constructive suggestions or corrections!

Sincerely,

Jamey Pittman
jamey.pittman@yahoo.com

#59 kisrael OFFLINE  

kisrael

    HMBL 2600 coder

  • 4,073 posts
  • Location:Boston Burbs, MA

Posted Sun Dec 14, 2008 6:54 PM

Attached with this message is a .PDF of what I have dubbed 'The Pac-Man Dossier'. I hope you, the contributors to this thread, get some benefit out of this and I would appreciate any constructive suggestions or corrections!

Wow!
Unfortunately I have nothing to add, my interest in Pac-Man is much more casual.
It was interesting to see that the psychology was so laid out in the original Japanese names, and so much was lost in translation to the USA! I think most casual players figure out that Red is agressive, but might miss the other psychology unless they know to look for it?

But has anyone ever decompiled the Pac-Man rom, especially the behavior part, or is this all based on observation?

#60 jpittman OFFLINE  

jpittman

    Space Invader

  • 25 posts
  • Location:Atlanta, GA

Posted Sun Dec 14, 2008 7:21 PM

But has anyone ever decompiled the Pac-Man rom, especially the behavior part, or is this all based on observation?


Thanks for reading my document; I'm glad you enjoyed it! Pac-Man disassembly is available online and was used to determine and verify all the behavior documented in 'The Pac-Man Dossier'. Here is a link to an online version of the disassembly with some comments: Pac-Man disassembly

I have another version with many more comments I will eventually release as an Appendix, I imagine, but it's still a mess right now.

Regards,

Jamey Pittman
jamey.pittman@yahoo.com

#61 vdub_bobby OFFLINE  

vdub_bobby

    Quadrunner

  • Topic Starter
  • 5,832 posts
  • Boom bam.
  • Location:Seattle, WA

Posted Sun Dec 14, 2008 8:27 PM

Thanks for posting that; it is fascinating and a great read. Always interesting to see how opaque logic can be implemented very simply. ;)

#62 NE146 OFFLINE  

NE146

    Dumbass Atari Fan

  • 16,002 posts
  • Location:Seattle, WA

Posted Sun Dec 14, 2008 11:06 PM

Very nicely put together and a good read :) You should sell it :lol:

#63 jpittman OFFLINE  

jpittman

    Space Invader

  • 25 posts
  • Location:Atlanta, GA

Posted Thu Dec 18, 2008 11:17 PM

Hi again,

Thanks to everyone who responded both on and offlist; the suggestions were very helpful! As such, here is a updated version of the Pac-Man Dossier with better page graphics, a much-improved introduction, and a new chapter devoted to the "split screen" level (including a map of the hidden dots). As always, I encourage people to send in their feedback, corrections, and suggestions on the guide.

Regards,

Jamey Pittman
jamey.pittman@yahoo.com

#64 supercat OFFLINE  

supercat

    Quadrunner

  • 6,401 posts

Posted Fri Dec 19, 2008 11:00 PM

Thanks to everyone who responded both on and offlist; the suggestions were very helpful! As such, here is a updated version of the Pac-Man Dossier with better page graphics, a much-improved introduction, and a new chapter devoted to the "split screen" level (including a map of the hidden dots). As always, I encourage people to send in their feedback, corrections, and suggestions on the guide.


From what I understand, the kill screen isn't a result of the level counter itself overflowing into other areas of RAM. Instead, it's a result of two factors:

-1- The 'show fruit' routine works by showing a fruit, decrementing a counter, and seeing if the result is zero. If not, it loops and keeps drawing fruits until the result is zero. Thus, an attempt to draw zero fruits will draw 256.

-2- Since the game would malfunction if it tried to draw dozens of fruits, the game limits the number of fruits drawn if it's greater than seven.

The kill screen occurs because the game decides it's save to draw zero fruits (since zero is less than seven), but it actually ends up drawing 256.

BTW, on Ms. Pac Man, I once saw a copyright notice appear near the bottom the screen, obliterating some of the dots. The player and ghosts were able to pass over the copyright notice without impediment, but there were no dots there. After the player died, the copyright notice disappeared but the board was still short of dots and so the game was unwinnable. I think the player was on the second level--it certainly wasn't a level-256 killscreen, but it was an anomaly I'd never seen before or since. Has anyone else ever seen such a thing?

#65 PacManPlus OFFLINE  

PacManPlus

    River Patroller

  • 4,918 posts
  • Atari 7800 & NES Developer
  • Location:Florida

Posted Sat Dec 20, 2008 6:51 AM

Here is an excellent explanation of exactly what happens when the split screen occurs (and how to fix it):

http://www.donhodges...an_you_get2.htm

I love this site; he exaplains how other games work and their kill screens: Donkey Kong, Ms. Pac-Man, Galaga, Dig-Dug, etc.
He also explains how the bonus ship bug works in Defender, the 'Bonus Points' in Astro Blaster. Really cool stuff.

Bob

#66 jpittman OFFLINE  

jpittman

    Space Invader

  • 25 posts
  • Location:Atlanta, GA

Posted Sat Dec 20, 2008 7:14 AM

Wow! Great info on the kill screen - thanks very much! I have already corrected the the text. I'll post a newer version in the coming weeks once I get caught up with corrections and revisions.

You guys rock,

-Jamey

#67 Bakasama OFFLINE  

Bakasama

    Stargunner

  • 1,715 posts
  • Blizzcon '18, what a PR disaster.

Posted Sat Dec 20, 2008 9:51 AM

Here is an excellent explanation of exactly what happens when the split screen occurs (and how to fix it):

http://www.donhodges...an_you_get2.htm

I love this site; he exaplains how other games work and their kill screens: Donkey Kong, Ms. Pac-Man, Galaga, Dig-Dug, etc.
He also explains how the bonus ship bug works in Defender, the 'Bonus Points' in Astro Blaster. Really cool stuff.

Bob


I was wondering, the patch featured on that page, is it the same used in fixed Pac-Man rom floating around the internet?

As I recall, I think Ms. Pac-Man had a different kill screen at maze 125. The problem here is a little different. The appears maze with no dots.

Edited by Bakasama, Sat Dec 20, 2008 9:53 AM.


#68 PacManPlus OFFLINE  

PacManPlus

    River Patroller

  • 4,918 posts
  • Atari 7800 & NES Developer
  • Location:Florida

Posted Sat Dec 20, 2008 10:49 AM

I don't think so - I think the fix that is floating around is the one he mentions on that page where a hook was inserted and you repeat at level 255 (that one was out before he did the fix in that article).

You are right about Ms. Pac-Man, and he decyphers that one too:
http://donhodges.com...an_you_get3.htm

I kind of like that 'half-way' fix where the boards show up in different colors. I would have left that; something to look forward to while playing. :D

Bob

#69 Bakasama OFFLINE  

Bakasama

    Stargunner

  • 1,715 posts
  • Blizzcon '18, what a PR disaster.

Posted Sat Dec 20, 2008 11:37 AM

I don't think so - I think the fix that is floating around is the one he mentions on that page where a hook was inserted and you repeat at level 255 (that one was out before he did the fix in that article).

You are right about Ms. Pac-Man, and he decyphers that one too:
http://donhodges.com...an_you_get3.htm

I kind of like that 'half-way' fix where the boards show up in different colors. I would have left that; something to look forward to while playing. :D

Bob


I didn't know that Ms. Pac-Man had bugs with maze colors or it had three kill screens. I love that idea the you get random maze and dot colors at high enough mazes. It would make a long game more interesting. So does he mention how to keep the random maze colors but fixes the kill screens?

Since we're discussing Pac-Man kill screens, does any other Pac-Man game have them?

#70 Bakasama OFFLINE  

Bakasama

    Stargunner

  • 1,715 posts
  • Blizzcon '18, what a PR disaster.

Posted Wed Dec 24, 2008 12:34 PM

Hmm, I just realized between rom fixes and the cheat.dat file, it's possible hack a game with cheats built in.

#71 NE146 OFFLINE  

NE146

    Dumbass Atari Fan

  • 16,002 posts
  • Location:Seattle, WA

Posted Wed Dec 24, 2008 12:47 PM

All this talk makes me wonder how a game of Pacman would play if we had 4 Blinkys? :lol: 4 Pokeys? 4 Pinkys? etc.

Would probably make for an interesting hack :P

#72 PacManPlus OFFLINE  

PacManPlus

    River Patroller

  • 4,918 posts
  • Atari 7800 & NES Developer
  • Location:Florida

Posted Wed Dec 24, 2008 1:23 PM

Since we're discussing Pac-Man kill screens, does any other Pac-Man game have them?


Jr. Pac-Man has one as well. I have read (and was told) it also happens at 143, but trying it in MAME it happens to me much sooner (somewhere between levels 70-80).

Super Pac-Man does not have one. I've gone way beyond level 256 with the cheats in MAME (when I was making the 7800 version) and there were no bugs.

@NE146 - It might not be too fun... Once you group them together, it would be like playing against one monster. ;)

Might be interesting to try though...

#73 Bakasama OFFLINE  

Bakasama

    Stargunner

  • 1,715 posts
  • Blizzcon '18, what a PR disaster.

Posted Wed Dec 24, 2008 6:58 PM

All this talk makes me wonder how a game of Pacman would play if we had 4 Blinkys? :lol: 4 Pokeys? 4 Pinkys? etc.

Would probably make for an interesting hack :P


I would love to try to do that but all of my previous attempts of hacking the ROMs failed and ended up breaking the games. Fortunately I saved back ups.

Well, if the cheats are properly chosen, it can make a game more challenging and harder. Think of it, it possible to make a Pac-Man feel like it was written by Eugene Jarvis. There also the potential of making "trainer" ROMs but the problem with that is it just makes getting a high score totally pointless.

Fixing the bugs by using seems like a good idea but last time I checked using cheats disables the high score save so it kind of makes using the cheats to reach that new high score questionable. Which I would rather have hacked ROM.

#74 jpittman OFFLINE  

jpittman

    Space Invader

  • 25 posts
  • Location:Atlanta, GA

Posted Fri Dec 26, 2008 9:37 AM

Thanks to everyone's comments, corrections and suggestions, there is an improved Pac-Man Guide available at: http://home.comcast....cManDossier.pdf

Changes include:

- Hard difficulty info corrected in Appendix
- Ghost character attribs not confused for names
- 256th level bug explained correctly
- Spelling changes galore
- An expanded backstory on Toru Iwatani and Namco
- A much-improved redesign of the layout.

As always, all feedback is welcome - I want to make this document as comprehensive and accurate as possible.

Happy Holidays,

Jamey Pittman
jamey.pittman@yahoo.com

#75 Bakasama OFFLINE  

Bakasama

    Stargunner

  • 1,715 posts
  • Blizzcon '18, what a PR disaster.

Posted Sat Dec 27, 2008 5:31 PM

I've managed to get fix Pac-Man and Donkey Kong. They seem to be kill screen free and work like they're suppose to. I've looked the Pac-Mac Plus to see if I can fix that too and the ROM for that one is a bit too different for me to fix but it does have same problem as Pac-Man.




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users