Better Random Terrain via Midpoint Displacement

Show us your completed creations made in Construct 2

Post » Tue Nov 29, 2011 8:30 pm




Rewrote it in C2. It's way better now, I think. The first one
I made in C1 was pretty convoluted and confusing, this one is more
straightforward.


Just make sure if you're changing stuff, make sure that you always seed
those first 3 values, or it'll bork.

The HTML

The CAPX

UPDATE!
   -Better performance
   -Made it prettier
   -Some minor changes to the generation

It runs much faster now, and the whole level is displayed.

Made in the free edition, in case anyone is curious.
Any problems, questions or comments, let me know.Intrepid2012-04-20 23:26:31
B
12
S
2
G
4
Posts: 44
Reputation: 2,389

Post » Tue Nov 29, 2011 8:44 pm

Thanks for the example.
Added to the How do I FAQ.Kyatric2011-11-29 20:45:47
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Wed Nov 30, 2011 1:06 am

Thankyou so much for this example, it explains alot to me as i'm learning about arrays in C2 aswell.

Also combined it with Kyatric map generator to get it to create random blocks, so more than one image can be used.
B
40
S
14
G
11
Posts: 243
Reputation: 9,432

Post » Thu Dec 01, 2011 9:50 am

Also pretty cool :D
B
33
S
6
G
7
Posts: 338
Reputation: 7,424

Post » Fri Apr 13, 2012 6:58 pm

Woah. That's rather good!
B
5
G
1
Posts: 23
Reputation: 778

Post » Fri Apr 13, 2012 8:34 pm

Hmm, didn't know this was still generating interest! I'll put some optimizations in, get it going faster.

Also, you can destroy tiles by left clicking them. Don't know why that wasn't mentioned.
B
12
S
2
G
4
Posts: 44
Reputation: 2,389

Post » Fri Apr 20, 2012 11:25 pm

Okay, gave it a performance boost, should run fine even with the bigger levels.
Added some pretties such as grass and bitsolved tiling. If you wanted to,
adding caves to this would be a piece of cake.

If you were willing, this could be stretched into a terraria-lite in the
browser. Browser performance might not be there yet, but it will be soon.
B
12
S
2
G
4
Posts: 44
Reputation: 2,389

Post » Fri Apr 20, 2012 11:32 pm

very nice! reminds the Terraria game =D
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Sat Apr 21, 2012 1:31 am

Very impressive WOW. It's amazing what people can do with Construct 2.
You must have a good logic too to be able to design that kind of stuff.
B
41
S
10
G
7
Posts: 182
Reputation: 9,999

Post » Thu May 24, 2012 4:33 am

Here I gave it a try and optimized code and perfs
terrainGenerator.capx

Didn't know this midpoint algo
Last edited by Yann on Sun Sep 14, 2014 10:34 am, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Next

Return to Completed Creations

Who is online

Users browsing this forum: No registered users and 3 guests