framework Flock was written in C using the OpenGL and SDL libraries. on screen control The on-screen control in Flock allows you find new swarms of butterflies and is crucial for keeping track of the positions of the birds in your flock. There are also health meters for each of your birds and the all-important confidence meter. There is also a scoreboard that allows you to keep track of how well you're doing in the game. It was implemented without GLUT or GLX text support view frustum culling The terrain and grass are both calculated and drawn only when it is relevant to the camera's current position and view. This was very important because both the terrain and grass were infinite and the grass rendering is very computationally intensive. level of detail control The level of detail control was implemented in two major ways. First, the grass and terrain were each drawn out only as far as was necessary. In the case of grass, the texture of the grass blades were faded into the texture-mapped ground to avoid "popping-in" of grass. In the case of the terrain, spatial resolution of the terrain diminished with distance from the user. Secondly, for objects such as trees, an automatic billboard capture and display system was implemented which allowed us to avoid rendering distant trees every frame and to instead use transformations of cached images. procedurally and physical-based modelling Trees are procedurally modelled at a precomputation stage and are stored for later use throughout the game. The terrain, grass type, and grass distribution were all modelled analytically to allow us to represent infinite terrain with finite data storage. simulated dynamics All bird movements and behaviors were mediated through a force based system to allow smooth combination between different behaviors. Future bird positions and velocities were calculated using basic Newtonian mechanics. sound Flock uses the SDL_mixer library that allows us to play background music as well as 16 simultaneous event samples at any given time. Sound that marked events in the game became important because much of the action affecting your flock can occur off-screen. artificial intelligence The flocking algorithms in Flock were inspired by the Steering Behaviors model of behavioral character animation established by Craig Reynolds. Each of the bird uses the positions and velocities of other birds, butterflies, trees, and the world to calculate forces to fulfill goals such as flock cohesion, individual seperation, flock alignment, leader following, obstacle avoidance, and target acquisition and seeking. Almost all user control over the flock comes from affecting these behaviors to lead the flock toward a desired goal. external resources bird models The bird models were originally obtained from Emperor Ken. We loaded the bird models into Poser and manually animated them. The bird models were designed for ray-tracing based rendering and had high polygons counts that were inappropriate for real-time rendering. So, we used a mesh decimation utility called QSlim, written by Michael Garland (garland@uiuc.edu), to lower the polygon counts of the animated models. Because QSlim does not recompute the normals of the decimated mesh, we used Nate Robbin's GLM library to load and compute smooth normals for the bird models. background music The background music of the game was used without permission from the album titled Madoka's Piano Files which is a soundtrack for the television series Shin Kimagure Orange Road. sound effects The event sounds and looping wind sound in the game were taken from flashkit.com which offers these sounds royalty-free. Other various sounds in the game were taken from various Internet resources. creative inspiration The CodeCreatures demo by CodeCult Software heavily influenced our direction and vision for our game. Copyright 2002 Eric Berger, David Chan |