Archived

This topic is now archived and is closed to further replies.

malpass

Pacman... Several questions

Recommended Posts

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?

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites
I''m now probably making a unique version, anywhere I can find the layouts of teh origional levels?, and whats the math behind the fruits appearing, is it the same place all the time at a random time or..?

Share this post


Link to post
Share on other sites

Here''s some code you can have a look at -

http://www.afrohorse.com/demos/pacmanhattan/pacmanhattan.html

It''s a pac-man game I did a while ago, the ghost have different characters and get smarter the further into the game you play!

There is a design doc on there too, so you can see the details of how it all works...

Hope that helps,

=============================
All Animals should have afros
http://www.afrohorse.com
=============================

Share this post


Link to post
Share on other sites
quote:
Original post by malpass
I'm now probably making a unique version, anywhere I can find the layouts of teh origional levels?, and whats the math behind the fruits appearing, is it the same place all the time at a random time or..?


As krikd stated you can find that info on the webpage I pasted in my post. But, I would use this only for ideas - you should really come up with your own designs that have unique challenges. The more you understand about the game, the better you will be able to design levels. For instance, take a look at the bottom row in the original pacman level - most people don't realize just how long that corridor is from one intersection to another - it is very easy to get trapped in it. The same thought goes for bonus icons - use your imagination and come up with something unique, perhaps something better than the original.

Good luck!

Jason Doucette
www.jasondoucette.com

[edited by - Jason Doucette on January 22, 2003 11:14:17 AM]

Share this post


Link to post
Share on other sites
Great. The ghost AI shouldn''t be too hard. This is where you can really make your game unique. Remember that the ghosts should not be TOO smart (unless your pacman is really fast) otherwise the game will be too hard and frustrating to play. In fact, your AI should be programmed to make them dumb sometimes.

One interesting note about the original is that the red ghost (the smartest of them all) actually increases in speed with X number of dots remaining (X starts at around 20, and increases every level).

Jason Doucette
www.jasondoucette.com

Share this post


Link to post
Share on other sites