Random wandering toward goal destination

Posts: 1
Joined: 2011.02
Post: #1
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?
Quote this message in a reply
Posts: 353
Joined: 2002.04
Post: #2
You might find some help here: http://www.red3d.com/cwr/steer/
Quote this message in a reply
Posts: 1,487
Joined: 2002.09
Post: #3
Maybe something like this maybe? WASD to move, mouse to fire, you can climb the walls to get up top. The movement of the enemy circles is supposed to look sort of like ghostly jellyfish or something like that. They swarm into the bunker, go down a vent, and kamikaze themselves on an invisible spot in the lower part of the bunker.

The source code is is Ruby inside the app bundle if you want to look. It's not really commented as it was just hacked together in a couple hours for a contest I never actually entered. :-\

Basically I generated a pathfinding map using breadthfirst search. The map was a 2D array of vectors pointing in the direction to get to the target. I bilinearly interpolate the direction from the pathfinding map, add a little extra random direction using a perlin noise like function, and modulate that by a sine wave to give them the pulsing looking motion.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Post Reply