Project 2 - Have you Seen the Saucers?

Due Monday 3/05/12 at 8:59pm Chicago time

This project will focus on using OpenCL to do a particle simulation which talks to OpenGL to display the particles.

You will be simulating what happens to a large number of people in the Mall area as the Washington DC area is visited by flying saucers. Think Earth vs the Flying Saucers or Mars Attacks! or the Day the Earth Stood Still (the original).

Each of these people on the ground will be a boid ( with some fairly simple rules of action, and limited to 2D motion, and rotation around only 1 axis. The people in the simulation will not have the same amount of desire to match velocity and alignment as birds, but there will still be some of that in the way they move in groups. The more important behaviour is to avoid collisions with other entities and with the environment. You are encouraged to enhance these rules as long as they stay within the spirit of the simulation.

The people will initially be milling around the mall - some may be stationary but many should have a particular destination in mind (Lincoln Memorial, Capital, White House, Smithsonian). People will movie around and try to space themselves out. The user will then be able to 'launch' one or more flying saucers into the area from a side of the map and the people will try to run away from each saucer. People have only a limited perceptual range so people far from the UFOs will not know they are there until the people running away from it reach them. People can not run into/onto buildings, but they can run down the streets and on the grass. People should move at a normal human rate.
The people should only be able to pack so close together. If a flying saucer moves away then the people will spread back out.

The flying saucers can fly over all the buildings and the grass and the water and the bridges, since all the buildings in DC are lower than the Washington Monument, but they should not be able to fly over the Washington Monument and should fly smoothly around it.

The flying saucers should generally move towards the people and try to hover over them. If a flying saucer flies over a person then there is a percentage chance that something happens to that person. The person must remain an active boid but their rules of behaviour may change. Do they become homicidal cucumber-human hybrids chasing after other humans? Are they given free iPhones and chase after the UFOs to get more? The changed humans should change colour or shape at this point. Come up with something clever. Based on the saucer's intent the saucers should leave after some point (e.g. they run out of iPhones to give out).

Your goal is to simulate a LOT of people. You should have a visible counter of the number of people who in the various states.

There are several map servers out there -,,, etc - where you can get your map data. This map data can serve as both a backdrop to show where the action is happening and as data for working out where the entities are able to move.

The simulation visuals should update at a reasonable rate - i.e. at least 15 frames per second, and the simulation itself should run at a reasonable rate. The people and the UFOs should move and turn smoothly, not abruptly.

For a C you need to implement the above project

For a B you need to add:

For an A you need to add:

As with the previous project, to turn in your project you should set up a web page describing your work, the well-commented source code and required files to be able to compile and run your program, and a movie in a common web-viewable format showing what your application should look like when its running. You should then email andy with the location of this website before the deadline. It  would probably be a good idea to put a backup copy of the web page at a second website just in case I can't get to the first one.

When you send andy the location of your webpage you should again email a screen snapshot of your head that is 320 pixels wide by 240 pixels tall in jpeg format named <your_last_name>.p2.jpg. This image will be used on the class web pages along with the link to your project web page.

As with the previous project, each student will also give a presentation about their project in-class and answer some questions about your work. This time the presentation will be 15 minutes long. You should prepare a good presentation - you can use your project website, or create some slides. You should definitely run your code and talk about how you structured the computation in OpenCL. Be sure to practice your presentation so you finish within the allotted time so everyone has equal time to present.

last revision 1/28/12