User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: random map generation

  1. #1
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    random map generation

    Hi guys, does anyone have an ideas on creating a random map generator? I have made some with mild success, but the maps generated arnt in the style I am going for. What I want to do is create maps similar to Age of Empires 2 or Civilization.

    My current method starts with a map filled with water, and creates a certain number of seeds in random positions on the map. Then it loops through each seed and moves it in a random direction each time, turning the current cell into grass. This works OK and creates a bunch of land on the water, but I want something better.

    I have done a google search but I think I am using the qrong descriptions. I have read into height maps and perlin noise, and they might do what I want however most of them are programs which generates maps, what I want to be able to do is do everything in MMF2 on the fly... Any ideas/links?

    Edit: BTW this is for a 2D grid style game.

  2. #2
    Clicker Fusion 2.5 MaciOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Shadoku's Avatar
    Join Date
    Jul 2006
    Posts
    72
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: random map generation

    Here's a fairly simple way to do it http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=135929&#Post135 929

    This picks a predefined number of seed spots at runtime, and then "grows" them over several iterations, with random noise factored in. This method tends to produce nice landmasses.
    Obviously in a real game this would use backdrop objects and a much finer resolution, this is just to illustrate the general technique.

  3. #3
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: random map generation

    Thanks, thats pretty close to what I am after. I will try to run through your code and make sense of it and see what I can come up with.

    If anyone else has some examples or links, please send my way :P

  4. #4
    Clicker Multimedia Fusion 2iOS Export ModuleXNA Export Module
    Asholay's Avatar
    Join Date
    Nov 2008
    Location
    England
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: random map generation

    Bigredron - in my current game, in order to make "Random" dungeon levels, I have about 100 grid patterns saved as arrays which I know work, and make playable levels. This stores the location of various building blocks for a level - e.g. corner pieces, open land and dead-ends.

    Then, when a player needs a "random" dungeon creating, I just randomly select one of those 100 grids and load the building blocks as appropriate via the array.

    It works an absolute treat, and it means you can even 'sway' the randomness by doing things such as 1-20 are easy levels, 21-40 are medium open spaced levels, 41-60 are hard ones, 61+ are all specific levels, etc...

    It's only Pseudo-Random but still gives the illusion of randomness.

  5. #5
    Clicker Fusion 2.5 MaciOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Shadoku's Avatar
    Join Date
    Jul 2006
    Posts
    72
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: random map generation

    I'll run through and add comments to my example later today. Sorry I didnt do that to begin with, I had been up for like twenty six hours, so I was just trying to get it done and posted :whistle:

  6. #6
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Aug 2006
    Location
    USA
    Posts
    2,970
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: random map generation

    Quote Originally Posted by Asholay
    Bigredron - in my current game, in order to make "Random" dungeon levels, I have about 100 grid patterns saved as arrays which I know work, and make playable levels. This stores the location of various building blocks for a level - e.g. corner pieces, open land and dead-ends.

    Then, when a player needs a "random" dungeon creating, I just randomly select one of those 100 grids and load the building blocks as appropriate via the array.

    It works an absolute treat, and it means you can even 'sway' the randomness by doing things such as 1-20 are easy levels, 21-40 are medium open spaced levels, 41-60 are hard ones, 61+ are all specific levels, etc...

    It's only Pseudo-Random but still gives the illusion of randomness.
    That's pretty cool. I'm pretty sure that's how Blizzard made Diablo as well. Because you'll notice that even though the dungeons are random, there are familiar pieces in them.

  7. #7
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: random map generation

    Quote Originally Posted by Asholay
    Bigredron - in my current game, in order to make "Random" dungeon levels, I have about 100 grid patterns saved as arrays which I know work, and make playable levels. This stores the location of various building blocks for a level - e.g. corner pieces, open land and dead-ends.

    Then, when a player needs a "random" dungeon creating, I just randomly select one of those 100 grids and load the building blocks as appropriate via the array.

    It works an absolute treat, and it means you can even 'sway' the randomness by doing things such as 1-20 are easy levels, 21-40 are medium open spaced levels, 41-60 are hard ones, 61+ are all specific levels, etc...

    It's only Pseudo-Random but still gives the illusion of randomness.
    Are you saying that you had some pre-saved shapes or patterns, which you overlayed over eachother to create a random room? If so that could work I guess. I could overlap blobs of land over eachother is a random fashion to create islands and stuff - hmm good idea! Keep them coming guys

  8. #8
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: random map generation

    Quote Originally Posted by Shadoku
    I'll run through and add comments to my example later today. Sorry I didnt do that to begin with, I had been up for like twenty six hours, so I was just trying to get it done and posted :whistle:
    I ended up figuring it out I think. I was just too tired last night to put my mind to work but i think I got the most of it.
    What you did was create random seeds and then loop through each cell to see if it was touching land and if so, randomly decide wether or not it turned into a land cell or not. Was this correct?

    That was something I also thought of but failed miserably when trying to code it. The problem is I work on these things late at night when my mind just wants to sleep

  9. #9
    Clicker Multimedia Fusion 2iOS Export ModuleXNA Export Module
    Asholay's Avatar
    Join Date
    Nov 2008
    Location
    England
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: random map generation

    Ron - not quite. For example, I have 100 or so arrays like this (on a much larger scale, and more complex):

    1/2/2/3
    4/5/5/6
    4/5/6/6
    7/8/8/9

    1) corner piece with a downwards staircase
    2) top wall of a dungeon
    3) corner piece
    4) left wall
    5) open space
    etc, etc

    I have in total, 37 building blocks, and the arrays I have created, place these blocks in their set order which creates a nice dungeon level - with passageways, open caverns, etc, etc.

    This way, I have one single screen, which loads a dungeon level. Then, when the player goes down a set of stairs, into a lower dungeon lever, it darkens the players torches to simulate them going down stairs, while secretly redrawing the building blocks into a new dungeon, and replacing all the game objects. Then finally, lights up the players torches, as they come down their new set of stairs, into a new dungeon. The effect is excellent.

    You can also remember the 'random' seed pattern which was used as they descend into dungeons, and then replay it as the re-ascend to the surface, which adds to the realism.

  10. #10
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Aug 2006
    Location
    USA
    Posts
    2,970
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: random map generation

    @Asholay:

    So, you manually set the array values to store the dungeon layouts? And just had a ton of different array sets to "build" the dungeons "randomly"? Or am I not undertanding correctly?

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Random Dungeon Generation
    By nivram in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 30th October 2011, 08:14 PM
  2. Random Cave Generation...
    By MatthewJTabin in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 10th July 2011, 04:39 PM
  3. Random terrain generation
    By ac3raven in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 21st June 2011, 03:24 AM
  4. Random Number Generation
    By AngelicTech in forum SWF/Flash Export Module Version 2.0
    Replies: 3
    Last Post: 2nd July 2010, 03:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •