View on GitHub

Now I can see clearly

rogue-like in CAVE2

Download this project as a .zip file Download this project as a tar.gz file


Welcome to the homepage of my third project of Fall 2013 Semester, I Can See Clearly Now, Project 3 of Professor Andy Johnson's Computer Graphics II course. See also my Project 1 and Project 2



This project was proposed as a rogue-like 'game' developed as a practice on multiple techniques for omegalib and CAVE2. The original proposal can be found here.

What I actually implemented include:

  1. Randomly generated dungeon levels
  2. GPU Shaders for textures
  3. Navigation using Wand
  4. Background music and environmental sound effects
  5. Environmental lighting and two kinds of artificial lighting
  6. Extended Bullet physics engine functionality in Omegalib applied in this project

Download and Installation

  1. Have omegalib installed, with python support enabled and cyclops and omegaOsg modules added
  2. If you are using Mountain Lion or higher, you also need to have XQuartz installed and running. If you are using Mavericks, you need to download Xcode 5 and command line tools.
  3. Download source code of this project from Github or on top of this page
  4. To run the project, using following commands: $ cd [omegalib_build]/bin/ $ ./orun -s [where_you_put_this_project]/

Note that to have the best experience, you need to run it on CAVE2. If you want one, you can buy one here

Detail Description

all fatures and usages discussed here are for running this app on CAVE2 if not noticed otherwise

looking into a tunnel from a room

Features and Usage

Dungeons Randomized

Each level of dungeon has random number of rooms of random sizes. Rooms are connected by tunnels at random positions and with random length. In each room there are 3-4 torches, which provide lighting, at random position of each side. Also there are doors at the one side of entrance of the tunnels, but currently they can't be opened and you can move through them

torches are at random positions

Physics Attached

Floors and walls come with attached physics attributes so that the 'character' won't go through the wall. (Note that if you keep trying, you will be able go through walls due to the accuracy issue of physics calculation)

Navigation Implemented

Currently what the 'character' can do is walking in the maze. I also implmented 'jumping' using physics but it is not really useful until creeps or monsters are put into this dungeon in the future. The 'character' starts from the room with staircases that coming from upper world and tries to find the other staircase that leads to a lower level of dungeon.

There is also a chest in a random room but currently nothing is in it!

To move the 'character' around, use analog stick of the Wand. To turn left or right, hold Button7 and move the Wand to the same direction that you want to turn to. To jump, press ButtonDown. If the 'character' falls, pressButtonUp to reset his orientation.

looking through a room into another tunnel from a tunnel


GPU Programming

I took this project as an opportunity to pick up half of what I learned in GPU Programming course, writing shaders. And learned basic of writing shaders in omegalib. Writing shaders in omegalib is somewhat different from doing in native OpenGL programs, but the underlying principle and process are the same. Generally speaking, the uniqueness reflects in following aspects:

In this project, I wrote shaders for attaching texture to an entity in different ways.

Generating Random Dungeons

The largest issue when implanting the random algorithm to CAVE2 was that each nodes uses different seed so they acutally generated different dungeons. Below is a broken dungeon in bird's eye view.

However, if we gave the program a fixed seed, it will generate same set of (different) dungeons everytime it runs. To solve this issue, I collected users movement and used it to generate a seed for next level. Since users' movement can be considered as random movement, we have a random seed for each generating. As for the first level, I used current time so we have a different first level each time


I also tried out simulating fire light and flashlight in cyclops. There is some issue there so switching to flashlight won't work unless the 'character' moves around

Bullet Physics

I continued working on Bullet Physics engine and added RigidBody for PlaneShape. PlaneShape's are extensively used in building the dungeon. I also added addCentralForce() and setLinearVelocity() to current functionality set in cyclops because I thought they would be useful if the 'character' needs to kill creatures in the dungeon. Unfortunately, I haven't got a chance to add more fun stuff into my dungeon.

*Using xbox 360 controller as input device

This has not been acquired 100%. I tried to implement handling events from xbox 360 controller because xbox 360 controller is probably more intuitive than the Wand in this setting. Although some experiments were done, I couldn't make everything work properly before deadline.

destination ahead

Source and Reference

Sources and reference I used in this project:

Future Work

There are plenty of interesting things I thought of adding to the dungeon. I hope in the future I can make this dungeon more and more fun (by making it creepy and dangerous)