alwynd alwynd mentioned Perlin noise. Here's how I generated the island shapes for the polygon map generator:
- Generate perlin noise.
- For each location
(x, y)
in the noise bitmap, compute the distance from the center, normalized so that the bitmap is 2x2:(dx, dy) = (2 * x / width - 1, 2 * y / height - 1); d = sqrt(dx*dx + dy*dy)
. - Location
(x, y)
is part of the island ifnoise[x, y] > 0.3 + 0.4*d*d
. This step attempts to make the shape round by cutting off areas that are far from the center.
Islands are a little more ragged than lakes though, so I'm not sure if these shapes will be to your liking. I've put up a demo of the above algorithm, with buttons at the bottom to control the two magic numbers. There might be different values of the magic numbers 0.3 and 0.4 that produce shapes you like.
alwynd mentioned Perlin noise. Here's how I generated the island shapes for the polygon map generator:
- Generate perlin noise.
- For each location
(x, y)
in the noise bitmap, compute the distance from the center, normalized so that the bitmap is 2x2:(dx, dy) = (2 * x / width - 1, 2 * y / height - 1); d = sqrt(dx*dx + dy*dy)
. - Location
(x, y)
is part of the island ifnoise[x, y] > 0.3 + 0.4*d*d
. This step attempts to make the shape round by cutting off areas that are far from the center.
Islands are a little more ragged than lakes though, so I'm not sure if these shapes will be to your liking. I've put up a demo of the above algorithm, with buttons at the bottom to control the two magic numbers. There might be different values of the magic numbers 0.3 and 0.4 that produce shapes you like.
alwynd mentioned Perlin noise. Here's how I generated the island shapes for the polygon map generator:
- Generate perlin noise.
- For each location
(x, y)
in the noise bitmap, compute the distance from the center, normalized so that the bitmap is 2x2:(dx, dy) = (2 * x / width - 1, 2 * y / height - 1); d = sqrt(dx*dx + dy*dy)
. - Location
(x, y)
is part of the island ifnoise[x, y] > 0.3 + 0.4*d*d
. This step attempts to make the shape round by cutting off areas that are far from the center.
Islands are a little more ragged than lakes though, so I'm not sure if these shapes will be to your liking. I've put up a demo of the above algorithm, with buttons at the bottom to control the two magic numbers. There might be different values of the magic numbers 0.3 and 0.4 that produce shapes you like.
alwynd mentioned Perlin noise. Here's how I generated the island shapes for the polygon map generator:
- Generate perlin noise.
- For each location
(x, y)
in the noise bitmap, compute the distance from the center, normalized so that the bitmap is 2x2:(dx, dy) = (2 * x / width - 1, 2 * y / height - 1); d = sqrt(dx*dx + dy*dy)
. - Location
(x, y)
is part of the island ifnoise[x, y] > 0.3 + 0.4*d*d
. This step attempts to make the shape round by cutting off areas that are far from the center.
Islands are a little more ragged than lakes though, so I'm not sure if these shapes will be to your liking. I've put up a demo of the above algorithm, with buttons at the bottom to control the two magic numbers. There might be different values of the magic numbers 0.3 and 0.4 that produce shapes you like.
alwynd mentioned Perlin noise. Here's how I generated the island shapes for the polygon map generator:
- Generate perlin noise.
- For each location
(x, y)
in the noise bitmap, compute the distance from the center, normalized so that the bitmap is 2x2:(dx, dy) = (2 * x / width - 1, 2 * y / height - 1); d = sqrt(dx*dx + dy*dy)
. - Location
(x, y)
is part of the island ifnoise[x, y] > 0.3 + 0.4*d*d
.
Islands are a little more ragged than lakes though, so I'm not sure if these shapes will be to your liking. I've put up a demo of the above algorithm, with buttons at the bottom to control the two magic numbers. There might be different values of the magic numbers 0.3 and 0.4 that produce shapes you like.
alwynd mentioned Perlin noise. Here's how I generated the island shapes for the polygon map generator:
- Generate perlin noise.
- For each location
(x, y)
in the noise bitmap, compute the distance from the center, normalized so that the bitmap is 2x2:(dx, dy) = (2 * x / width - 1, 2 * y / height - 1); d = sqrt(dx*dx + dy*dy)
. - Location
(x, y)
is part of the island ifnoise[x, y] > 0.3 + 0.4*d*d
. This step attempts to make the shape round by cutting off areas that are far from the center.
Islands are a little more ragged than lakes though, so I'm not sure if these shapes will be to your liking. I've put up a demo of the above algorithm, with buttons at the bottom to control the two magic numbers. There might be different values of the magic numbers 0.3 and 0.4 that produce shapes you like.
alwynd mentioned Perlin noise. Here's how I generated the island shapes for the polygon map generator:
- Generate perlin noise.
- For each location
(x, y)
in the noise bitmap, compute the distance from the center, normalized so that the bitmap is 2x2:(dx, dy) = (2 * x / width - 1, 2 * y / height - 1); d = sqrt(dx*dx + dy*dy)
. - Location
(x, y)
is part of the island ifnoise[x, y] > 0.3 + 0.4*d*d
.
Islands are a little more ragged than lakes though, so I'm not sure if these shapes will be to your liking. I've put up a demo of the above algorithm, with buttons at the bottom to control the two magic numbers. There might be different values of the magic numbers 0.3 and 0.4 that produce shapes you like.