To view this page ensure that Adobe Flash Player version 10.2.0 or greater is installed.
What is Migratory?
Did you know that you can mathematically mimic birds' flocking behavior? I didn't, until I took Professor Ben Coleman's game programming class at Moravian college back my senior year's spring semester. He showed the class a Java based example of flocking behaviors, but it was one of those "show and tell but don't touch" examples. I never actually got to play with the different behaviors. That plagued me.
It still had been eating at me, almost three years later. I never got to adjust the weighting of the different behaviors, and partake in a zen-like trance of watching pixel apparently taking flight. I recently found myself with some extra free time, and realized I still had most of the game engine source we developed in 2009. I set about translating the code from Java to AS3, and Migratory is the (still growing) result of my endeavors.
How do I use it?
Sit back and watch. I've set the default settings to some pretty tame flocking behaviors. Or, if you are as sucked in as I was, I've given you the ability to modify all of the major behaviors, just click "Show Options Panel" and have at it! I've provided a quick overview of each setting below. If you are looking for a more mathematical explanation of any of the settings, you can check out Professor Coleman's page, or search the web for "mathematical flocking behaviors," you will find there is no shortage of information.
What is alignment?
Alignment is the desire for the individual birds to point in the same direction. The closer to 1 this setting gets, the quick the birds will point in the same direction.
What is cohesion?
Cohesion is the desire for birds to group up. The closer to 1 this setting gets, the closer the birds will stick together.
What is separation?
Separation is the desire for the birds to stay a reasonable distance apart. Setting this closer to 1 causes the birds to move further apart. In fact, setting this at 1 is pretty dangerous due to the torus nature of the bird's world. They'll get stuck at the edges if they do not have a high enough cohesion setting. Again, you can read up on features of a torus and why this happens all you want, or you can just take my word for it.
What is bird count?
If you've gotten this far, I shouldn't have to explain this one to you. Be careful though, this is a very intensive program, and while there is still room for optimization on my end, adding too many birds can really bog things down. If you see that number in the top left drop below 30, you may want to consider removing some birds. Also, see my notes for effect radius below.
What is minimum and maximum speed?
This allows for some random deviance in the birds speed. I don't weight the other attributes based off of their speed (yet) so you will notice that slow birds will act as a pretty strong anchor to the faster birds, depending on your other settings.
What is effect radius?
The size of the radius will determine which birds each bird will look to for the three primary attributes. The smaller the radius, the less birds get considered, and you will find that grouping will start to occur.
Obviously, I hope you enjoy this. It should bring you some fun, some relaxation, and hopefully spark an interest in math, computer graphics, gaming, programming, nature, or the color blue. I am still going to continue to tweak and add features, so check back often!
Update on 11/3/2011
I've optimized the frame update code -- the frame rates for higher number birds should be better now.
Update on 11/2/2011