Thanks for all the feedback Robert and Jeff!
Darn, I'm really depressed that there are bad bugs showing up in the field, This thing ran at a party on a NTSC machine with a fair amount of strangers playing for over 4 hours and nothing bad happened, so I 'thought' it was safe to let out. If anyone has any info on these please send them to me and I will try to find them. I have a feeling I'll have to clean the source up and get it out in case better minds are willing to take a look if there is enough interest. I can't seem to reproduce them. Where did the 'ghosts' escape the maze Jeff? Is this the same thing BeamRider sent a video of?
Let me see if I can make an action item list from some of Robert's feedback, as well as ramble with a few answers:
I shamelessly tried to borrow as much as I could from the amazing Pacman Dossier by Jamey Pittman. Maybe we need to change some of the interpretations for better gameplay. Here is a link to the Dossier:
https://home.comcast.net/~jpittman2/pac ... ssier.html
In Panicman:
the red ghost is Blinky
cyan is Inky
green is Pinky
and purple is Clyde.
I tried to copy 100% the AI description in the dossier. This included the scatter/chase/scatter timer that the game has. Note that scatter is not the same as frightened mode. For example: the ghosts start in scatter mode for 7 seconds, then chase you for 20, then scatter for 5 , then chase for 20, then scatter for 7. Then they enter a huge chase period of over 17 minutes. Whenever the ghosts switch between scatter/chase modes they reverse directions. They also switch when frightened. This does answer the question of if the 'crazy Ivan' reverse directions is timer based -- however it is like the arcade I think. Maybe I need to play the arcade again and make sure they really do all switch at once.
I tried to implement the algorithms that the Dossier states for each ghost. I calculate euclidian distance to the ghost's 'target tile' from pacman and then make turn choices based on that. Inky is complicated, as noted in the Dossier, as he uses a moving vector between both Blinky and Pacman to generate his target tile.
There is a 'panic room' zone in the real pacman. It's on the right hand side of the first T below the ghost box. When I first started playing Panicman I noticed these somewhat bizarre patterns the ghosts would do, then I would play Pacman on MAME and sort of notice the same behavior. At first I was going to try to code up the AI accurately enough that the same patterns would work on this game that the arcade has; however, I became convinced that was a little more scope that I should be trying to take on at my current level. Many of the same play 'techniques' do work though. For example: Pinky tracks Pacman by looking to navigate to a 'target tile' that is four character cells in front of Pacman. If you are playing a game of chicken with him down a hallway, you can headfake him, and he will turn in the direction of your headfake ( if he can ) just like in the arcade. I do think I ( unintentionally ) changed the order of turn preferences -- that is, that order in which available compass moves ( N,S,E,W ) are considered at an intersection where the AI 'score' of the best move is the same. I wonder if this created more than the 1 known 'panic room' that the arcade has. There are probably some bugs in the implementation of the ghost AI compared to the Dossier and I should try to go over them with a fine tooth comb as time permits.
I agree the ghosts would benefit from some/any kind of effort to reduce the 'bunching up'. I will play with this. The ghosts do have the ability to each have a different speed; however, they are all set to the same speed right now. They run at 90% of Pacman's speed until the first difficulty increase at which point they run the same speed as Pacman, and then at the next difficulty increase they go to 100% speed while Pacman always stays at 95%.
Blinky is the exception of course, as noted in the Dossier. There are two points during the maze where he gets an increase in speed ( up to 100% ) and they are based on dot consumed count and also correspond with the increase in the noted annoying siren sound pitch.
I too thought the game might be a bit easy -- my playtester/audio engineer Jeff convinced me to tone it down a bit for the retro game party that was its first major playtesting. The game basically gets harder by:
a) reducing power pill 'frightened' time
b) reducing the amount of time ghosts are in 'scatter' mode such that they are chasing you most of the time ( see the Dossier ) and
c) making all the ghosts faster.
I believe the skill level increases happen every three levels right now. We nicknamed this event the 'Agonizer' in the code, after the Star Trek original series episode "Mirror Mirror" where people were sent to the 'Agonizer' booth. Thus, since the 'Agonizer' only runs every three cleared mazes you would have to be on the sixth cherry to even have the ghosts be faster than pacman.
I also took out the code that 'decreases' the scatter time. I think maybe I should move the 'Agonizer' to increase the difficulty every 2 cleared mazes and re-implement the decrease in scatter time? That would have the effect that after the 4th level there would only be 3 seconds of 'scatter' time at the start of a level instead of 7 seconds, and by the sixth level the ghosts would pretty much be in 'attack' mode all the time. Just a note again ( since the terms are similar ), scatter is not 'frightened' time, it's simply a period of time that ghost aren't running their attack AI ( see the Dossier ).
What is interesting to me is that if I play the game for points, and try reasonably hard, I seem to get about the same score as in the arcade. I top out around 35,000, although the arcade seems a lot harder to me. A big part of that is the speed of the arcade which gives you less time to plan your moves. I DID work on that, and I have good news in that I have the game running at a full 60 FPS ( 50 PAL ) now, but I'll have to slow it down a bit from that as it's almost too fast at that frame rate imho. The speed increase alone should make the game harder.
I would like to add the other fruit graphics and the only reason I didn't was I ran out of memory
. I've since managed to shrink the executable a bit so I will try to add them.
The weird maze shape: Hmm, well, that was an interesting story. If one really tried to capture the dimensions of the Pacman maze onto the 23x22 screen, then the whole maze should be narrower by 3 characters based on my calculations. I started making a version of the game with this narrower maze but it was requiring more work than I expected at the time, and I felt bad that the ghost box would have all the ghosts bunched right next to one another since it would only be three character cells wide. Here's the maze representation that my perl script reads in to generate the compressed byte sequence for the maze in the executable -- there is the current version and the 'narrower' version I was working on.
current:
Code: Select all
/=========T=========\
|.........|.........|
|*/\./==\.|./==\./\*|
|.LR.L==R.v.L==R.LR.|
|...................|
|.[].^.[=T=T=].^.[].|
|....|...| |...|....|
L==\.}=] L=R [={./==R
|.| |.|
===R.v /=]=[=\ v.L===
. | | .
===\.^ L=====R ^./===
|.| |.|
/==R.v [==T==] v.L==\
|.........|.........|
|.[\.[==].v.[==]./].|
|*.|...... ......|.*|
}].v.^.[=T=T=].^.v.[{
|....|...| |...|....|
|.[==-=].L=R.[=-==].|
|...................|
L===================R
narrower:
/========T========\
|........|........|
|*/\./=\.|./=\./\*|
|.LR.L=R.v.L=R.LR.|
|.................|
|.[].^.[=T=].^.[].|
|....|...|...|....|
L==\.}=] v [={./==R
|.| |.|
===R.v /]=[\ v.L===
. | | .
===\.^ L===R ^./===
|.| |.|
/==R.v [=T=] v.L==\
|........|........|
|.[\.[=].v.[=]./].|
|*.|..... .....|.*|
}].v.^.[=T=].^.v.[{
|....|...|...|....|
|.[==-=].v.[=-==].|
|.................|
L=================R
The weird maze piece was my concession to the fact that I felt the hallway down at the bottom was too long. If you are running down the hallway there was no 'escape' route if the ghosts were chasing you. I felt that shortening the hallway helped make it a bit easier to escape capture. It's interesting to note according to the dossier there are some zones in the maze that ghosts are forbidden from going "up". I didn't implement this, and I would like to. One area is above the ghost box, they can't turn up in the Arcade. It definitely makes it easier to clear dots from there if you have just eaten a ghost, they can't so easily make a beeline for you.
Ha, yes, the last dot bug! ... it's uh, in my bug database, I just haven't fixed it yet. I don't suppose I could try to pass that off as a feature? lol.
The ghost flashing: Yes, they need to flash more. I was out of memory at the time I coded that, and I am ashamed to admit I just tested bit 2 of the power pill countdown byte to make the flash. Not very nice
I will come up with a better implementation that makes more flashes. They are actually documented how many times they are supposed to flash in the dossier, so for maximum accuracy I should try that.
I wasn't sure what you meant by the input buffer and additional iterations. Did you mean that the sprites should be able to move closer to the walls? I guess I can't fix that since the sprite engine can't cross into that character cell. I did try to implement the cornering advantage that Pacman has per the Dossier .. he can start turning 1 pixel before the ghosts can. It does seem to help evade the ghosts like Blinky, especially when he's in his 'Cruise Elroy' mode as the Dossier refers to it.
Now that we are finally leaving the deep freeze here in the Northeast, I won't have quite as much time, as the VIC is a sort of 'winter' hobby for me .... but
Conclusions:
1. bugs. I will try to fix, but I am not able to reproduce yet, any help or hints on how to cause are appreciated.
2. speed up the game. I have a version that can run at the full frame rate I am working on!
3. add an option to turn off the siren
4. add more fruit icons
5. try to reduce ghost clumping ( or at least mitigate the appearance )
6. double check ghost AI matches the Arcade implementation as defined by the Pacman Dossier ( why are there so many 'safe spots'?? )
7. ghosts should flash more
8. make the last dot dissappear
9. high score indicator
Thanks so much. I am blown away by this community, I wish I could have known a place like this in the 80s.