AtariAge Forums: Pac-Man ghost AI question - AtariAge Forums

Jump to content

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • You cannot start a new topic
  • You cannot reply to this topic

Pac-Man ghost AI question

User is offline JamieVegas Icon
Posted Sat Jul 7, 2007 10:28 PM


  • Icon
  • Combat Commando
  • PM this member
  • Posts: 9
  • Joined: 21-September 06

Quote

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.
0

User is offline Bryan Icon
Posted Sat Jul 14, 2007 8:57 PM

    • Cruise Elroy = 4DB7


  • Icon
  • Quadrunner
  • PM this member
  • Posts: 6,079
  • Joined: 12-June 03
  • Location: Port St. Lucie, Florida
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

This post has been edited by Bryan: Sat Jul 14, 2007 8:57 PM

0

User is offline supercat Icon
Posted Mon Jul 16, 2007 12:52 AM


  • Icon
  • Quadrunner
  • PM this member
  • View blog
  • Posts: 6,151
  • Joined: 01-June 05

View PostBryan, on Sat Jul 14, 2007 9:57 PM, said:

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.
0

User is offline Bryan Icon
Posted Mon Jul 16, 2007 6:37 PM

    • Cruise Elroy = 4DB7


  • Icon
  • Quadrunner
  • PM this member
  • Posts: 6,079
  • Joined: 12-June 03
  • Location: Port St. Lucie, Florida

View Postsupercat, on Mon Jul 16, 2007 2:52 AM, said:

View PostBryan, on Sat Jul 14, 2007 9:57 PM, said:

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
0

User is offline MikeDX_ Icon
Posted Tue Nov 27, 2007 5:05 PM


  • Icon
  • Combat Commando
  • PM this member
  • Posts: 1
  • Joined: 27-November 07
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.
0

User is offline Heaven/TQA Icon
Posted Wed Nov 28, 2007 9:00 AM


  • Icon
  • Quadrunner
  • PM this member
  • Posts: 6,341
  • Joined: 30-September 01
  • Location: Germany
i have to say...cool stuff guys... :)
0

User is offline xmila Icon
Posted Sun Jun 22, 2008 5:52 PM


  • Icon
  • Combat Commando
  • PM this member
  • Posts: 1
  • Joined: 22-June 08
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
0

User is offline jpittman Icon
Posted Sun Dec 14, 2008 10:25 AM


  • Icon
  • Space Invader
  • PM this member
  • Posts: 22
  • Joined: 14-December 08
  • Location: Atlanta, GA
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
0

User is offline kisrael Icon
Posted Sun Dec 14, 2008 6:54 PM


  • Icon
  • HMBL 2600 coder
  • PM this member
  • Posts: 3,937
  • Joined: 10-July 02
  • Location: Boston Burbs, MA

View Postjpittman, on Sun Dec 14, 2008 11:25 AM, said:

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?
0

User is offline jpittman Icon
Posted Sun Dec 14, 2008 7:21 PM


  • Icon
  • Space Invader
  • PM this member
  • Posts: 22
  • Joined: 14-December 08
  • Location: Atlanta, GA

View Postkisrael, on Sun Dec 14, 2008 7:54 PM, said:

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
0

User is offline vdub_bobby Icon
Posted Sun Dec 14, 2008 8:27 PM

    • Boom bam.


  • Icon
  • Quadrunner
  • PM this member
  • View blog
  • Posts: 5,637
  • Joined: 24-November 04
  • Location: Meeferino, US of B
Thanks for posting that; it is fascinating and a great read. Always interesting to see how opaque logic can be implemented very simply. ;)
0

User is online NE146 Icon
Posted Sun Dec 14, 2008 11:06 PM


  • Icon
  • Dumbass Atari Fan
  • PM this member
  • Posts: 11,072
  • Joined: 23-April 01
  • Location: Seattle, WA
Very nicely put together and a good read :) You should sell it :lol:
0

