BOIDS Collision Avoidance Ex.

One of the things I’ve been interested in simplifying, are the creation of boids systems. I’ve tried a couple of times to do it but I get lost in more complex trig (at least for me). I didn’t notice until last night that there were some Stoke tutorials posted here. http://www.thinkboxsoftware.com/Stoke/

The second I saw the velocity field wrapping around geo I was excited because I knew you could use that for object avoidance. I spent about an hour trying to use the field as a Stoke Follow in pflow, but then I remembered you could use the field as a standard force too! That made things soooo much simpler and more graceful. What’s neat too is that if you cache out the flow and you have particle colliding - I already know a solution that I’ve used before: Using a standard Magma flow you can have a distance threshold of 0 so that if it collides with any geo, it will move along the surface normal and then continue on it’s vector.

I only had time to post this screenshot, but I’m going to try and do a more involved test when I get more time. I’m all about simplifying :smiley:

I’ll be interested to see your results.

Alright, here is the simplest example ever for boids. It’s attached to this thread. You may find that the particles intersect the geo if there is too much noise applied to the object. If you turn on the Magma Field you’ll see the craziness in the velocity field. But yes, this is exciting because it’s less math and you could essentially use simple shapes as proxy objects without having to do any raycasting. I’m definitely loving Stoke, even if it’s just for that.

I saved the file as a Max 2012 version.
flock.max (240 KB)

very interesting scene and topic.
thanks for sharing,
fuat