It’s procedural maze generation time!

Hello everybody!

Recently I’ve been working on a procedural maze generator in Unity 3D. It’s been coming along excellently and it’s even in a playable demo right now.

Screenshot from the playable demo

Screenshot from the playable demo

Anyway, I’m writing this post to release the package! There’s not much to it, and I don’t have a YouTube video explaining yet (coming soon, probably), but the package can be located here. It’s pretty close to ready to run out of the box, simply create an empty and attach the MazeGenerator script to it. It comes with a couple prefabs that you can place on the inspector for the script (Outer Walls/Walls/Ceiling/Floors). Then, after that’s all set up all you’ll have to do is hit run and it’ll generate the maze starting wherever starting coords is.

You can also hook into the script to get a list of the rooms using something like:

_mazeScript = (MazeGenerator) GameObject.Find("MazeGenerationObject").GetComponent(typeof (MazeGenerator));
var rooms = _mazeScript.Rooms;

After that, then you have a C# List<int[]> of Rooms. The integer array is always 5 length (I know this is a terrible way to do this, I’m sorry) and those are indexed as follows:

0: Starting X
1: Starting Z
2: Y index
3: Length of room (Length = X)
4: Width of room (Width = Z)

So, for example, the code I use for placing a player in a random room is as follows:

var randomRoom = Random.Range(0, _mazeScript.Rooms.Count);
var floatArray = _mazeScript.Rooms[randomRoom];
if (floatArray != null)
{
var minX = floatArray[0];
var minZ = floatArray[1];
var y = floatArray[2];
var maxX = minX + floatArray[3];
var maxZ = minY + floatArray[4];
Instantiate(Player, new Vector3((minX + maxX)/2, y+1, (minZ + maxZ)/2), new Quaternion(0,0,0,0));
}

(I need a better code formatter for WordPress…)
Anyway, you should get the point by now. If you have any questions/comments/concerns, leave a message and I’ll try to address it ASAP. I’ll try to make the YouTube video go into depth and try to show you some of the stuff I’m doing.

Thanks for reading!

Yours,
Shane

Posted in Scripts | Tagged , , , , , , | Leave a comment

2D Tile Management Tool

Hello everybody!

 

Recently I created a 2D Tile Management tool for Unity3D. It’s not much, but it should allow developers to more quickly map some tile-based 2D areas.

Tile Manager Icon

I posted a YouTube video about it and I have Unity3D package you can import for it. I’m also trying to upload it to the asset store for free, but that could take up to a week.

Anyway, if you have any suggestions for it, please let me know. I’d like to expand upon it as much as possible.

Yours,
Shane

Posted in Scripts | Tagged , , | Leave a comment

Welcome to Epic Fail Inc.

Greetings!

Epic Fail Inc. was created as an attempt at creating an indie “game company”. We originally conceived the idea during the GitHub Game-off that occurred from November to December 2012.

Boom game preview

Title screen of “Boom”

Our first game, “Boom”, was our submission to the Github Game-Off.

Since the Github Game-off, we have decided to try OneGameAMonth, where during the next 12 months (all of next year) we will try to produce one entire game a month.

So, stick around and watch us progress as we try to push out one game a month. We’ll probably be taking game ideas from this video game name generator, but if you have ideas feel free to post them.

Yours,
Shane

Posted in Uncategorized | Tagged , , , | Leave a comment