User Tag List

Results 1 to 5 of 5

Thread: Random terrain generation

  1. #1
    Clicker Multimedia Fusion 2 DeveloperAndroid Export Module

    Join Date
    May 2010
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Random terrain generation

    I'm making a tiny side-scrolling platformer game and I need to generate levels procedurally. The levels consist only of blocks, so its nothing fancy. What's the best way to go about this in Fusion?

  2. #2
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Random terrain generation

    You can make it crazy - randomly generating between a max height, min height, and making sure the player can always jump it - or, you can get procedural and generate 'areas' where each area has a different generation theme - eg, flat areas, pillar areas, platform areas, etc.
    Working as fast as I can on Fusion 3

  3. #3
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)

    Re: Random terrain generation

    There are lots of ways to go about this, depending on what exactly you want.
    However you do it, you're likely going to want to store the level in an array to begin with.

    For example:
    * Run a fastloop to iterate through each array cell, and fill it with a random value - either 0 (empty) or 1 (solid ground).
    * Run more fastloops to perform some kind of "cellular automation", to change the value of each cell based on the values of surrounding cells (google "random cave generation" / "cellular automata").
    * Run more fastloops to change the appearance of tiles, based on whether there are other tiles nearby (not essential, but it makes the level look much more attractive).
    eg: http://www.create-games.com/article.asp?id=1869
    * Randomly place items, enemies, etc.

    If you want more interesting looking levels, you might also pre-fabricate some level components (groups of tiles), and randomly add them to the level.

    The big problem with a platformer, is that you have gravity to worry about. You have to find a way to ensure that the level can be completed - that important objects aren't positioned out of reach. You might do this by strategically placing ladders etc (may require a pathfinding extension), or by using some kind of terrain destruction, or by giving the player abilities such as flying or rope/grappling hook etc (like the Ninja Rope in Worms).

    It also gets much more complicated if you want any kind of lock mechanisms - you'd then need to ensure that the keys are not behind the door they unlock.

  4. #4
    Clicker Multimedia Fusion 2 DeveloperAndroid Export Module

    Join Date
    May 2010
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Random terrain generation

    Okay, my main problem is that I have no idea how to handle arrays in Fusion. Is there a tutorial for making levels using arrays? The link above explicitly states that it won't cover specific use of arrays


  5. #5
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: Random terrain generation

    I have a open source World Editor on my website. It uses an array.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

Similar Threads

  1. Random Generated 2D Terrain?
    By Outcast in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 9th October 2012, 05:26 PM
  2. MMF2 Procedural Terrain generation (Incomplete)
    By Watermelon786 in forum File Archive
    Replies: 10
    Last Post: 8th November 2010, 01:33 AM
  3. generate random terrain (for chrilley)
    By Tisnart in forum File Archive
    Replies: 0
    Last Post: 2nd January 2010, 04:52 PM
  4. Random overhead terrain generation for Bigredron
    By Shadoku in forum File Archive
    Replies: 1
    Last Post: 31st March 2009, 08:46 AM
  5. Random Terrain Generator
    By Brandon in forum File Archive
    Replies: 3
    Last Post: 1st January 2007, 09: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
  •