User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 11 of 11

Thread: Trying to do my first procedural generated map, problems.

  1. #11
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Popcorn View Post
    Your method doesn't crash for me when I set X dimension index to 0 in the same event that adds 1 to the Y dimension index.
    Ah that is true thanks

    So now I am trying to do the next step, actually digging out the map and then writing it out. But I dont seem to get it right :/ I have managed to write out blocks on the whole "map" by adding blocks to all array cells with the Id 1. But when i try to do this digging part nothing is placed out..

    Is there any tutorials on these things?

    "CREATE THE MAP
    The first thing that my generation code does is create a 2D vector (array), containing ID’s (integers) of the different types of cells. To start, I create a 400×300 size grid, all with the value “1″. In my case, ID=1 stood for walls, and ID=0 stood for empty space (titled floors, even though they’re not, really). Later on I add Water, which is ID=3, but that’s not important right now.
    THE MINER
    Once the map is created, I then create a “miner”. In my case this is actually just called a “Cell”, but it makes more sense if you consider it to be a miner. The miner is created in the center of the map (200×150) and is labeled as “active”. When generating the map, I create a loop that goes through every active miner, and runs their “dig” function. When the miner “digs”, it picks a random cell around it, that is not yet an empty space (ID=0) and digs it out, moving itself in that direction.
    For example, if the miner was at 5×4, and decided to move UP, it would dig out the cell 5×3, and move itself there.
    Whenever a miner digs, it also has a small chance of spawning a new miner in a random direction. In my generation code, the chance is about 8% that a new miner is added.
    If a miner has no walls surrounding it (ID=1) then it unactivates itself, and stops digging. If this miner happens to be the last miner alive, then it just moves around until it finds a new wall to start digging."
    Attached files Attached files

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Procedural Generation(Sort of..)
    By JimmyTHicks in forum The Games Factory 2 - Technical Support
    Replies: 9
    Last Post: 3rd June 2013, 03:42 PM
  2. MMF2 Procedural Terrain generation (Incomplete)
    By Watermelon786 in forum File Archive
    Replies: 10
    Last Post: 8th November 2010, 01:33 AM
  3. Noise. Procedural methods wanted
    By Tiles in forum Multimedia Fusion 2 - Technical Support
    Replies: 13
    Last Post: 30th January 2008, 12:02 PM

Posting Permissions

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