Find them All!
Fall '14 CPE 471 Final Project
Donny Percivalle
Tell Me More

Gameplay

Find them all is a simple game with a single goal:
find all the instances of the objects in the tray that are in the world.

There is a tray of items in camera space at the top of the game window at all times. The items in this tray rotate around the y-axis to create an arcade game like aesthetic.



To find an object in the world, simple bounding box collision detection has been implemented. If the camera's world coordinates are ever inside the on the edges of or inside an objects bounding box, then that object will be "found". To indicate that this has happened, the object will explode into 100 smaller, randomly oriented copies of itself and move upward and outward.

This explosion will last for 240 frames, and then disappear. Once the explosion has finished, the item tray will be notified that the object has been found. If it so happens that the object found is the last instance of it in the world, then it will be removed from the item tray.



Once all the instances of the items in the item tray have been found, the world will be re-randomized and a new set of objects to find will be selected. The game is never-ending.

Shader

Blinn-Phong Model

The game uses a simple Blinn-Phong shader model implemented in GLSL. The properties used for the specular and ambient values in the shader model are grabbed from each objects .MTL (Material Template Library) file. There is a single light in camera space (so that it moves with the camera) that illuminates the scene. Each item in the item tray also has its own individual light in order to illuminate them (the light for the scene is behind the tray).

The diffuse component of the object files is grabbed from the .MTL file. However, if the MTL file dictates that the material has a diffusion texture, then the image data will be loaded into the GPU, and bound when the shape is drawn.

For efficiency reasons, the objects in the scene are only loaded once, at the start of execution. All shape data is sent to the GPU once, and simply bound when an object is drawn. Even though there may be multiple instances of the same object in the world, there is a singleton instance of the shape from the GPU's perspective, and all instances of this object have pointers to this singleton. At most, there will only be n number of vertex, index, normal, and texture arrays allocated in the GPU where n is the number of distint objects loaded in the world. This alleviates a decent amount of latency when drawing. It also reduces the memory footprint of the game.

Object Loader

tinyobjloader

Thanks to Syoyo Fujita, this game loads all scene objects using tinyobjloader. It supports obj files with multiple shapes, as well as .MTL (Material template library) files. The game logic is completely agnostic from the scene objects, except that there is a list of object files to load as well as a std::map of constraints that ensure that the object will be oriented in a logical way.

In order to add an object to the game, it only requires: (1) that the .OBJ, .MTL, and any texture files be in the same directory as the executable, (2) the .MTL file have no spaces in the file name, (3) the object file be included in the array of strings "object_files" in main.cpp,



and (4) that there be a constraint element in the constraints map in Constraints.h that maps to the values that will render the object in a way that makes sense.