Not exactly AI, but a walking bot
by Luis Anton · in Technical Issues · 10/11/2003 (7:38 am) · 4 replies
Hi! I'm interested in simulating a street, with people walking arround. Thus, I don't need complex AI, just some waypoints for each person and the ability to dodge people. I've been looking arround, but as a newbie, I am quite lost. Is it possible doing it just scripting?
#2
The letters a-f are in the loop for 2. And i-ii are in the if in c.
10/11/2003 (11:50 am)
Oh crud.The letters a-f are in the loop for 2. And i-ii are in the if in c.
#3
10/12/2003 (9:35 am)
Eeeh, great, but that was not my question :) I didn't explain myself properly, and this may be the wrong forum. What I want to know is how to move something arround with torque without using the AIPlayer.cc and those things ;) Later on, after I get something moving around randomly, I'll implement the street...
#4
10/13/2003 (11:28 pm)
You can do it by deriving from ShapeBase... that's the simplest route.
Steve Fletcher
You could do something like this for each bot:
1. pick a point to go to
2. while I'm not there
a. if it's up from here, I want to go up
b. else if it's left from here, I want to go left
c. [right]
d. [down]
e. if there's someone in the direction I want to go, go back to 1
f. else go there
Now, that is going to kind of suck. The very best way is to modify it in the following way:
1. pick a point to go to
2. while I'm not there
a. if I don't know a path to get there, use A* to find a path
b. figure out which direction is next in the path
c. if there's someone in the direction I want to go
i) recompute path and try again
ii) if there's no path, go back to 1
d. else go there
Obviously, it's a bit more complicated then the pseudocode. But that's about right.
In practice, I've found that it's easier to just compute the path for the next few steps (well, as many as A* figures out quickly) and then recompute it with every step. This way, there's no points where the bot just stands there. The problem is that sometimes it makes some dumb little loops, but that should happen less often on newer computers.
I hope this helps.