Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I generate perlin noise worlds with chunks?

Asked by 5 years ago
Edited 5 years ago
local height = 9
local seed = 0
local UF = 3

  for x = 1, 100 do

    for z = 1, 100 do

        y = (math.noise(x/UF,z/UF, seed) * height)
        local Part = Instance.new("Part")
        Part.Parent = World
        Part.Size = Vector3.new(3,3,3)
        Part.BrickColor = BrickColor.new("Forest green")
        Part.Anchored = true
        Part.Position = Vector3.new(x * 3,math.floor(y) * 3,z * 3)
        Part.Material = Enum.Material.Grass

    end

end

I wrote this script for generating worlds with perlin noise. However, I would like to know 2 things: 1. Can I somehow improve the performance while generating 2. Can I somehow divide the generated world into 10x10 chunks?

The problem I have with dividing the world into chunks is that the world is generated in lines. All sorts of tips and tutorials are welcome

0
to improve performance; put Part.Parent last, to put them into chunks, you could make a model for each floor(x/10) and create models in those with floor(z/10) to get each part into its own 'chunk', also, you might be better off cloning a part that already has most of the stuff you change set, but i'm not 100% certain on that. RubenKan 3615 — 5y
0
Thank you so much I will implement your suggestions and see if it helps! MageMasterHD 261 — 5y

Answer this question