2D Overhead - Randomly Generated Maps

Recommended Posts


I created a Randomly Generated Map with a new system I created and wanted to share with you all the results. It still has some minor bugs but overall its looking pretty good. Dungeons are gonna be hard to auto-generate.

This will be part of my upcoming game Retro RPG Online 2. The tiled resources are courtesy of BrowserQuest.



Share this post

Link to post
Share on other sites


The methods I used are here:

Apologies on the lack of documentation as I am still coding it. Basically each map object needs a array of the tiles it going to use. Then apply the right function to it. The first function supports erosion which removes the underlying tiles for optimization purposes. After the map is generated I simply loaded it in Phaser and bam new map.

I'm going to use this code to support Retro RPG Online so it will have a massive amounts of maps. You still may need to tweak the map generator to get your desired results especially the avoiding placements of Objects with other layers. If anybody creates a working dungeon generator please share it, as that is the next thing I will be working on after I get some more resources put into the maps so they are more dynamic.



Share this post

Link to post
Share on other sites

A method of generating dungeons can be seen here: except that I call them mines. A very small portion of the map generated by that can be seen below, in which the red squares are mineshafts coming down from the ground above (positions generated as part of a more complicated map, described elsewhere in the document linked above).
You will note that the code shows that the map will be symmetrical about the line x = y but a slightly more complicated formula could change that. I use digits of PI shifted up to get more randomness.
I only have one level of mines but obviously a third coordinate, z, could be included in the formula to get more levels.
I first used this kind of method in the early 1980s and I have put copies of magazine articles about it on my history page:
To see my code in action go to , go to the scene (key s) and move forward (up arrow).


Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.