Maze Generation Algorithms - Recursive Backtrack

11 May, 2017

I have recently been playing around with the idea of generating mazes. This is mostly due to the tower defence game I am working on and generating mazes is a very interesting topic. I have decided to start by implementing the Recursive Backtracker algorithm as it seemed both easy to implement and I like the mazes produced by it. By far the best resource I found while learning about mazes was a blog by Jamis Buck and his book “Mazes for Programmers”.

 

You can see my implementation of the Recursive Backtracker algorithm below.

Maze Seed:


Regenerate

The code is all on my Github

Find best solution to any maze

02 May, 2017

I am currently working on a Tower Defence game with Caleb and Natasha Op’tLand. As part of this game the player will be able to place down towers in such a way that it creates a maze for the enemies to traverse. The enemies should be able to find the best possible solution to any maze that the player creates. The game is based on a 2d grid, A map may look like the following with some towers and rocks blocking the enemy path.

undefined

The numbers represent the path the enemies will use to traverse this maze.

 

The method I have used to solve the maze is by no means the most efficient but it will however always find the best possible solution. This is done by assigning values to tiles beginning with the starting tile and finishing when the end tile has a value assigned. Firstly the starting tile is assigned the value of 1. Tiles adjacent to this are given a value of 2 and then 3 and so on until the end tile is assigned a value.

undefined

Values being assigned to tiles until the end tile is reached.


Once the end tile has a value assigned (In this case 12) we can use this information to backtrack from the end tile to find the solution. This is done by looking for tiles adjacent to the end tile with a value of one less (11). This is repeated until the starting tile is found.

undefined

The final solution being mapped out

 

12 Hour Game Jam

31 July, 2016

undefined

Yesterday I participated in my first ever game Jam in a team of 3 with Natasha Op't Land and Caleb Op't Land. The game jam was hosted by the University of Wollongong. For this game jam we had 12 hours to create A game fitting the theme that was announced on the day. The theme was: "Less is more, More is better".

We spent the first hour brainstorming and sketching out ideas for our game that could fit this theme. We came up with an idea to create a puzzle/maze like game from a top down perspective. But the unique aspect of our game was the decision to have 2 different realms co-exist on top of each other. The two realms would be the 'Overworld' and 'Underworld'.

undefined

Our plan was to create the Overworld in such a way that it appeared very minimal and simplistic, while the underworld would be busy and chaotic. So one realm would be less while the other is more. We decided that all of the hazards and traps in the maze would only be visible from the Underworld while the Overworld would appear as a simple, safe, peaceful place. The image below shows a comparison of the same level as viewed from the Overworld and Underworld. The player is able to switch between realms but can only stay in the Underworld for A limited amount of time.

undefined

Once we had decided on the game we were going to make and a few of the core mechanics we we were about an hour into the game jam. So with 11 hours left we were able to start building the game. Natasha began to design the look and feel of the game and would later create most of the graphics and spritesheets. Caleb began to create some level designs on paper that he would later make into real levels in the game. While I began to create a basic tile-map system that allowed us to have both realms co-exist with only one visible at any given time.

undefined

Once we had the tile-map system working Caleb was able to quickly recreate his sketches into real levels. And we could begin adding elements to the levels. By the end we had 4 different obstacles for the player to face as they progressed through the 8 levels Caleb managed to create. We had boxes to block the players movement, Lava that would kill the player, Portals that would send the player back to the beginning of the level and finally spike balls that would roll around the level and kill the player.

undefined

Towards the end of the jam to all of our surprise we actually had a little time left to go back and fix a few smaller issues that we had ignored in order to get the game to a state where it is complete. All in all I am very surprised in what we were able to achieve in only 12 hours and had a great time at the game jam. Thank to everyone at the University of Wollongong that made the jam happen!

You can play the game in your browser here: http://nathankewley.info/games/2016-UOW-Winter-Game-Jam/

You can download the source for the game here: https://github.com/NathanKewley/2016_UOW_Winter_Game_Jam

Home