0% found this document useful (0 votes)
83 views10 pages

Comp 3501 - Labyrinthian

The document describes a maze-based game called Labyrinthian where the player must navigate through a randomly generated maze to reach the exit while avoiding traps. Special features of the game include procedural maze generation, physics, lighting, sound effects, menus, score saving, and animated rolling balls. The key original feature is the random level generation which ensures each playthrough presents a new maze. Some planned features like additional traps and breadcrumb trails were not completed due to time constraints. Challenges included implementing sound and modifying the maze generation algorithm to avoid long hallways.

Uploaded by

nickapopolis
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views10 pages

Comp 3501 - Labyrinthian

The document describes a maze-based game called Labyrinthian where the player must navigate through a randomly generated maze to reach the exit while avoiding traps. Special features of the game include procedural maze generation, physics, lighting, sound effects, menus, score saving, and animated rolling balls. The key original feature is the random level generation which ensures each playthrough presents a new maze. Some planned features like additional traps and breadcrumb trails were not completed due to time constraints. Challenges included implementing sound and modifying the maze generation algorithm to avoid long hallways.

Uploaded by

nickapopolis
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Labyrinthian

Comp 3501 Game Design


Nick Tierney Tyler Haskell Ziyao Zhou Fall 2012

Table of Contents
1. 2. 3. Introduction ............................................................................................................................. 3 Game Rules and Player Interaction......................................................................................... 3 Project ..................................................................................................................................... 3 3.1 Special Features................................................................................................................ 3 What special features were incorporated into the Project ......................................... 3 Special Feature .......................................................................................................... 6 3.1.1 3.1.2 3.2 3.3 3.4 3.5 3.6 3.7 3.8 4. 5. 4.1

Game Originality .............................................................................................................. 7 What was not accomplished ............................................................................................. 7 What was hard .................................................................................................................. 7 Data Structures, algorithms and Performance .................................................................. 7 Collisions.......................................................................................................................... 8 Physics and AI.................................................................................................................. 8 Future Work ..................................................................................................................... 8 Present the project/game software design ........................................................................ 9

Software Design ...................................................................................................................... 9 Technologies Used ................................................................................................................ 10

1. Introduction
Labyrinthian is a game where the player must navigate their way through a dimly lit maze to reach the exit. The maze contains deadly traps that the player must overcome to escape with their life. Among the traps are a few rare items that will aid the player, helping them reach freedom in one piece. The game has a first person shooter play style with a horror/puzzle solving genre. From the players perspective the main objective of the game is to reach the end of the maze as fast as possible.

2. Game Rules and Player Interaction


The main objective of the game is to reach the end of the maze as fast as possible. The player also has side objectives which include locating bonus items and avoiding traps in order to complete the maze with a minimal number of deaths. Overall the player is also trying to unlock more difficult levels by completing the initial levels. Player progression through the game is measured by the difficulty levels that have been successfully unlocked. Easy will be the only difficulty level made initially available to the player. These difficulty levels are an indication of how large and how many traps the randomly generated maze will have. The scoring system will record a players top score for each difficulty setting. The total score will be based on the time it took to complete the maze, number of deaths, and any bonus items the player finds. Most of the objects that move are traps, which are intended to kill the player if they dont get out of the way fast enough. There will be spike traps where spikes come up out of a surface and crushers that move down to crush a player standing under them. One of the more dynamic traps will be a giant bolder that rolls after a player when they have passed a specific point. The final moving object will be a bonus orb that will fly into the air when activated by the player and will lead them in the direction of the exit for a short time.

3. Project
3.1 Special Features
3.1.1 What special features were incorporated into the Project

