MSPacman
Oldbitcollector (Jeff)
Posts: 8,091
I have been working on a MSPacman game in the "stars" thread
(with a lot of help from trodoss) and thought that it was far enough along to
give the game it's own thread...
* Mspac eats dots and power pellets
* Teleports now work
* Ghost change colors depending on mode
To do..
Baddie move logic..
Sound..
More levels
OBC
Edit: Later releases of the Mspacman project are deeper into the thread.
Early releases left for anyone following the project for educational reasons.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
Post Edited (Oldbitcollector) : 2/11/2010 2:38:30 PM GMT
(with a lot of help from trodoss) and thought that it was far enough along to
give the game it's own thread...
* Mspac eats dots and power pellets
* Teleports now work
* Ghost change colors depending on mode
To do..
Baddie move logic..
Sound..
More levels
OBC
Edit: Later releases of the Mspacman project are deeper into the thread.
Early releases left for anyone following the project for educational reasons.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
Post Edited (Oldbitcollector) : 2/11/2010 2:38:30 PM GMT
Comments
Here's the soundtrack and some example sound FX.
The replayer will turn into a very easy to use object eventually.
Btw, if you want you can exchange pacman.snd with any other Goattracker v2 song.
The replay routine isn't complete in any sense, so I can't guarantee that a random selected goattracker song sounds good.
[noparse][[/noparse]Edit:]·It looks like in LinkDemo_TV_002.spin, at around line 320, there is the following:
for now, change the line mask to %0000_0111<<24
I will work on a permanent fix and upload it.
@OBC,
Attached is a 'fixed' version of LinkDemo_TV_Text_004.spin that should resolve the initial artifacts being displayed when the driver starts.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Game(s) Mythic Flight
Utilities Font Editors (AIGeneric, Potato_Text, etc.)
Post Edited (trodoss) : 2/10/2010 4:06:00 PM GMT
@Karl,
See if this version works for you.· If not let me know and I will continue to work on this.
--trodoss
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Game(s) Mythic Flight
Utilities Font Editors (AIGeneric, Potato_Text, etc.)
I found a good description of the ghost behavior:
(post by cissao on YoYoGames.com)
----
A couple years ago some guys over at Atariage.com determined precisely what the ghosts AI is doing. This is not speculation. Two members, JamieVegas, and Dav dug through the code of Pac-Man and found out exactly what is going on.
Here is my compilation of info on the ghosts including translations of their japanese names:
---
Pac-Man Ghost AI
---
Red - Blinky: Oikake - "Akabei" (oikake-ru = to run down/to pursue/to chase down). Or of course the english "Shadow":
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.
---
Pink - Pinky: Machibuse (machibuse = performing an ambush). Or in english "speedy":
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 - Inky: Kimagure - "Aosuke" (kimagure = fickle/moody/uneven temper). Or in english "Bashful":
Inputs, are the square two tiles in front of Pac-Man, and the location of the Red ghost. 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.
---
Orange - Clyde: Otoboke - "Guzuta" (Otoboke = Pretending Ignorance). The nick "Guzuta" means someone who lags behind. Or of course "pokey" in english:
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.
---
Blue (edible) ghosts behavior
The blue ghost behavior is random in that it uses a random seed generator that is called every time that a blue ghost needs to make a decision. The generator generates an address within 0x0000 and 0x1FFF to read the last few bits of. These bits are translated into the direction that the ghost must first try. If it is a wall, the ghost then just attempts through the remaining directions in sequence. The random seed is reset at the beginning of every level or life. So it is the same for any given set of ghost positions and Pac-Man pattern.
---
Note: Each dot resides in it's own "tile" so 1 tile equals the distance from one dot to the next.
Info from AtariAge users: JamieVegas, Dav, Otoboke
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Game(s) Mythic Flight
Utilities Font Editors (AIGeneric, Potato_Text, etc.)
This is really excellent! Thanks for digging this up!
I'll probably start by working on a single ghost first, "Blinky" and get him working correctly, then go from there.
I opted to keep the initial ghost routines separated as I thought it might help with the different behaviors.
This will be interesting as I think this is my first time figuring out movement for multiple baddies.
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
No problem. Should be a lot of what you need. And, if you get stuck, I am sure there are quite a few people that could help.
Starting with one ghost at a time will make it easier.
If you would like I can change the "TV_Text" portion the driver so that it returns what 'type' of hardware it detects. Then the main program would not even need to be changed for keyboard, or later sound, before running.
@Ahle2,
The GoatTracker code looks (and sounds) great!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Game(s) Mythic Flight
Utilities Font Editors (AIGeneric, Potato_Text, etc.)
Perfect! Can you show me how to implement this on event demand?
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
Attached is another version, with the 'Start' returning the type of configuration, so that the correct keyboard setup is selected by the code.· If you have already made changes to the code, then just look at where the tv driver's Start method is invoked, and change the code there.· Other than that nothing really changed in that part of the code, other than the TV driver's names (see below).
I renamed the TV_Text driver to "Pacman_TV_Text" and "Pacman_TV," so that it better fits your project· ...I know, I know -- I should leave well enough alone [noparse];)[/noparse]· It is *your* project after all.
About the only thing that would be difficult to 'select' would be the NES gamepad configuration.· If I can come up with a good way of getting that to work (or if Baggers knows of a way) then that could be taken care of as well.
@JT_Cook:
Ha! I figured someone would be asking for that [noparse];)[/noparse]
[noparse][[/noparse]Edit:] Attached screenshot from Gear...not quite as·exciting as a screenshot of it·in OBC's arcade cabinet though·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Game(s) Mythic Flight
Utilities Font Editors (AIGeneric, Potato_Text, etc.)
Post Edited (trodoss) : 2/10/2010 11:42:18 PM GMT
Added Trodoss's video driver/detection setup. Works great here!
Blinky chases Mspacman - (Needs some work)
Blinky runs away when blue. - (Needs some work)
Ghosts flash before they change back to normal.
It's starting to feel "pacish" [noparse]:)[/noparse]
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
Looking "Pacish" for sure [noparse];)[/noparse]
The "flashing" animation that you added when the power pellet timer is running down is a nice addition.
Keep up the great work!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Game(s) Mythic Flight
Utilities Font Editors (AIGeneric, Potato_Text, etc.)
I get a picture for PacmanDemo_004a.zip, however the background is not stable, it's gray on top and black on the bottom
My Chameleon looks fine, so I will just configure the keyboard to use that
I will check into the timing and see if it needs to be adjusted for the Hydra. It sounds like a timing issue. I don't have a Hydra, so it is hard to tell just from the description. I know Hydra's occasionally need a "correction factor" for imperfection on the crystal(?), and I will see if the code is accounting for that.
It might be that Potatohead could look and see if there is something off in the timing that I am missing.
In the mean time, since you have a Chameleon (and it works, likely due to the the same crystal as the Proto/Demo and the same pinout), then I would say use that [noparse];)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Game(s) Mythic Flight
Utilities Font Editors (AIGeneric, Potato_Text, etc.)
Post Edited (trodoss) : 2/11/2010 5:07:48 AM GMT
Minor addition..
I liked the ghost flash timer routine so much I duplicated it to flash the power pellets.
No other changes for now..
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
I looked back at a driver that I know has worked on the Hydra (Bagger's version of the Spectrum TV driver), and compared the VCFG specified for the Hydra there to what was in the code.
It looks like "Chroma1" was off (set to 0 instead of 1), so it could have caused the issue. Not definitive, but a "best guess"
So, I have another version of the Pacman_TV_Text (change ref from _006 to the _007 in the main .spin file) that anyone with a Hydra can try and see if it corrects the issue. I changed the value in the HWDetect procedure:
in the code, params[noparse][[/noparse] 3 ] = pin group, params[noparse][[/noparse] 4 ] = VCFG, params[noparse][[/noparse] 5 ] = FRQA, params[noparse][[/noparse] 6 ] = DIRA
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Game(s) Mythic Flight
Utilities Font Editors (AIGeneric, Potato_Text, etc.)
Post Edited (trodoss) : 2/11/2010 2:39:07 PM GMT
another site to look at: home.comcast.net/~jpittman2/pacman/pacmandossier.html
The sections titled "Looking Ahead" and "Intersections" may help improve the ghost logic. Also, there is another set of detailed explanations on the ghost behaviors there.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Game(s) Mythic Flight
Utilities Font Editors (AIGeneric, Potato_Text, etc.)
I have to make a real object of the code first.
In this state it's not easy to incorperate into anything.
The final object will work something like this:
(The sound.tick method has to be called once every vbl)
If you want to play a sound FX:
If you want to restart the tune:
If you want to stop the tune:
If you want to use another tune:
Sound effects are done in goattracker like a normal instrument... the only difference is that they are called by the game code instead of the replay routine.
That is awesome! It will go a long way toward this project as well as the game kit I've got in mind!
@trodoss:
Another great reference!
Tell me, is it just the fact that I'm using an old NES controller or my code? For some reason the
movement doesn't feel quite right. Turning corners in the real MSpacman feels more fluid for some
reason that it does in mine. I might have to move this over to the arcade today and test it.
(I was waiting to move it until I could celebrate some working sounds from Ahle. [noparse]:)[/noparse]
Might have to hook up my Namco stick and play some real MSpacman today.
Edit: Ah ha! Mspacman keeps moving in the direction she is pointed until she hits a wall.
That's got to be part of it! (Never played a game just to analyze it. [noparse]:)[/noparse]
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
Post Edited (Oldbitcollector) : 2/11/2010 2:56:04 PM GMT
Right, in most Ms/Pacman games you keep moving after you push in one direction until you either change direction, or hit a wall. That is certianly part of it.
Another is that you are dealing with a 'fixed' grid, where as the other version(s) use a more 'fluid' (sprite-based) animation, so·those versions have the Pac·reacting 2/4 pixels 'faster' to your NES pad motions. That is not a huge issue, as most of the old 'arcade sticks' were not nearly as responsive as even the NES game pad. You are just adding "arcade realism," Right?· And, it dosen't have to be a·100% emulation to be a fun game·· Sometimes, being 'hung up' on certian (very small) details is what can kill a project.· Getting "close enough," and·continuing to make progress, is best.
Also -- Ghosts make decisions about their next move based on what is "in front" of them (that article does a good job of explaining). So, they will likely keep moving as well.· That is a little more "pacish-ism ism" (something).
[noparse][[/noparse]Edit:]·If I can get the lingering Hydra·display problem·"nailed down," I might start looking at <gasp!> adding PAL support (since it just supports NTSC right now).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Game(s) Mythic Flight
Utilities Font Editors (AIGeneric, Potato_Text, etc.)
Post Edited (trodoss) : 2/11/2010 3:27:02 PM GMT
I'm still wrapping my head around some of the requirements for baddie moving.. [noparse]:)[/noparse]
(The concept is still cooking in the mental oven, so to speak. [noparse]:)[/noparse]
While I'm hashing over movement rules for ghosts, I'm chasing down some of the more
nit-picky stuff in the game. (Easy stuff that I can knock out.) [noparse]:)[/noparse]
BTW: still working on your Zelda clone?
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
The original Zelda used a pretty involved map management scheme (using pattern reduction).· Trying to come up with a good (easy to understand) explanation of all that is taking some thought.· Implementing it·is not nearly as difficult.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Game(s) Mythic Flight
Utilities Font Editors (AIGeneric, Potato_Text, etc.)
If the above mentioned is not working any better for you, I have something to try (based on a suggestion from potatohead):
Try commenting out the following line in the Pacman_TV_Text driver:
This will help determine if the vsync timing is off.· It could either get better, or flicker horribly.·
Thanks!
--trodoss
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Game(s) Mythic Flight
Utilities Font Editors (AIGeneric, Potato_Text, etc.)
It should be easy to incorperate into your game OBC
Try to uncomment the three last lines in the main loop and see what's happens.
Looks like "pacman.sng" is missing from the archive.
I downloaded the old archive and attached.
--trodoss
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Game(s) Mythic Flight
Utilities Font Editors (AIGeneric, Potato_Text, etc.)
Is there a way just to play/replay just certian 'patterns' in the song? Didn't know if that would be easier for short segments, like the "start of game" music or the "death" music? Or, would you be better off as setting those up as their own "songs?"
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Game(s) Mythic Flight
Utilities Font Editors (AIGeneric, Potato_Text, etc.)
Of course, pattern start location and sub tune selection will be supported.
To be honest the replay routine isn't near being complete, but for simple music and sound FX it seems to work well.
I've attached the right version of pacman.sng
(Oops... I thought pacman.sng was in the archive ?)
Post Edited (Ahle2) : 2/11/2010 8:01:21 PM GMT
Those sound like it will be great! The ability to use an instrument as SFX will come in handy.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Game(s) Mythic Flight
Utilities Font Editors (AIGeneric, Potato_Text, etc.)
Just got a chance to try out your demo...
Extremely good stuff! Looking forward to being able to implement this!
Edit:
Grabbed the wrong version of the pacman.snd file! Big difference! Going in! [noparse]:)[/noparse]
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
Post Edited (Oldbitcollector) : 2/11/2010 10:42:23 PM GMT
Added Ahle's pacman sounds...
Ran into an issue.. Is there any way you can move the sound.tick clock onto another cog
or something? I ran into issues with my game loop being too slow to properly make
the WAKA WAKA sounds. The current version is acceptable at this level, but not perfect.
Perhaps a problem in my implementation?
Neat stuff.. Going to move 008 over to the arcade after a couple more hours of coding. [noparse]:)[/noparse]
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.