That’s interesting, I had similar problems whenever I used a seed above 100,000. I solved this by setting the seed to math.random(1, 20000)/1000. Hope this helps, and I appreciate the kind words!
local step = .05 --Jump between to noise values (lower number, smoother)
local size = 50 --Length and width of the tile grid
local scaleFactor = 160 --Multiplier for the base noise (higher number, more violent peaks and valleys)
local gridSize = 7.5 --Grid regular tiles are locked to
local secondGrid = 14 --Grid the mountains are locked to
local heightClassifier = 75 --Lower the number, higher the terrain (more mountains)
local seed = math.random(1, 20000)/1000
local populationSeed = seed+1 --Seeding for trees, bushes, etc
local tileStorage = {}
local highestTile = nil
function populateWorld()
for i = 1, math.random(2, 4) do
local selectedTile = tileStorage[math.random(1, #tileStorage)]
selectedTile.TileScript.CreateObject:Fire("Ruins")
end
for z = 1, size do
for x = 1, size do
--TREES and BUSHES
local ColorNum = (1 + math.noise(x*.1,z*.1,populationSeed))
local griddedNumb = (math.floor(ColorNum/gridSize)*gridSize)
local selectedTile = tileStorage[(size*(z-1))+(x-1)]
if ColorNum > 1 and #selectedTile.Objects:GetChildren() == 0 then
if math.random(1,30) < 13 then --Probability of a tree spawning on an eligible tile
if selectedTile.Name == "Grass" then
selectedTile.TileScript.CreateObject:Fire("Tree")
end
else
if math.random(1,30) < 5 then --Probability of a bush spawning instead of a tree
if selectedTile.Name == "Grass" then
selectedTile.TileScript.CreateObject:Fire("Bush")
end
end
end
end
end
end
for z = 1, size do
for x = 1, size do
--ROCKS
local selectedTile = tileStorage[(size*(z-1))+(x-1)]
if selectedTile.Name == "Rock" then
if math.random(1,290) < 17 then
selectedTile.TileScript.CreateObject:Fire("Rock")
end
end
end
end
game.ReplicatedStorage.Events.WorldGenerated:Fire()
end
game.ReplicatedStorage.Events.GenerateWorld.Event:Connect(function()
print("Generating on seed "..seed)
local blockHeights = {
[0] = "Sand",
[1] = "Grass",
[2] = "Rock",
[3] = "SnowRock"
}
for z = 1, size do
for x = 1, size do
local ColorNum = (1 + math.noise(x*step,z*step,seed))*scaleFactor - 20 --First we take the number we get from the noise when we input our X and Z coordinate, multiply it by the scale factor, and then subtract 20
local griddedNumb = (math.floor(ColorNum/gridSize)*gridSize) --Put that number into a grid
local heightType = (math.floor(ColorNum/heightClassifier)) --Based on how high the tile is, assign it a height type (Sand, Grass, Rock, or SnowRock)
if heightType < 0 then heightType = 0 end --If heightType was somehow out of bounds, correct it
if heightType > 3 then heightType = 3 end
local clone = game.ServerStorage.Tiles:FindFirstChild(blockHeights[heightType]):Clone()
if heightType == 2 then --This block multiplies the height of the mountains to give the steep cliff effect
griddedNumb = griddedNumb * (ColorNum*.0073)
griddedNumb = (math.floor(griddedNumb/secondGrid)*secondGrid)
end
if heightType == 3 then --This block multiplies the height of the mountains to give the steep cliff effect
griddedNumb = griddedNumb * (ColorNum*.0073)
griddedNumb = (math.floor(griddedNumb/secondGrid)*secondGrid)
end
clone:SetPrimaryPartCFrame(CFrame.new(Vector3.new(z*20, griddedNumb, x*20))) --Set the tile's position to the final product
if highestTile == nil then
highestTile = clone
else
if clone.PrimaryPart.Position.Y > highestTile.PrimaryPart.Position.Y then
highestTile = clone
else
if clone.PrimaryPart.Position.Y == highestTile.PrimaryPart.Position.Y then
if math.random(1, 2) == 2 then
highestTile = clone
end
end
end
end
clone.Parent = game.Workspace.Tiles
table.insert(tileStorage, #tileStorage, clone)
end
end
print("Playfield generated successfully. Populating...")
populateWorld()
end)