Random wandering toward goal destination

1559173c2c9e29fe7208d4ff9dbc8ed2
0
tron_thomas 101 Feb 07, 2011 at 04:23

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 destination.

Where can I find resources that would help with implementing this type of behavior?

7 Replies

Please log in or register to post a reply.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 Feb 07, 2011 at 04:37

First of all, google for “pathfinding” and in particular “A* search”, which is very handy anytime you need things to move around and avoid obstacles.

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 and repeat.

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.

1559173c2c9e29fe7208d4ff9dbc8ed2
0
tron_thomas 101 Feb 07, 2011 at 04:45

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.

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Feb 07, 2011 at 05:30

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 want?

8676d29610e6c98d6dd2d9c38528cd9c
0
alphadog 101 Feb 07, 2011 at 13:20

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:

http://opensteer.sourceforge.net/

1559173c2c9e29fe7208d4ff9dbc8ed2
0
tron_thomas 101 Feb 08, 2011 at 03:50

They are supposed to be zombies wandering around in a court yard and slowly making their way into building.

A638aa42130293f319eda7fa4ba121f4
0
fireside 141 Feb 08, 2011 at 05:18

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.