Author Topic: Land generate  (Read 3022 times)

default lol.

so how do you gen it anyways. does it like take the nearby spawns and say spawn the next one at a 4 out of 5 chance of same land type, 4 out of 5 chance of same height level? so it eventually spawns notable landscape "areas" of a certain type, rather then complete random.

default lol.

so how do you gen it anyways. does it like take the nearby spawns and say spawn the next one at a 4 out of 5 chance of same land type, 4 out of 5 chance of same height level? so it eventually spawns notable landscape "areas" of a certain type, rather then complete random.

Here's what it does:
It starts when I say /setLandscape and place a brick (the brick is the center position), and over time it places more 32x cubes around the center position.
When it places a new cube, it gives it a random height value, then it looks around and changes the value based on what it is surrounded by.
So if we have a new cube with 100 height surrounded by cubes with 50 height, it will come down further, closer to 50 height (which creates the smooth terrain height changes as opposed to none of this smoothing which would be utter chaos)
In addition to this smoothing, if a height value is close enough to a neighboring height value, it will become that value (so there's larger flat areas instead of areas that are close to flat but not quite)

Land type is determined by height; different heights have different colors and the waterlevel is also at a certain height.

There are a few mechanisms in place to let it spawn notable areas:
- First, there's a chance an area will be labeled as "flat", in which case all neighboring areas will be placed at the same height as said area. This makes some larger flat areas for building.
- Secondly, there's a function called raise and flatten, which has a chance of raising an area up much higher than it normally could go and then labeling it flat as described above. This makes plateaus and nice flat mountain areas to build on.
- Thirdly, the area around the center position is always around the same height and flat. If you look in the screens I posted, you can see this, as the center is pretty level and open. Personally I think this is a good feature.

All of this is tweakable and can be disabled and so forth, but it gives the landscape some character.

What I'll be adding next is more definite land types that it will add in at random and form areas out of. Things like deserts, a wild-west style theme, and whatever else I come up with. These will change the color scheme in their areas and also have some effects on height and waterlevel.

so there could be "rivers" that aren't associated with the same land type as "lakes" and can extend from land type to land type as it crawls outward. like river cutting from snow, sand, stone, dark grass without messing up the landscape spawning?

so there could be "rivers" that aren't associated with the same land type as "lakes" and can extend from land type to land type as it crawls outward. like river cutting from snow, sand, stone, dark grass without messing up the landscape spawning?

Yes, this could happen.
Implementation would basically be:
-random chance of labeling a cube as 'river'
-this cube spawns below water level
-next cube placed adjacent to this cube is labeled as 'river'; disables river setting for first cube.
-this cube spawns below water level
 and so on

I'm going to PM you the version I have right now and then start adding some of these new features I've been blabbing about.