Langerz82 Posted March 20, 2019 Share Posted March 20, 2019 Hello, 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. Quote Link to comment Share on other sites More sharing options...
mattstyles Posted March 20, 2019 Share Posted March 20, 2019 Howdy, sounds good. What methods did you use to get your map generation? Quote Link to comment Share on other sites More sharing options...
Langerz82 Posted March 21, 2019 Author Share Posted March 21, 2019 Hello, The methods I used are here: https://gist.github.com/Langerz82/d4d4291d7aa9d846ed64ab1bb27a9142 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. mattstyles 1 Quote Link to comment Share on other sites More sharing options...
grelf Posted March 27, 2019 Share Posted March 27, 2019 A method of generating dungeons can be seen here: https://grelf.net/forestdesign.html#N657813 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: https://grelf.net/foresthistory.html#N656637 To see my code in action go to https://www.myforest.uk?x=15475.55&y=6085.52&b=100 , go to the scene (key s) and move forward (up arrow). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.