Search Unity

Random 2d Terrain

Discussion in 'Works In Progress - Archive' started by TheValar, Sep 6, 2013.

  1. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    I've recently been doing some research into random terrain generation like what is done in tiny wings. I've looked quite a bit and it seems that a lot of people are interested in this but there isn't really a publicly available solution.

    Therefore I give you my new project for Creating Random 2d Terrain!!!

    $Unity Web Player  Random 2d Terrain - Google Chrome_2013-09-06_13-16-28.png

    Here is the Web Player Demo of what I have so far.
    https://dl.dropboxusercontent.com/u/37459431/Random2dTerrain/Random2dTerrain.html

    Here's what's basically happening...

    1: A list of y coordinates are randomly generated at equal intervals along the x axis
    2: Additional points between these primary values are generated through cosine interpolation to give smoother curves
    3: The list of points are taken and used to generate a bunch of rectangles that form our terrain mesh.

    Things that need to be done
    • Use perlin noise instead of simple random values
    • better texture mapping to enable good looking terrain
    • Allow for additional meshes to be created at runtime and added seamlessly to the previous ones

    It would be sweet if people from the community more awesome than myself could run with this a bit and make it more feature filled.

    Here is a .zip of the project file. :D
    https://dl.dropboxusercontent.com/u/37459431/2dPerlinTerrain.zip
     
    Gizrik likes this.
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,411
  3. DougMcFarlane

    DougMcFarlane

    Joined:
    Apr 25, 2009
    Posts:
    197
  4. Nexgea

    Nexgea

    Joined:
    Nov 17, 2013
    Posts:
    43
    Awesome, but how can I add colider to new genereted terrain?
     
  5. hottabych

    hottabych

    Joined:
    Apr 18, 2015
    Posts:
    107
    Link is broken. Could you reupload?