Simplistic AI movement (pong++) help!!

This is a discussion on Simplistic AI movement (pong++) help!! within the C++ Programming forums, part of the General Programming Boards category; Hi! I'm working with Visual Studio 6.0 and I can't figure out how to make an AI character move around. ...

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    11

    Simplistic AI movement (pong++) help!!

    Hi! I'm working with Visual Studio 6.0 and I can't figure out how to make an AI character move around. This is for an RPG type game. I want my character to walk around in a rectangular area and pick up things (seashells on a beach). She has to recognize the seashells and stop for a second to pick it up. Then, after a few more seconds, she should continue on in the direction she was going in until she reaches the edge of the area and starts to walk back.

    Where I am at:
    I've recently written a working version of the game pong so I understand the basic programming involved making the ball move. My problem is when the character stops to pick up a seashell. How does she know where she is going?

    I'm using TIMERS too which can be confusing. Can I use two of them for this?

    In general: Can TIMER_ONE initialize TIMER_TWO at a certain time and then at some point I kill TIMER_TWO and start it all over again?

    I know I'm asking a lot of questions...
    Any help would be greatly appreciated!


  2. #2
    Registered User
    Join Date
    May 2006
    Posts
    903
    If the destination is known you can use the A* algorithm to compute the most efficient path and if it is not you can define patterns (e.g. down all the way, move one step to the right then all the way up ...)

  3. #3
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    How did she know which direction she was going in the first place? You should be able to separate out "is this character moving" from "which direction is this character moving in".

  4. #4
    Registered User
    Join Date
    Sep 2005
    Posts
    11
    Hi, thanks for the replies!

    I think I got it. I wasn't asking myself the right question 'tabstop'.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple space combat AI
    By VirtualAce in forum Game Programming
    Replies: 5
    Last Post: 01-05-2009, 11:54 PM
  2. chess ai contest
    By Raven Arkadon in forum Contests Board
    Replies: 7
    Last Post: 07-09-2005, 06:38 AM
  3. Pong AI?
    By wuzzuppy_123 in forum Game Programming
    Replies: 2
    Last Post: 07-01-2005, 02:07 PM
  4. Game Design Topic #1 - AI Behavior
    By TechWins in forum Game Programming
    Replies: 13
    Last Post: 10-11-2002, 10:35 AM
  5. Technique of all board-like games?
    By Nutshell in forum Game Programming
    Replies: 28
    Last Post: 04-24-2002, 08:19 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21