Random terrain via Midpoint Displacement

Post your own tutorials, guides and demos.

Post » Sun Jun 12, 2011 12:32 am

Exactly what it says in the title.



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!
B
12
S
2
G
4
Posts: 44
Reputation: 2,389

Post » Sun Jun 12, 2011 5:32 am

I'm really digging this. It seems most random terrain generators always only generate caves so this is cool.
B
5
S
1
G
2
Posts: 99
Reputation: 1,575

Post » Fri Jul 08, 2011 11:57 am

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

B
2
G
1
Posts: 2
Reputation: 454

Post » Mon Aug 08, 2011 5:27 pm

This is what Needed for my New 3d in a 2d way platform Minecraft!! Tnx!!!
B
7
S
2
G
1
Posts: 193
Reputation: 1,745

Post » Tue Aug 09, 2011 8:31 pm

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.
B
12
S
2
G
4
Posts: 44
Reputation: 2,389


Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 1 guest