Pacman... Several questions

Started by
14 comments, last by malpass 21 years, 2 months ago
OK, first, how do I have bitmaps as resources, like icons, so I don''t need them extrenal, I know how to get them as a resource with an ID, but then how do I load them into HBITMAPs. 2. I downloaded FMod from www.FMod.org, to play sounds and it plays really bad music, plus if a have several FMod variables and init each one with a different sound, then call just one of their PlaySound() variables, it plays every sound loaded even in the different variables, why? 3. How do I load and save data (I want it in an array basically) as XOR or so it can''t be editted by just opening the external file. 4. How do I go about the ghost AI for pacman?
Advertisement
The first 3 questions should be asked in another forum, I believe.

#4. make all ghosts move in their current direction until they meet up to an intersection (i.e. a place in which they can go in another direction). Never make them go in the opposite direction that they were just moving. If there is only 1 other direction, make them go that way. If there is a choice of 2 or 3... this is where A.I. comes into play. This is where you can get creative. It doesn''t take much to make them work well... in fact, if the ghosts are all too smart, then the game isn''t fun.

Jason Doucette
www.jasondoucette.com
Jason Doucette / Xona.comDuality: ZF — Xbox 360 classic arcade shmup featuring Dual Play
ye, i was thinking exactly the same, I was gonna make then go in a direction then when they meet a corner scroll along each until they meet a wall, if pacman is in one then go that way, else random. I was thinking I should make them predict 1 corner ahead to make them at least a little smart.
I also managed to save load the levels as classes to there totally uneditable from outside users and i''v fixed FMod, so theres only 1 question left
I found I got better results if I make the ghosts constantly find the shortest route to pac-man per every square.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"If it wasn''t for C, we''d be using BASI, PASAL and OBOL."
- Albert Einstein
With love, AnonymousPosterChild
wont that make them like little homing missiles always getting u within a small time?
Ummm, there is actually different AI for each of the ghost.. I read it somewhere, 1 ghost actually goes away from you, another tracks you down, while the other 2 are more random. I''m not exactly sure of all this, but I know I have read this somewhere on a newsgroup



Please visit Turt99 Productions
FOLLOW ME ON TWITTER OR MY BLOG
ye, i think the red one tracks u down (shadow), the pink runs, and 2 others orange and another are random, so theres only 1 real AI for the red, then inversed for the pink, and non other that random for the others. Anyone no the colours of the ghosts and how many there are ?
If I remember correctly:

Red (Shadow) : Tends to follow your movements exactly
Pink (Speedy) : Takes shortest path towards you
Blue (Bashful) : Tends to turn a corner away from you if you are facing him
Orange (Clyde) : More random, generally turns corner in direction that heads him towards you, which may not always be the best path

Something like that.

At indeterminate times, all the ghosts split off and head to a different corner, then resume the chase. They almost always go to a corner the moment they emerge from their center box before pursuing Pacman.
It's not what you're taught, it's what you learn.
quote:Original post by Turt99
Ummm, there is actually different AI for each of the ghost.. I read it somewhere, 1 ghost actually goes away from you, another tracks you down, while the other 2 are more random. I'm not exactly sure of all this, but I know I have read this somewhere on a newsgroup

Yes, and this is what I would do as well. I didn't mean to imply that each ghost should be the same. Take a look at this page: http://jongy.tripod.com/SoundofEating.htm (beware of pop-ups!) for some information on how the original PacMan ghosts act. Note that, not only do they think differently, but there are things such as 'scatter mode' in which they all cease chasing PacMan at the same time for a short amount of time.

I would recommend against computing shortest path per square - the ghosts appear to be too smart when they change direction in the middle of a corridor. And they will be too smart if they know the shortest path - so you'd better hope your pacman is faster than them, and on a bigger board if you plan on implementing this. It is up to you how the play of the game is going to be... are you looking to make a duplicate of the original or your own unique version?

Jason Doucette
www.jasondoucette.com

[edited by - Jason Doucette on January 21, 2003 10:55:25 AM]
Jason Doucette / Xona.comDuality: ZF — Xbox 360 classic arcade shmup featuring Dual Play

This topic is closed to new replies.

Advertisement