I’ve always been intrigued by emerging behavior and thanks to ICE I was finally able to devote some time for experimentation. So here are a bunch of particles trapped in a bottle and constrained by the typical 3 rules which each generate their own force:
- cohesion: each particle is attracted by the particles of its own kind, as long as they are within a given radius and in the field of vision
- alignment: each particle aligns to the average direction of its neighbors
- separation: strong but very local force that prevents collision
I have found ICE was a very good playground for this. I must also mention Programming Game AI by Example by Mat Buckland for its good coverage of steering behaviors.
And that piece would just be a bunch of dots in a bottle without the music from Pierre Lapointe. Try to listen to some of his songs, I think they must be beautiful even if you do not understand its chiseled lyrics.
If you are interested, here is a link to the SI scene: flocking_in_bottle.zip.