Graphics Programming Warmup: Flocking
The Basic Idea
You will implement an interactive program that simulates a flock of objects flying around. Flocking was discussed in class, and there are notes here on this Wiki.
The main thing is that this needs to be an interactive program that maintains a constant frame rate. You need to figure out how to assess what the frame rate is, and to make sure that you're keeping it constant.
The assignment is pretty much open ended (subject to some ground rules). You can use whatever tools you like to implement it, as long as your program runs on the computers in 1358 CS when the time comes. We recommend that you use OpenGL and C++, but if you really want to do something else...
There are two aspects of this project:
- We want you to experiment with flocking (and we do mean experiment - try to see what things you can get to happen!)
- We want you to built an interactive program where you need to worry about efficiency, and the mechanics of working with a partner.
Some ground rules
- You must work with a partner. Each pair must send email to the instructor and the TA saying who you will be working with (only one partner needs to do this). If you haven't picked a partner by class on Monday, January 28th, we'll pick one for you.
- You and your partner must use some form of source code control. We can help set you up with CVS if need be.
- Your program must run on the machines in 1358. All of the performance limitations must be met when running on these machines.
- Your program must monitor its frame rate and maintain and be able to maintain a constant 30fps (or constant 60fps if you're ambitious) for a fixed number of boids (at least 25). You probably want your program have a "frame rate locked" mode and a "go as fast as possible" mode.
- Your program must allow you to experiment with different numbers of boids. Part of this assignment will be to characterize how the performance scales.
- Your program must be able to handle a reasonably large number of boids at a reasonable frame rate (e.g. it must "feel" interactive with over 100 boids).
- Your program must allow the user to interact with the flock.
- You must have at least the basic flocking behaviors (cohesion, seperation, alignment), and a behavior that keeps the boids on the screen.
- Your boids must be oriented. You don't have to draw them fancily (triangles can be fine), but in terms of their motion, they need to have a "front" that defines their "forward" direction.
- If you do make things 3D, you should have some view that gives a global perspective (like a top down view) so we can really see what's going on.
Beyond the basics, well, its up to you. You must decide how to make it interesting. You could try to make it visually very compelling. You could make it visually simple (even just 2D) but have really complex and interesting behaviors. You could have relatively simple visuals and behaviors, but be able to have massive scales (thousands of boids swarming like bees).
The Deadlines
- Monday, January 28th, before class (2.30pm)
- You must pick a partner. Send email to the instructor and TA with your choice. If you haven't picked a partner, we will assign you one in class.
- Monday, Feb 4th, before class (2.30pm)
- Signs of Life checkpoint. You must have at least basic flocking working. Make a Wiki page and put a screen shot on it. On this page you should (briefly - a bullet list or paragraph for each) (1) what you have working and (2) what you intend to have done by the deadline. This way we can tell you that you if you're being ambitious enough.
- Monday, Feb 11th, before noon (so the TA/instructor can scan over it before class)
- Your initial documentation. Details of the documentation will be available later.
- Monday, Feb 11th, beginning of class (2.30pm)
- Actual assignment due. We might do demos in class, so your program had better be done.
- Monday, Feb 11th, 11.59pm
- Final assignment hand in. The final version of everything must be turned in before midnight. Instructions on what to turn in and how to turn it in will be available later.
What to turn in
- For your partner choice, send email to the instructor and the TA
- For your signs of life: make a Wiki page (in one of the partner's page groups). The page should be called
FlockingSignsOfLife. Every person should have a page with this name in their Page Group: if you aren't the partner who has the real thing, you should have a link to it. Make a link to the page on the AllStudents.FlockingSignsOfLife page.
- For your documentation: make a Wiki page (in one of the partner's page groups). The page title should be
FlockingDocumentation. Again, if you don't have the real thing, have a link. And put a link to your real page on the AllStudents.FlockingDocuments page.
- For your code: specific instructions will be provided close to the deadline.
Your documentation
Specific details will be available later. But expect to have to address the following:
- Why is your program cool? What did you do beyond the minimums.
- Assess the performance of your implementation. How does it scale? Where are the bottlenecks?
- Describe the behaviors you implemented, what is particularly interesting?
- How did you architect the program to keep the frame rate guarantee?