Firefly  
 

Home, Presentations, Concept Drawings, Screenshots, Renders, Photos

Week Three: LightPad Prototype & Interaction

Firefly

The Game

ScreenshotDescription

Firefly is a game where you must navigate a bug called Firefly through the world he lives in. Firefly will always follow the light and avoid shadily places. His aim is to build a nest and it is your task to help him: Gather all the different materials that are needed in order to create a shelter for the young Fireflies. But keep in mind: Firefly does not survive without food. The longer the last meal is ago the slower Firefly will become. So plan betimes to move Firefly to where he can find something to eat that will restore his powers. If Firefly has recovered his strength he can go on collecting useful materials. But be aware: There are dangers awaiting you in Firefly's world that you will have to face.

Every player will navigate his own bug through the map and collect materials for the nest. You can either be fast in building your nest or try to interfere with your opponent for example by stealing material he has collected.

Game Logic

The world in which the Firefly lives in is a board with places containing objects. This has been modeled by a corresponding class hierarchy. For each frame, a method call makes Firefly check his surroundings for objects he can interact with.

The Light Pad

Light PadDesign

Light Pad has been designed to be a simple, yet high quality input device. The light is meassured by a webcam filming a paper surface on which the user performes gestures by casing shadows onto that surface.

Our Prototype is constructed using a solid paper box with a Logitech QuickCam for Notebooks inside. Construction of the Light Pad therefore was as cheep as 40 bucks.

Sadly the WDM-Driver of the Logitech Webcam is pretty bad and only delivers 2 to 3 frames per second. Sadly we can only access the cam via WDM, but more on this problem later on.

The area covered by the camera is roughly 16cm x 21cm in size. This makes for a fine input area that can easily be operated with one or two hands.

Other Photos of the Light Pad:

RecognitionGesture Recognition

In order to recognize the user gestures we went in for a very simple aproach. We calculate the center of all "light" pixels and the center of all "dark" pixels.

To deal with the auto-correction functions of the webcam, we determine the average color intensity of the image. Then we take a pass about all pixels that are brighter than the average color and determine an average brightness. The same applies to the dark pixels.

Now we look only at pixels brighter than the average brightness in the image and calculate their center. Similarily the center of the dark pixels is calculated.

After this pass we can determine the vector following which the Firefly can escape the shadows and find a brighter spot.

The Engine

Interact with lights in a 3d-environment

We strife for a plattform independent way to interact with a virtual environment using input from a webcam.

To that end we have looked into the capabilities of PortVideo, ARToolkit, OpenCV and Qt. Due to compilation difficulties we finally decided on using OpenCV for Webcam input. Sadly this toolkit does not access Webcams under Windows via DirectShow and therefore is pretty slow. This forces us to eventually mutithread the game or accept a low frame rate. Adapting SDL for creating threads has not lead to any success yet.

ScreenshotRendering the world of Firefly

Our 3d-engine is 100% home-brewed and uses SDL to create plattform independence. OpenGL was the natural choice for rendering a cross-plattform game and for image loading we use DevIL. Meshes are loaded using our own file format.

At the moment the engine supports: