Procedural Terrain Generation

Get help using Construct 2

Post » Sun Jul 27, 2014 6:17 pm

Before I go into specifics I'd like to mention that I'm not looking for a block-generator like Terraria.

Here's what I'm looking to accomplish:

    At the lowest level, to generate a smooth terrain. https://www.youtube.com/watch?v=nPX8dw283X4 This is the kind of thing I'm looking at achieving but to be able to fully generate a world before the player spawns.

    I'd also like to generate cave systems but I don't know if I can have them dig into the pre-generated terrain or if they'd be part of that generation.

    The next level of generation would be the man-made entities. Trees, rocks, lakes, npc's etc. Things that are influenced by the terrain layout but don't influence it themselves.

I have no intentions of having the player dig or mine so no terrain deformation or anything like that is needed.

I've searched online but so far everything is either tile-based or for 3D engines.
B
3
Posts: 6
Reputation: 175

Post » Sun Jul 27, 2014 6:24 pm

"I've searched online but so far everything is either tile-based or for 3D engines."

Ok which one do you want?
Image ImageImage
B
171
S
50
G
180
Posts: 8,394
Reputation: 113,982

Post » Sun Jul 27, 2014 6:31 pm

newt wrote:"I've searched online but so far everything is either tile-based or for 3D engines."

Ok which one do you want?


The video is a really good example of what I have envisioned. The challenges I'd face would be figuring out how to generate a whole map, how to use one texture to do it all and how to randomly place my own pre-made objects like trees and the like.

Maybe I'm not explaining it well enough. It really sucks when you have an idea in your head but can't explain it.
B
3
Posts: 6
Reputation: 175

Post » Sun Jul 27, 2014 7:05 pm

You might want to read up on how Spelunky does it:

http://tinysubversions.com/spelunkyGen/
B
62
S
23
G
10
Posts: 647
Reputation: 10,578

Post » Sun Jul 27, 2014 7:10 pm

The one in the vid is 3d, so your options here are somewhat limited.
While it should be possible to do those kind of curves, the likelihood of it having a good frame rate are slim.
Then a tile based solution could only have hills, and or caves of a specific size, or grade, but you could have a few different types to mix, and match.

You wouldn't figure out the whole map, best bet would be to take a seeded random and interpolate the noise to create a curve.
Image ImageImage
B
171
S
50
G
180
Posts: 8,394
Reputation: 113,982

Post » Mon Jul 28, 2014 3:44 am

For starters. a single sprite, multiple frames. Width, height, scale are all values that can be modified on the fly to get variation between the same piece. not to mention flipping/reflecting a sprite.

The sprite, should create and destroy itself. (if using multiple sprites instead of frames, they should create and destroy each other)

at higher speeds, if the sprite is not in control of its own creation and destruction, (for instance you have a separate object that spawns the pieces) the game will break apart. Pieces won't align.

I would share a demo, but being an idiot I formated my drives before I published.....lost a good deal. sadly my dropbox has an old broken implementation.
But hey, next time around I have plenty of room for improvement. good learning process haha.
B
28
S
8
G
1
Posts: 226
Reputation: 2,865


Return to How do I....?

Who is online

Users browsing this forum: jezjones24, maranpis and 22 guests