Flocking ai

Has there been any work on a python script for flocking? I used blocks and radars to make a bunch of characters randomly walk and flock but the system chugged after 4 characters. I guess a script might be a more elegant solution but I’m not a scripter at all.

Glenn

I thought Mmph! said he was working on flocking AI in the GE resources? Maybe

That looks like path finding rather than flocking. I’d like to herd a bunch of critters about on a playing field.

Glenn

You should have a look at Blender People. It looks cool, but I never tried it out myself.

/ Mats

Correct me if I’m wrong but isn’t that not for games?

Glenn

I suppose you could set up tracking to what you want them to flock too? Then on contact do some other actions?

Perhaps having a few different actions on the way. You could set it up so when they hit a field in front of whatever you are flocking towards, the actors do something.

Maybe draw a weapon and get into a ready stance, while some just keep going untill they make contact with another field or the thing you are flocking towards.

sounds like it could be fun to do.

edit: I just came across this, maybe you could use it? I dont know…

Locked Track

http://wiki.blender.org/uploads/8/8b/LockedTrackConstraint.jpg
Locked Track is a difficult constraint to explain, both graphically and verbally. The best real-world example would have to be a compass. A compass can rotate to point in the general direction of its target, but it can’t point directly at the target, because it spins like a wheel on an axle. If a compass is sitting on a table and there is a magnet directly above it, the compass can’t point to it. If we move the magnet more to one side of the compass, it still can’t point at the target, but it can point in the general direction of the target, and still obey its restrictions of the axle.
When using a Locked Track constraint, you can think of the target object as a magnet, and the affected object as a compass. One axis will function as the axle about which the object spins, and another axis will function as the compass needle. Which axis does what is up to you! If you have trouble understanding the buttons of this constraint, read the tool-tips; they’re pretty good. If you don’t know where your object’s axes are, turn on the Axis button in the Draw panel, object buttons, F7. Or, if you’re working with bones, turn on the Draw Axes button, Armature panel, editing buttons, F9.
This constraint was designed to work cooperatively with the Track To constraint. If you set the axes buttons right for these two constraints, Track To can be used to point the axle at a target object, and Locked Track can spin the object around that axle to a secondary target.
This is all related to the topic discussed at length in the Tracking section

Wow. Thanks. that’s great. i appreciate your feedback. I’ll look into it. :slight_smile:

Glenn