the 3d maze

25
THE 3D MAZE RECURSIVE BACKTRACKING MAZE GENERATOR By::: Nishan Pantha(528) Navin Ayer(526) Pusparaj Bhattarai(532)

Upload: jacie

Post on 21-Jan-2016

55 views

Category:

Documents


1 download

DESCRIPTION

THE 3D MAZE. Recursive backtracking maze generator. By::: Nishan Pantha(528 ) Navin Ayer(526 ) Pusparaj Bhattarai(532 ). Objectives. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: THE 3D MAZE

THE 3D MAZE RECURSIVE BACKTRACKING MAZE GENERATOR

By::: Nishan Pantha(528) Navin Ayer(526) Pusparaj Bhattarai(532)

Page 2: THE 3D MAZE

1. To learn Object Oriented Programming in C++.2. To use built-in features and functions of C++ in a simple manner.3. To learn about the graphical programming using OpenGL.4. To learn file streaming (create, write, save and read files).5. To model the real world in programing using OOP.6. To use 3D graphics to make the program look real and user friendly as possible.7. To use the external library and utility…

1. Opengl (Open Graphic Library)2. GLUT (or freeglut)3. SOIL (Simple Opengl Image Library )4. SDL

Objectives

Page 3: THE 3D MAZE

1. Random Maze Generator using Recursive Backtracking Algorithm .2. 3D maze simulation .3. Game is efficient i.e. runs using less memory and processing .

Introduction

Page 4: THE 3D MAZE

1. Inspired from the algorithm of maze solver and maze generator.

2. There are several flash game… from which some are Random maze generator . Till now there are no famous maze game as far our knowledge.

Existing System

Page 5: THE 3D MAZE

1. The game is designed by employing Object Oriented Approach of C++ .2. 3D graphics is done through OpenGL and freeglut(utility) .3. Window and key events through OpenGL and freeglut .4. Texture loading through SDL / SOIL .

Methodology

Page 6: THE 3D MAZE

1. For the gaming lover and puzzle solver……2. For any age group….since it does not contain any violence or scary scene ….3. For people who likes random level than the same one.4. 3D gaming instead of 2D gaming experience . 5 .Complex algorithm into simple programmable code .

Application

Page 7: THE 3D MAZE

Lets take this maze for the description of the algorithm i.e.

Recursive Backtracking Maze Generator

Page 8: THE 3D MAZE

The real maze looks like this after intialization.

Page 9: THE 3D MAZE

Initial position(which is

floor)

Page 10: THE 3D MAZE

No permission to visited the surrounding wall of the whole maze (since they are not surrounded by walls )

Closed(i.e surrounded

by wall)

Closed(i.e surrounded

by wall)

Page 11: THE 3D MAZE

No permission to visited the surrounding wall of the whole maze (since the wall are not closed)

Closed(i.e surrounded

by wall)

Closed(i.e surrounded

by wall)

Lets chose this(random)(we have two case jump

i.e down and right)

Now this place becomes the floor i.e. the path between

initial and final for this case….

Page 12: THE 3D MAZE

Afer many successive recursion let this condition arrises

No permission to visited the surrounding wall of the whole maze (since the wall are not closed)

Closed(i.e surrounded

by wall)

Not Closed(i.e not surrounded by wall from left and down) and for another not

surrounded by wall from left and right

No choice but to jump there

Page 13: THE 3D MAZE

Again Afer many successive recursion let this condition arrises

No permission to visited the surrounding wall of the whole maze (since the wall are not closed)

Not closed(that’s why we jump to next block to avoid unwanted recursion since there is no

condition for visited block)such that backtracking can be done(i.e exiting from present recursion to

back….

No choice but to backtrack to the

condition where there are available closed

block

Page 14: THE 3D MAZE

No permission to visited the surrounding wall of the whole maze (since the wall are not closed)

closed

Move to available block

Again Backtraking Occurs to available condition

Page 15: THE 3D MAZE

No permission to visited the surrounding wall of the whole maze (since the wall are not closed)

Not closed

Now again backtracking occurs to the previous condition until there is a

available condition…….

Again After many successive recursion let this final condition arises

Page 16: THE 3D MAZE

No permission to visited the surrounding wall of the whole maze (since the wall are not closed)

No available condition so…..backtracking occurs to the initial

condition…..

Now backtracking occurs to the initial position……After which the

maze is entirely created….generated…….

Page 17: THE 3D MAZE
Page 18: THE 3D MAZE

Start Game Main Menu

New Maze Instruction High score Credits Exit

Maze Size Input

Gaming Rendering

End Game

Page 19: THE 3D MAZE
Page 20: THE 3D MAZE
Page 21: THE 3D MAZE
Page 22: THE 3D MAZE
Page 23: THE 3D MAZE

1. To find the algorithm for maze generator .2. To change the algorithm into real code.3. To convert 2D maze(2D array) into the 3D world.4. Collision Detection was the hardest part which was solved

using Axis-Aligned Cubic Collision .5. Glut is a C library …so glut callbacks function accepts only

the void function pointers…i.e function pointers to an instance of any class is not accepted by the callbacks.

6. This was solved by creating a bridge/transition class(Engine class) and an anonymous namespace.

Problem Faced and Solution

Page 24: THE 3D MAZE

1. Maximum size of the size is 35 .. To avoid fps drop…….2. There is no 2D view of the maze while playing(accepts

while start).3. There is no 3D model (or animation) in our game.4. Older version of OpenGL(2.1) which does not support

shader implementation and many more….

Limitation

Page 25: THE 3D MAZE

1. Making games is fun and we got to know about various aspects of programming.

2. We learnt about team work and work division

Conclusion