A number of special features have been incorporated into Labyrinthian. The features that are most prominent include maze generation, physics, lighting, sound, interactive menus, game score saving and animation of game objects. The effects of maze generation are visible the moment the actual game begins - this covers the shape of the maze to placement of traps inside. As can be seen in Figure 1, a level is made up of multiple single dimension grids which use square blocks in order to create sprawling paths. Though physics are not directly visible, it is observed when the player moves throughout the maze. All objects except directional arrows use physics in order to provide fluid interaction that simulates a person moving through a three dimensional space. Collisions between the player and terrain results in restricted movement and any rolling ball that collides with the player will push them around. In Figure 1, the effects of directional lighting are clearly seen. There is only one light in this level at the moment, which consists of a single directional light that points outward from the players perspective. The use of lighting in the game creates a dark atmosphere that adds suspense to the game play. Sound has been implemented in the game in order to provide audio queues to the player. At this point sound effects have only been added for menu traversal and a background track during the actual game. Interactive menus have been added in order to let the player choose what they would like to do during their time playing the game, whether this be exiting or choosing a different level. The level selection level is shown in Figure 2. Score keeping has been implemented in the game, and is visible in the bottom corner of the interface in Figure 1. The final feature implemented is rolling balls, as shown in Figure 3. A rolling ball is simply a sphere that follows a designated cycle in the maze. Rotation is calculated in order to give the player the feeling that it truly is moving in an ordinary fashion. Features our group is most proud of include maze generation, menus and the rolling balls.

Figure 1 - Gameplay

Figure 2 Menus

Figure 3 Rolling Balls

3.1.2

Special Feature

The special feature most integral to the success of our game is maze generation. Through the use of basic algorithms, random procedural generation of mazes ensures that each level will be different upon every encounter. There are three main phases in creating a level. The first phase of generation is, depending on the level size, to create the structure of the mazes that make up the level through placement of walls. A randomized minimum spanning tree algorithm is run upon a two dimensional grid of walls, this ensures the connectedness of the maze. Though many algorithms could be used for this, including shortest path, depth first search, and breadth first search, it was decided to use a modified Prims algorithm as it gives mazes a structure that includes less lengthy hallways and more choice on the players part. The second phase in level creation is to find the connection points between the different mazes within each level. On the bottom maze of each level, the start is chosen randomly. After the start is chosen, Dijkstras algorithm is used in order to find the longest path from this position and is used to be the connection point to the maze above. The process of connecting the end point of each maze with the start of the next and then finding the longest path to its own end is repeated for each successive addition to the level. The third phase in level creation is to add rolling balls to each maze of the level. By traversing each maze and keeping track of the largest difference in height of the tree where a backpath exists, we can find the longest cycle in the maze. Once the longest cycle is found, we can simply get a rolling ball to follow this path for its entire life. The challenge in implementing this algorithm is making it so that the mazes are both challenging and random at the same time, whilst also providing fluid gameplay. Since our level is created 6

using a minimum spanning tree algorithm, the difficulty lies in modifying it in order to not include every space into to traversable space. Several rules had to be added to the algorithm in order to not create walking space when adjacent neighbours have already been added; the way this problem was solved also allows for loops to be created, which lets obstacles move fluidly through the maze without having to backtrack too often.

3.2 Game Originality


Random level generation is the key original feature of our game; it is what makes our game stand out from others. The ball that moves throughout each maze of the game also makes the experience of playing our game memorable, so it too is another original feature.

3.3 What was not accomplished


A few features never made it into the finished product. The first major feature is the addition of multiple traps; our group did not have the time available to make this idea come to fruition. The second feature that we also strived to add was breadcrumbs through each level. Many ideas were pitched for the implementation of breadcrumbs, however; there was not enough time to implement such an idea. Our lives system was working at one point in our development, but later changes affected the consistency of this. The last feature that we would have liked to make more use of is sound. Though we did manage to implement a few sound effects, it was deemed more important to spend time on other features.

3.4 What was hard


A few features that we implemented gave us a bit of difficulty. The first issue was finding a sound engine that worked for us. We had issues getting an open source sound library included in the project at first, so we switched to another and it worked out our problem on its own. The next issue was implementing the physics engine and synchronizing it with animation of three dimensional meshes. We had issues with drawing meshes at the incorrect position when it was using a physics object for its positioning. The final and major difficult feature was issues with algorithms that generated the maze. The implementation of certain algorithms with standard library data structures that did not contain the proper functionality (increase_key() for priority queues) made us find workarounds for our solution.

