Smooth island edges in terrain generation

Discussion in 'Spigot Plugin Development' started by jetp250, May 13, 2017.

  1. I'll be bombing the forums with world generation related questions for some time now.

    So, I have a floating island generator - which, of course, generates floating islands - but what doesn't really please me are the edges of the islands. I'd like them to be smooth and 'natural'.

    Right now, I'm using the following to smoothen the edges a bit: (the 'sub' part)
    Code (Java):
    final float bottom = noise_2.noise(realX, realZ, 1.4F, 0.81F) * 32 + 100;
    float top = noise.noise(realX, realZ, 0.2F, 0.1F) * 8 + 90;
    final float sub = top - bottom;
    if (sub < 20) {
        top -= (15 - sub) * 0.225F;
    }
    .. but this sometimes messes with not just the edges, but when the bottom is too close to the top, meaning there'll be some pretty rough-looking terrain every here and there:
    [​IMG]
    Which of course is not wanted.

    I played around with the values (20, 15, 0.245 et cetera) but didn't quite find this would be the best way to achieve what I want. Is there a better way to do this?

    The full source can be found here if you need to see the rest.

    Thanks!

    EDIT: Replaced the image with a better one