A murmuration of starlings is (in Hunter's opinion) one of the most hypnotically beautiful systems in nature. Hundreds of thousands of birds take flight to form ethereal blobs that shift, separate, and coalesce in a strange ballet of order and chaos. These groups are named for the soft murmur generated by their many wingbeats and flight calls, which you can hear in this video.
In this laboratory assignment, we will implement an artificial life program called Boids to model and animate a murmuration of starlings on the VGA display. Each "boid" (which is an abbreviation of "bird-oid object") follows a very simple set of rules. These rules are discussed at length here, but they can be summarized as follows:
5730 students will implement a fourth rule, which is predator avoidance. All of the boids will steer away from a predator (a peregrine falcon, perhaps?) which flies around the screen. In nature, it is often a falcon which drives these flocks of starlings.
When all of the boids follow these simple rules, the flock produces gorgeously organic-looking emergent patterns, as shown in the demonstration video. You'll be asked to implement a user interface that allows for the user to dynamically update parameters. As you modify the parameters, you may notice that the group changes from "bird-like" to "fish-like" or "insect-like." Change them extremely, and you may instead feel like you're looking at atoms interacting in a crystal, or at strange unudulating solid materials. It's really interesting to build something with the capacity to surprise even the person that built it. This project has that property.
This lab is interesting for a few other reasons too. From an engineering perspective, it will force you to obsess over code efficiency. You'll be required to find and optimize the slow parts of your program in order to generate the largest flock that you possibly can. Such optimizations will include fixed point arithmetic, the alpha-max plus beta-min algorithm, multicore parallelism, and any other clever tricks you may come up with. You may modify the algorithm as much as you want, so long as I can't tell that it's been modified when I watch your flock. In this lab if it looks right, it is right! Get into a hacker mindset.
This assignment will likely also cause you to notice this algorithm everywhere. You'll see it in the starlings above Ithaca, schools of fish, groups of insects, video games, movies/TV, and even groups of people! I hope that this project allows for you to notice and enjoy these emergent phenomena.
Key concepts: Boids algorithm, fixed point arithmetic, computer animation, optimization, VGA, UART, multicore parallelism, alpha max beta min, Programmable I/O (PIO), Direct Memory Access (DMA), overclocking
Experience shows that students prefer these webpages short. For that reason, plese find the reading and background materials on the webpages linked below. Please note that the information in these readings will be critical for completing the lab.
Note that these checkpoints are cumulative. In week 2, for example, you must have also completed all of the requirements from week 1.
turnfactor
: 0.2visualRange
: 40protectedRange
: 8centeringfactor
: 0.0005avoidfactor
: 0.05matchingfactor
: 0.05maxspeed
: 6minspeed
: 3Write a ProtoThreads C program which does the following:
turnfactor
: 0.2visualRange
: 40protectedRange
: 8centeringfactor
: 0.0005avoidfactor
: 0.05matchingfactor
: 0.05maxspeed
: 6minspeed
: 3
- The boundary conditions (box, or top/bottom & left/right wrapping)
visualRange
protectedRange
centeringfactor
avoidfactor
matchingfactor
In addition to the above requirements for 4760, 5730 students should also . . .
predatorturnfactor
: 0.5predatorRange
: 100
Your written lab report should include the sections mentioned in the policy page, and: