Island Terrain Generation

I need help with terrain generation. Yes I have seen some of the other posts about this but they do not help, don’t link any because I’ve been through them all and you won’t help.

My game is briefly a sailing game with some islands. I’m not looking for procedural generation btw

So the whole map is an ocean but there’s some islands which I want to generate randomly on server start. The topics I’ve seen have biome size and chunk size whatever but it’s not customisable to my likings.

Any ideas? Cheers

You need more information about what you expect this to look like.

  1. First, create a model that represents a single island, and include any assets or objects that you want to be included on the island, such as trees, rocks, or buildings.

  2. Next, create a script that will be responsible for generating the islands. This script should run on the server when the game starts, and it should loop through a certain number of times (depending on how many islands you want to generate).

  3. Within the loop, you can use the math.random function to generate random coordinates for the position of each island. You can also use the math.random function to randomly select which type of island to generate (e.g. sandy, rocky, etc.), and use an if/else statement to decide which island model to use based on the random selection.

  4. Once you have determined the position and type of the island, you can use the Instance.new function to create a new instance of the island model, and set its Parent property to the workspace. You can also use the SetPrimaryPartCFrame function to set the position of the island instance.

  5. Repeat this process until all of the islands have been generated.

How would I be able to use the terrain to make random shapes?

I’ve seen people use Perlin Noise to generate random shaped islands, which still uses math.Random at its core.
Basics of using Perlin Noise (2D Based) for more information

I saw that and I debated whether to use it. I could try it

In terms of terrain generation, Perlin Noise is definitely one of the best, if not THE best random terrain generator you could use. Perlin Noise is used for infinte terrain generation, but you’ll need to find a way to “cut out” randomly a shape out of the Perlin Noise image.

1 Like

To me, the random shapes would be procedural generation. Maybe I misunderstood.

I made a modulescript that can generate an island, in Zombie town. It is in the solsort and Italia group Uncooylocked, so free to use if it fits your need

It is not very user friendly or clever. And it generates a big Island and not much water around it.

Basically, it adds a polynomial function with Perkin noise function and fills terrain based on that as the terrain height. At the end it replaces air with water inside a big block. This adds water but preserves the island.

It can generate smaller islands if the values are tweaked, I guess.

It takes some time to generate the island. Unfortunately, the terrain methods do not support parallel luau, so I am not sure it can be sped up that way. I digress, sorry. I just saw an article in the developer portal about terrain generation where it could be do a lot faster with parallel luau. Thing is, I removed the method call to actually generate the terrain, and that method call was taking most of the time.

Terrain is streamed at very low resolution even a small distance away. To make it work well you need a lot of haze. Otherwise, geodesic lines show up, and other artefacts. Also, water has a tendency to climb up the side, if the shore is not very flat. I would not expect that when using the replace function on a brick shape to add the water. Maybe there is a workaround for the water line problem, if I rewrote it all using the read and write voxel functions for more control. But that is too much effort, without knowing if it will work.

1 Like

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