I have a situation where there are numerous objects that need to wander
about on a 2D plane. The objects should avoid certain areas in the plane
and should also eventually make their way toward a desired goal
Where can I find resources that would help with implementing this type
Please log in or register to post a reply.
First of all, google for “pathfinding” and in particular “A* search”,
which is very handy anytime you need things to move around and avoid
If you want things to wander randomly, you could try an approach like:
pick a random point within a certain radius (excluding points in
obstacles) and path to it. When you get there, pick another random point
To make them gradually head toward a goal, every few iterations you
could substitute the randomly chosen destination with the goal itself,
but then only let them travel a short distance before re-randomizing the
goal point. Depending on the obstacle geometry there’s no guarantee they
wouldn’t get stuck in a steady state far from the goal, though.
I have the basic wandering around in a random way figured out.
I have tried using Google to find something that would be useful, and
have not run across anything. That is why I’m now posting to this forum.
I don’t think I need to resort to something as complicated as A* to
solve this problem. I’m not interested in finding an optimal path from a
source to destination.
I’m hoping to find something dealing with areas that can attract or
repel as object move close to those areas.
a* isnt complicated.
if you still dont want it, why not just weight their random movements
towards the goal, and theyll get there eventually? is that what you
What kind of wandering?
Independent, directed human-like “wandering” (say, people in a city each
with their own objective), crowded path (like filing into a stadium), or
like a flock of birds (chaotic “follow the leader”)?
This may help:
They are supposed to be zombies wandering around in a court yard and
slowly making their way into building.
You could pick random directions that have to more or less point toward
the door and shift them in random amounts of time. You would need an
avoidance system, though.