Group Programming Project – Fire/ Crowd Sim

One of our projects in 3rd year is a C++ group programming project. This forces us to get better at working together with Agile software development methods and merging code using source control.
fireSimScreen01

Our group chose to do a crowd simulation running out of a burning building. You create the building at the start, add walls, doors, agents, an exit and place for the fire to start burning, then the simulation starts. The fire spreads and gets higher, producing smoke, and agents run from it towards the exit. They die if they get too hot. Fire can be put out using the fire engine’s hose, controlled by clicking and holding where you want to aim, but it moves very slowly, providing some challenge to put out the fire where it is most needed. Points are scored for agents that successfully get out.

firesim

 

I wrote the fire simulation, based on this prototype I made in a game jam: https://patrickreececv.wordpress.com/2013/12/16/ludum-dare-perfect-match/
T
he C++ version is based on a 2D grid however, but much more flexible and object-oriented. It uses simple cellular automata to spread in a semi-random pattern. The fire is a simple triangular mesh modified in the vertex shader over time and with temperature, with some 3D noise for subtle detail.

I also wrote a generic particle system using camera-facing billboards generated from points using a geometry shader. The system was based on Unity’s (from a user point of view), some features are missing but it was flexible enough to do the smoke from the fire (generated when the fire hits a certain temperature), and the water from the fire truck.

fireSimScreen02

I learnt a lot from this project about programming with other people. The systems I wrote were fairly straightforward, despite the occasional deceptively tricky thing such as clicking an object and knowing what was clicked.

We developed on Linux using the NCCA Graphics Library, a simple engine abstracting some of OpenGL’s methods. It probably won’t work on anything other than Linux unfortunately! The crowd is controlled using python scripts with C++ bindings to a generic API. Theoretically, a user could alter the state and behaviour of agents by changing the python. The crowd uses pathfinding, flocking and avoidance behaviours to navigate to the exit.

My group was:
Crowd Sim: Mohrag Taylor, Ed Ferrysienanda, Chun Chan
Octree tech: Nikolay Zorov
Python bindings: Stoyan Stoyanov
Map/ UI: Steve Tucker
Fire/ Water/ Truck: Patrick Reece

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s