Thread: the smart creatures in pacman game

  1. #1
    Unregistered
    Guest

    Question the smart creatures in pacman game

    hi;

    i would like to learn how the smart creatures can be created?
    simply i just wanna learn the mantality of the algotihm that can provide the movements of creatures as a smart creatures
    thanks....

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    23

    This is my guess

    Hey,
    Just thinking about it.. dumb creatures.. they would move to a randomly generated position.

    as the creatures get smarter.. they would move to a randomly generated position within a certain area around pac man.

    You could even have them moving to a square you predict pac man will head to. (eg 3 squares directly in front).

    you could go so far as to have all the creatures working together.. each one heading to squares that pacman could head for.

    and if your really keen you could work out where pac man is.. which square have already been cleared.. and where the creatures are at that time.. to guess which would be the best direction for pac man to go and then have the creatures move into squares to counter that.

    but then again, that could take a lot of work.
    ActionMan

    "THE DAY IS MYNE!!!!
    I'll take famouse titties for $400"
    -Sean Connery, Saturday Night Live

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    752
    To give the game some tension, some clever AI was programmed into the game. The ghosts would group up, attack the player, and then disperse. Each ghost had its own AI. Blinky chases Pac-Man, Pinky is positioned a few dots in front of Pac-Man's mouth. The others move randomly.
    The ghosts aren't really that intelligent... I'm pretty sure that it could be coded so that 2 or 3 ghosts would be enough to stop the player every time... of course, that wouldn't be fun...

    When it comes to chasing something, there isn't much to program unless you want to make the AI units actually cooperate with each other (in which case it might be a good idea to not give the units their own AIs). There's only three things they can do... either they move randomly, they move where the player is, or they move where the player is going to be.
    Code:
    if (enemy.x > player.x) moveLeft;
    if (enemy.x < player.x) moveRight;
    if (enemy.y > player.y) moveDown;
    if (enemy.y > player.y) moveUp;
    That's all there is to the second case, chasing the player.

  4. #4
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    A logic system where if the ghost "see" you they follow combined with
    one ghost which trys to guess where you will go next, another ghost
    which will follow you dead on and so on. In the original game they
    also arranged the attacts in waves so that the player gets a short
    rest in between.

  5. #5
    Registered User
    Join Date
    Sep 2001
    Posts
    164
    Why not attach a Neural Net to them right away!?
    // Gliptic

  6. #6
    Frustrated Programmer :( phantom's Avatar
    Join Date
    Sep 2001
    Posts
    163
    The very first pac-man (I am not going to reveal my age ) had the ghosts going in a set pattern so it needed no AI.
    There are whole books written on AI and the algorithms that are needed. Just remember the game needs to be fun so don't have a deadly AI, you must give it 'wrong' orders some of the time.
    My site to register for all my other websites!
    'Clifton Bazaar'

  7. #7
    Unregistered
    Guest
    Alright here's the deal: no algorithm
    As the programmer you know where pacman is at all times. SOmewhere in your program the position is declared. That's all you need. Decide how they move-should they move randomly closer and farther to pacman? should one always be on pacman's tale? It's relatively simple especially when you consider (as I do) the vast greatness of PacMan. In my opinion, PacMan has the best possible AI available for that game. And it's amazingly easy.

  8. #8
    Registered User
    Join Date
    Sep 2001
    Posts
    412
    QuestionC posted the "real" algorithm for the ghosts, at least the one in the versions of the game I've seen. It acts to minimize the distance between itself and PM.

    This, however, could get "stuck", but, because PacMan can't stop moving, it will also always move.

  9. #9
    Registered User
    Join Date
    Oct 2001
    Posts
    22

    wrong...

    "The ghosts aren't really that intelligent... I'm pretty sure that it could be coded so that 2 or 3 ghosts would be enough to stop the player every time... of course, that wouldn't be fun... "

    Not true. Each ghost had it own specific goal. One ghost was supposed to corner you whiel another 2 came in from the sides. It wasn't 'random' movement. Program your own pacman and you will see.

    *just because it seems random doesn't mean it actually is*

    same thing for tetris attack. the pieces coming up from the bottom appear to be random. as a matter of fact they are calculated based upon a number of different variables.

    -Vulcan

  10. #10
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    While that's true I believe in the concept of the computer not cheating as that makes it more interesting.

    There's some article where one of the lead programmer
    describes some of what he did.

  11. #11
    Frustrated Programmer :( phantom's Avatar
    Join Date
    Sep 2001
    Posts
    163
    Remember that a computer doesn't know how to cheat or even what cheating is, it all comes down to the programmer. I played worms for the first time tonight and what is stopping the computer worms from succesfully hitting each time? The programmer must make the game fun.
    My site to register for all my other websites!
    'Clifton Bazaar'

  12. #12
    Frustrated Programmer :( phantom's Avatar
    Join Date
    Sep 2001
    Posts
    163
    >>There's some article where one of the lead programmer
    describes some of what he did.

    Have you got the address of the article? I for one would like to read it. If you can't remember where it is do you mind writing a quick overview of the article?
    My site to register for all my other websites!
    'Clifton Bazaar'

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Open-source Game Project
    By Glorfindel in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 03-24-2009, 01:12 AM
  2. 20q game problems
    By Nexus-ZERO in forum C Programming
    Replies: 24
    Last Post: 12-17-2008, 05:48 PM
  3. Try my game
    By LuckY in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 09-15-2004, 11:58 AM
  4. HELP!wanting to make full screen game windowed
    By rented in forum Game Programming
    Replies: 3
    Last Post: 06-11-2004, 04:19 AM
  5. Game Design Topic #1 - AI Behavior
    By TechWins in forum Game Programming
    Replies: 13
    Last Post: 10-11-2002, 10:35 AM