Project 2 - Taste of Chicago

Due Monday 3/08/10 at 11:59pm Chicago time


This project will focus on using CUDA to simulate a rapidly spreading epidemic in the Chicago loop. In particular we are going to simulate what happens when a bad peice of falafel at the Taste of Chicago turns an attendee into a flesh eating ghoul who starts attacking the other attendees. Think "Night of the Living Dead at the Taste of Chicago."

Note: as the "Z word" was never mentioned in "Night of the Living Dead" or any of George Romero's sequels we are going to use the more appropriate term "ghoul" in this project. The "Z word" became associated with this particular eating disorder as a result of the unoffical Italian sequel to Dawn of the Dead.

Some details:

The area you are simulating includes at least the loop area of Chicago which is bounded on the north and west by the Chicago River, the east by Lake Michigan, and on the south by Roosevelt Ave. You should simulate at least a block beyond this area to see if the infection manages to spread. Simulating a larger area will also be beneficial for your grade.

There are several map servers out there - www.openstreetmap.org/index.html , maps.google.com , 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.

There is also the official Taste of Chicago page:
 www.explorechicago.org/city/en/things_see_do/event_landing/special_events/mose/taste_of_chicago.html

It should be obvious from the display which agents are alive, ghouls, etc. They may just be different coloured dots, but they should be very obvious on the screen. If you allow people to zoom in (part of the A grade) then the dots should also have lines or arrows showing where the front of the entity is.

The simulation visuals should update at a reasonable rate - ie at least 15 frames per second, and the simulation itself should run at a reasonable rate so that the entities move and turn smoothly.

The uninfected and the ghouls will move through open spaces such as streets and parks. They will be blocked by buildings. The ghouls can not cross water  (even though one did fight a shark in a rather cool sequence in said unofficial Italian sequel) - you can decide if you want the uninfected to be able to swim. Lets assume the outbreak takes place on a weekend so very few people are in the skyscrapers and lets further assume that the doors are locked so people can't get back inside the buildings Y

You should have a clock to keep track of time in the simulation, and people should move realistically given that clock. The user should be able to pause the simulation and start it playing again. The clock should be visible on the screen.

The ghouls will be treated like boids (www.cs.toronto.edu/~dt/siggraph97-course/cwr87/ or www.red3d.com/cwr/boids/ or my notes at www.evl.uic.edu/aej/527/lecture08.html) 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. eg if you feel the ghouls would be drawn towards a nearby Starbucks then that would be an OK rule addition.

About 400,000 people per day come to the tast of Chicago. One million people attend the fireworks. That gives you a rough approximation of the number of entities that you can try to simulate. I would suggest starting with a much much smaller number and then work your way up as you optimize. You can randomly assign starting positions to people with a density function that puts most people into the Taste area but a reasonable number of people into other parts of the loop.

A certain percentage of the population will be police officers who are armed. They will have a better chance of fighting back. They will not panic as easily, and will recover from panicing more quickly. They also have infinite ammunition. They should look obviously different than the typical living or undead agents.

The infection starts with one or more people eating some bad falafel somewhere in the Taste of Chicago.

When a person is infected (or bitten) they will turn into a ghoul. This depends mostly on the plot needs of the movie and can take anywhere from 5 minutes to 24 hours. For this simulation lets say it takes 15 minutes, though you may want to let the user vary this parameter.

Once infected the ghoul will start to get hungry. At first the ghoul will mill around, but as its hunger increases the ghoul will move faster and more directly towards the nearest visible food source. If a ghoul catches a person then the intended victem has a chance to defend themselves and kill the ghoul. The chance is small if they are unarmed, and much better if they are armed. If the intended victem fails to kill the ghoul then the ghoul will bite the person reducing the hunger of the ghoul and infecting the former-person. If too many ghouls bite the person then the person ceases to exist (as there isnt enough left to form a new functioning ghoul.)

If a ghoul doesnt eat within a certain amount of time it will then be unable to move, but it still might be able to grab someone who walks or runs next to it.

A dead ghoul should remain on the ground where it permanently died, and should look different than the mobile ghouls.

If a person sees another person being bitten in their vicinity then that odds are very good that person will panic, scream, pick a random direction, and start running. A panicing person will get over their panic after a certain time if they don't see another attack, or if they get near to a police officer. A person who sees a panicing person will not panic himself / herself, but the flocking code should make that more person inclined to flock with the panicing person. The panicing people should look different than any of the other entities.

If the infection looks like it will spread beyond downtown then you can decide whether  to give the user the option of having the government respond by using a nuclear weapon on the city, as there is legitimate cinematic precedent.

In terms of the boids, the people, panicing people, armed people, and the ghouls should have different rules in terms of how they move. All of them should have the same ability to see in front of them to some given distance, hear all the way around them to some distance, and have the same maximum speed.



You can use the colours of the available online maps as a starting point to determine which areas are walkable and which are barriers. Very likely you will need to clean up the map to use it for collision detection.

The visualization part should be written in OpenGL. 

You should keep a counter of how many entities of each type (living, ghoul, permanently dead) are in the loop at each point in time.


The capability of your graphics card will determine how many boids you can compute with. You will not be penalized for having a slower card, but you should try and push your card as hard as you can. Investigate how various parameters affect the efficiency of CUDA. A major focus here is documenting your efforts so you can explain to the class how you improved the speed of your code (or increased the number of particles you could simulate).



Implementing the simulation above is worth a C.

For a B

For an A


I would start this project by coming at it from two directions - one is getting a boid simulation running in a fixed size open space, and the second is dealing with the map data. Once you have both of those working then I'd suggest trying to put it together with a small area - say Columbus to State and Jackson to Balbo, and then expanding from there.


As with the previous project, to turn in your project you should set up a web page describing your work, including 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 20 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 CUDA. Be sure to practice your presentation so you finish within the alloted time so everyone has equal time to present.



more science here: http://www.mathstat.uottawa.ca/~rsmith/Zombies.pdf



last revision 2/05/10