Re: TIB: AI


[Prev][Next][Index][Thread]

Re: TIB: AI




ok, for the moving aI, try this
Unit=O  Stone wall=|    and it's tring to get to X

O       |X
it moves toward x until
O|X
Ack, so now we look and see if there is a open side, wow there is one on 
the top, so move that way
O
    |X
ok, now continue moving to X
O
|X
it made it!
now with the moving ai, how I would do it is like this
x is my x location
y is my y location
dx is the etc.
dx-x=
say x is 5 and dx is 10
then the answer is 5
say i want to move 5 units to the right
lets do the same for y
dy-y=
let y=5 and dy=2
then the answer is -3
i want to move up 3, so now i start moving
check up&right if it is movable, if it is Move
else check up, if it is move
else check right, if it is move
else stop(Or look at other directions)

This help at all?
At 2/15/2001 11:16 PM, you wrote:
>Thanx for tha support. I've tried to mess round with tha random stuff, and it
>just dosnt work for a game like this. For instance, u never want a unit to
>move when its right next to an enemy! Also, if anyone has any pointers on a
>moving algorithim/program or knows any good examples, i would appreciate it.
>Like u know, from A to B, and stuff,with at least some simple logic on how to
>get round an object (and i know random numbers wont work there). Well,
>somebody help me out!
>
>Thanx!
> 
>
>  Stephen

----
Rob Smith
Rob's Quote of this Reset:
A government that robs Peter to pay Paul can always depend upon the support 
of Paul.
- George Bernard Shaw







References: