Random terrain via Midpoint Displacement

This forum is currently in read-only mode.
From the Asset Store
Forget about default textbox restrictions, you can create sprites atop of the textbox
  • Exactly what it says in the title.

    <img src="http://i.imgur.com/Ady5h.png">

    Get it here!

    It'll generate random terrain to any power of 2, x-wise.(Pretty sure) You'll have to modify it to do that though. It's thoroughly commented, everything is described, so you

    shouldn't have a hard time if you want to do that.

    Have fun, learn, use it, break it, whatever. I'll try my best to address anything that might come up.

    Feedback always appreciated!

  • I'm really digging this. It seems most random terrain generators always only generate caves so this is cool.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Since I do with a tile-based world where the player can easily add or remove tiles in the game, I decided to just March in a square of each column of the map

  • This is what Needed for my New 3d in a 2d way platform Minecraft!! Tnx!!!

  • Glad to see some of you guys can make use of this :)

    Looking back, it probably would have been a better idea to generate

    it chunk by chunk, like maybe 64 tiles x-wise, instead of in powers of 2.

    This would mean more flexibility, and possibly infinite terrain, x-wise.

    I could probably pound that out if I had some spare time.

    Although if you were going that route, I think perlin noise

    would be better suited for you.

    But a big problem is the array object. It only stores values in a

    long int form(Right?), so 16 bytes per cell/index. So unless you have 4 million different tiles you need unique values for, it's too much memory taken for an application such as large level storage. I'd really like

    a byte array, or the ability to choose the array format(?), that would

    make storing large levels like say, Terraria's worlds, much more feasible.

    Also, if you're creative, you can combine some examples here, and make

    it generate caves too.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)