Jump to content
vdub_bobby

Pac-Man ghost AI question

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

[email protected]

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

[email protected]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

[email protected]

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

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

 

http://www.donhodges.com/how_high_can_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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Here is an excellent explanation of exactly what happens when the split screen occurs (and how to fix it):

 

http://www.donhodges.com/how_high_can_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

Share this post


Link to post
Share on other sites

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/how_high_can_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

Share this post


Link to post
Share on other sites
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/how_high_can_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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Thanks to everyone's comments, corrections and suggestions, there is an improved Pac-Man Guide available at: http://home.comcast.net/~jpittman2/ThePacManDossier.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

[email protected]

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...