User is offline jpittman Icon
Posted Thu Dec 18, 2008 11:17 PM


  • Icon
  • Space Invader
  • PM this member
  • Posts: 22
  • Joined: 14-December 08
  • Location: Atlanta, GA
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
0

User is offline supercat Icon
Posted Fri Dec 19, 2008 11:00 PM


  • Icon
  • Quadrunner
  • PM this member
  • View blog
  • Posts: 6,151
  • Joined: 01-June 05

View Postjpittman, on Thu Dec 18, 2008 11:17 PM, said:

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?
0

User is offline PacManPlus Icon
Posted Sat Dec 20, 2008 6:51 AM


  • Icon
  • River Patroller
  • PM this member
  • View blog
  • Posts: 2,498
  • Joined: 19-June 02
  • Location: Long Island, N.Y.
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
0

User is offline jpittman Icon
Posted Sat Dec 20, 2008 7:14 AM


  • Icon
  • Space Invader
  • PM this member
  • Posts: 22
  • Joined: 14-December 08
  • Location: Atlanta, GA
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
0

User is online Bakasama Icon
Posted Sat Dec 20, 2008 9:51 AM

    • Fist of the McD


  • Icon
  • Dragonstomper
  • PM this member
  • View blog
  • View gallery
  • Posts: 807
  • Joined: 06-February 04

View PostPacManPlus, on Sat Dec 20, 2008 4:51 AM, said:

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.

This post has been edited by Bakasama: Sat Dec 20, 2008 9:53 AM

0

User is offline PacManPlus Icon
Posted Sat Dec 20, 2008 10:49 AM


  • Icon
  • River Patroller
  • PM this member
  • View blog
  • Posts: 2,498
  • Joined: 19-June 02
  • Location: Long Island, N.Y.
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
0

User is online Bakasama Icon
Posted Sat Dec 20, 2008 11:37 AM

    • Fist of the McD


  • Icon
  • Dragonstomper
  • PM this member
  • View blog
  • View gallery
  • Posts: 807
  • Joined: 06-February 04

View PostPacManPlus, on Sat Dec 20, 2008 8:49 AM, said:

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?
0

User is online Bakasama Icon
Posted Wed Dec 24, 2008 12:34 PM

    • Fist of the McD


  • Icon
  • Dragonstomper
  • PM this member
  • View blog
  • View gallery
  • Posts: 807
  • Joined: 06-February 04
Hmm, I just realized between rom fixes and the cheat.dat file, it's possible hack a game with cheats built in.
0

User is online NE146 Icon
Posted Wed Dec 24, 2008 12:47 PM


  • Icon
  • Dumbass Atari Fan
  • PM this member
  • Posts: 11,072
  • Joined: 23-April 01
  • Location: Seattle, WA
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
0

User is offline PacManPlus Icon
Posted Wed Dec 24, 2008 1:23 PM


  • Icon
  • River Patroller
  • PM this member
  • View blog
  • Posts: 2,498
  • Joined: 19-June 02
  • Location: Long Island, N.Y.

View PostBakasama, on Sat Dec 20, 2008 12:37 PM, said:

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...
0

User is online Bakasama Icon
Posted Wed Dec 24, 2008 6:58 PM

    • Fist of the McD


  • Icon
  • Dragonstomper
  • PM this member
  • View blog
  • View gallery
  • Posts: 807
  • Joined: 06-February 04

View PostNE146, on Wed Dec 24, 2008 10:47 AM, said:

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.
0

User is offline jpittman Icon
Posted Fri Dec 26, 2008 9:37 AM


  • Icon
  • Space Invader
  • PM this member
  • Posts: 22
  • Joined: 14-December 08
  • Location: Atlanta, GA
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
0

User is online Bakasama Icon
Posted Sat Dec 27, 2008 5:31 PM

    • Fist of the McD


  • Icon
  • Dragonstomper
  • PM this member
  • View blog
  • View gallery
  • Posts: 807
  • Joined: 06-February 04
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

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • You cannot start a new topic
  • You cannot reply to this topic


1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users