Randomly Generated Maps

When I first started this project, I thought this was going to be the easiest part of it. Well, I haven’t been proven wrong but it certainly is a long task to complete. Never thought I had to think of all the different possibilities it could go wrong so that I could avoid them. So I’ll describe how I came to manage it so far.

Binary Space Partitioning

If you are part of the GameMaker Community, you might of come across Nocturne’s game development posts about his game Skein and how he generated random maps. Well so did I. I read a bunch of pages about BSP trees and tried to make them myself with a bit of help from examples. What I ended up with was a solution that worked pretty well even though the code is incomplete.

No two maps are the same.
No two maps are the same.


Spelunky is a game well known for it’s use of randomly generated maps. If you want the more technical side of how it works, you can visit this webpage. In summary, Spelunky generates it’s maps in chunks and always makes sure there is a path from the start of the map until the exit. My game requires things such as corridors which is why I’m using BSP trees over this option but this type of generation can still be useful. Maybe I could use it to generate the content of the rooms created by the BSP tree? I’ll experiment with that.

Spelunky generated some really tricky maps.
Spelunky generated some really tricky maps.

Try it out

Here’s the prototype of my randomly generated room solution in HTML5. I would appreciate any feedback.


Now to try to link randomly generated maps and randomly generated missions for a random story line unique to the player. Does that kind of game interest you?

Leave a comment below about what you think about my approach to generating random maps!


4 thoughts on “Randomly Generated Maps

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s