3.5 Data Structures, algorithms and Performance


Algorithms that were added into the game were Prims algorithm that was modified slightly, shortest path and simple graph traversal. All the algorithms run for our game are run at the start, when each level is created. Our algorithms do not run dynamically when playing out a level.

A special data structure, SpaceNode, was added to the game in order to perform algorithms on Space objects without modifying the underlying structure. This class holds variables such as the distance from source, pre and post counters, parent and children.

3.6 Collisions
The collisions are handled by the physics engine that we implemented. We assign collision groups to different objects in our game that define which objects can interact with each other. The physics engine automatically detects collisions depending on collision groups and passes the incidental objects into a callback handler in our main game class myGame. After we have decided that the collision is valid, and the objects colliding merit a response, we directly apply the correct action. The performance of the game declined dramatically when using large boxes, as collisions checks had to be performed many times by the engine. To get around the issue of large boxes, we split them up into many smaller boxes and the performance was returned to normal.

3.7 Physics and AI


There is no dynamic AI in our game once it begins. Our game is made up of several physics objects, boxes and spheres that are handled by the physics engine. All terrain features, ground and walls are static boxes. The player is a dynamic sphere that we apply forces to in order to move. The rolling ball is a kinematic actor that we move directly depending on the direction and speed it is moving.

3.8 Future Work


Features that we would add to the game in a second version include more traps, sound effects and breadcrumbs in order to provide a unique experience to the player.

4. Software Design
4.1 Present the project/game software design

The main classes that are unique to this game are the Level, Maze, Space, Wall, Trap, GameMenu, Player and GameObject. The building block of this game is the MeshObject class, where each visual element of the game will be made up of objects that have properties that will obey the laws of physics in some way. MeshObject will hold variables such as the objects position, velocity and rotation in space. This position is sometimes held within a physics object instance called NxActor. The Wall class is specific instance of MeshObject that will provide the behavior of being a solid obstacle in the path of the Player, and will contain information about the geometry and texture of a Wall object. The RollingBall class is a specific instance of MeshSphere that will provide a balls behaviour in the game. The Player class is a specific instance of MeshSphere that will provide dynamic behaviour depending on player input to guide it through the world. The player will not be drawn since it will be first person but this class will contain the specific behaviour a Player object will follow when reacting to input. This class will also contain information about the amount of life that the Player has remaining.

The Space class is used in order to maintain the structure of a particular Maze as well as keeping track of objects within it. In order to run Algorithms for maze generation and game object placement, Space is used in order to simplify the world by splitting it into even quadrants defined by a Space object. This class specifically keeps track of whether there is a wall, floor, or a trap in its location. The Maze class contains the structure of a single horizontal section of a Level, which is split up into Space objects. This class maintains an array of Space objects in order to run algorithms for automatic generation of Maze structure. The Walls and Traps are also stored in order to provide easy access for drawing the Maze. The Level class contains information about the difficulty and time data of the current level as well as the structure of the multiple Mazes that are combined in order to create a full Level. This class is used in order to determine both how many Mazes there will be and how difficult they will be. The Menu class is used in order to display a selection of elements and relay input from a user regarding the choice they have made. This is used in order to select the type of game, select settings, change the current level difficulty and for post-game decision making. The PhysicsEngine class is an instance of NVIDIAs PhysX engine that contains instructions for simplified creation of physics objects. This class maintains a physics scene and its objects. The AudioPlayer class contains all the code necessary for audio.

5. Technologies Used
This project was entirely programmed in C++. The 3D graphics for the game was handled by the DirectX9 library. In order to calculate collisions and movement, NVIDIAs PhysX engine was used. The game uses the irrKlang audio engine in order to broadcast sound effects.

10

You might also like