How to generate random shaped island with perlin noise

So I have the basics of generating the island, but it’s completely square and has unfinished edges. I was wondering if it’s possible and then how would I make it generate as a random shape, something like this:

e9e1542e182ab6930b0fad1743f5c5444c65b61b

Any help is appreciated!

1 Like

I have somewhat made something similar:

which uses FBM and i applied a Island gradient to every y value. I could give you some functions after I found the place

2 Likes

Alright yeah that’d be great \\\\\

1 Like

ok so i finally loaded in and this is the gradient function:

-- apply an island gradient
function Static:ApplyGradient(x: number, y: number, z: number): number
    local distance_x = math.abs(x - self.width * 0.5)
    local distance_y = math.abs(z - self.height * 0.5)
    local distance = math.sqrt(distance_x*distance_x + distance_y*distance_y)

    local max_width = self.width * 0.5 - 10.0
    local delta = distance / max_width
    local gradient = delta * delta

    return y * math.max(0.0, 1.0 - gradient)
    -- return y
end

i forgot the source where i got this but you can modify it to fit your needs

1 Like

Ill give it a test, if it works I’ll mark this as the solution

2 Likes

I may have done sumethin wrong but, it made it more flat

Just to be sure, what are the x, y and z args more exactly?
Also width and height, cause I don’t seem to be using width or anythin

1 Like

You don’t You can use the height to create a more organic edge, by lowering certain areas under the water, instead of moving them left to right (which’ll create holes)

1 Like

Found out about math.noise not so long ago and overall most of these math functions are new so I don’t know much here yet. But to make sure that in:

the argument x is the x index of the total island’s x axis and vice versa with z, but what i dont get is the width, height and y

1 Like

Actually to simplify this, found a lot of people mentioning a Falloff map,

How would I do this instead? Cause I think that might be the solution

1 Like

Seems to me that they got this code from a 2d application, stuck on the z but didn’t bother changing the variable names.

But you should calculate the height of every tile based on the perlin noise and the seed.
Calculate the falloff, which is probably dependent on the result of the perlin noise + the coords. The faloff is a modifier, that you can then apply to the tile.

1 Like

English isn’t a primary, how would I begin to do this practically?

1 Like
  1. You have a formula to calculate the noise at a position (X,Z). The result of the calculation = Y coordinate. Place the tile at that position (X,Y,Z).

  2. As for falloff, if you have a formula, you can just do the same: plug in X,Z as parameter, and it returns the Y. You can then combine the Y from step 1 and 2, to find the modified height of the tile.

1 Like

I feel like I know how to do it, but I cant make the map 100x100, cause of script timeout. So I’m kinda stuck here and idk what to do

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.