Presentation is loading. Please wait.

Presentation is loading. Please wait.

Recursive backtracking maze generator

Similar presentations


Presentation on theme: "Recursive backtracking maze generator"— Presentation transcript:

1 Recursive backtracking maze generator
THE 3D MAZE Recursive backtracking maze generator By::: Nishan Pantha(528) Navin Ayer(526) Pusparaj Bhattarai(532)

2 Objectives 1. To learn Object Oriented Programming in C 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

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

4 Existing System 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.

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

6 Application 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 Complex algorithm into simple programmable code .

7 Recursive Backtracking Maze Generator
Lets take this maze for the description of the algorithm i.e. Recursive Backtracking Maze Generator

8 The real maze looks like this after intialization.

9 Initial position(which is floor)

10 Closed(i.e surrounded by wall)
No permission to visited the surrounding wall of the whole maze (since they are not surrounded by walls )

11 Closed(i.e surrounded by wall)
Now this place becomes the floor i.e. the path between initial and final for this case…. Closed(i.e surrounded by wall) Lets chose this(random)(we have two case jump i.e down and right) No permission to visited the surrounding wall of the whole maze (since the wall are not closed)

12 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 Closed(i.e surrounded by wall) Afer many successive recursion let this condition arrises No choice but to jump there No permission to visited the surrounding wall of the whole maze (since the wall are not closed)

13 Again Afer many successive recursion let this condition arrises
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…. Again Afer many successive recursion let this condition arrises No choice but to backtrack to the condition where there are available closed block No permission to visited the surrounding wall of the whole maze (since the wall are not closed)

14 Again Backtraking Occurs to available condition
closed Again Backtraking Occurs to available condition Move to available block No permission to visited the surrounding wall of the whole maze (since the wall are not closed)

15 Again After many successive recursion let this final condition arises
Not closed Now again backtracking occurs to the previous condition until there is a available condition……. No permission to visited the surrounding wall of the whole maze (since the wall are not closed)

16 No available condition so…
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……. No permission to visited the surrounding wall of the whole maze (since the wall are not closed)

17

18 Start Game Main Menu New Maze Instruction High score Credits Exit Maze Size Input End Game Gaming Rendering

19

20

21

22

23 Problem Faced and Solution
To find the algorithm for maze generator . To change the algorithm into real code. To convert 2D maze(2D array) into the 3D world. Collision Detection was the hardest part which was solved using Axis-Aligned Cubic Collision . 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. This was solved by creating a bridge/transition class(Engine class) and an anonymous namespace.

24 Limitation Maximum size of the size is To avoid fps drop……. There is no 2D view of the maze while playing(accepts while start). There is no 3D model (or animation) in our game. Older version of OpenGL(2.1) which does not support shader implementation and many more….

25 Conclusion Making games is fun and we got to know about various aspects of programming. We learnt about team work and work division


Download ppt "Recursive backtracking maze generator"

Similar presentations


Ads by Google