This commit is contained in:
Leshyi committed 2026-11-03 13:45:36 +03:00
1 parent 9682ed0987
commit eade0cd2ae
10 files changed
+1532033 -166651

No files matched your search

+170
View File
@@ -0,0 +1,170 @@
-- Run in Studio Edit mode. Rebuilds only World1 landscape; keep a scene backup first.
local V, CF = Vector3.new, CFrame.new
local terrain, map = workspace.Terrain, workspace.World1Map
local W = V(0,0,1500)
local lakes = require(game.ReplicatedStorage.FishConfig).Worlds[1].lakes
local path = {{-24,62,4},{-64,52,5},{-87,32,7},{-100,4,10},{-106,-27,17},{-103,-57,27},{-91,-83,37},{-66,-92,46},{-39,-105,54},{-46,-123,60}}
local function gap(x,z)
local g=1e5
for _,l in lakes do g=math.min(g,math.sqrt((x-l[1])^2+(z-l[2])^2)-l[3]) end
return g
end
local function pathInfo(x,z)
local best,h=1e5,4
for i=2,#path do
local a,b=path[i-1],path[i]; local dx,dz=b[1]-a[1],b[2]-a[2]
local t=math.clamp(((x-a[1])*dx+(z-a[2])*dz)/(dx*dx+dz*dz),0,1)
local d=math.sqrt((x-a[1]-dx*t)^2+(z-a[2]-dz*t)^2)
if d<best then best,h=d,a[3]+(b[3]-a[3])*t end
end
return best,h
end
local peaks={}
for i=0,23 do
local a=i*math.pi*2/24
local r=239+17*math.sin(i*2.17)
table.insert(peaks,{math.cos(a)*r,math.sin(a)*r,66+23*math.sin(i*3.1)^2,76+43*math.sin(i*1.87)^2})
end
local function height(x,z)
local g=gap(x,z)
if g<0 then return -10+math.clamp((g+10)/10,0,1)*8 end
local y=4+math.noise(x/48,z/48)*2
for _,p in peaks do
local d=math.sqrt((x-p[1])^2+(z-p[2])^2)/p[3]
y=math.max(y,4+p[4]*math.max(0,1-d)^0.85)
end
local d=math.sqrt(((x+46)/70)^2+((z+123)/64)^2)
y=math.max(y,4+56*math.max(0,1-d^2)^0.7)
-- Broad, grassy summit with a firm level base for the lookout.
if ((x+46)/15)^2+((z+123)/14)^2<1 then y=60 end
-- River escarpment behind the waterfall, with a steep lake-facing wall.
local cliff=math.clamp((x-17)/15,0,1)*math.clamp((112-x)/22,0,1)*math.clamp((-z-68)/12,0,1)*math.clamp((z+172)/28,0,1)
y=math.max(y,4+32*cliff)
local pd,ph=pathInfo(x,z)
local mix=1-math.clamp((pd-4)/9,0,1)
y=y*(1-mix)+ph*mix
-- Level building terrace on the left bank.
local cd=math.sqrt(((x+80)/22)^2+((z+50)/19)^2)
if cd<1.5 then local b=math.clamp((1.5-cd)/0.5,0,1); y=y*(1-b)+10*b end
-- Preserve the low, usable shoreline.
y=4+(y-4)*math.clamp(g/11,0,1)
return y
end
terrain:SetMaterialColor(Enum.Material.Snow,Color3.fromRGB(122,182,74))
terrain:SetMaterialColor(Enum.Material.Salt,Color3.fromRGB(190,153,102))
terrain:SetMaterialColor(Enum.Material.Rock,Color3.fromRGB(111,124,137))
terrain:SetMaterialColor(Enum.Material.Sand,Color3.fromRGB(205,190,140))
terrain.WaterColor=Color3.fromRGB(38,158,157)
terrain.WaterTransparency=0.5
terrain.WaterWaveSize=0.12
terrain.WaterWaveSpeed=8
-- 48-stud chunks keep every WriteVoxels small and allow Studio to repaint.
for x0=-288,287,48 do
for z0=-288,287,48 do
local region=Region3.new(W+V(x0,-24,z0),W+V(x0+48,160,z0+48)):ExpandToGrid(4)
local mats,occ=terrain:ReadVoxels(region,4)
for ix=1,12 do for iz=1,12 do
local x,z=x0+(ix-0.5)*4,z0+(iz-0.5)*4
local h,g=height(x,z)-2,gap(x,z)
local pd=pathInfo(x,z)
local slope=math.max(math.abs(height(x+2,z)-height(x-2,z)),math.abs(height(x,z+2)-height(x,z-2)))/4
for iy=1,46 do
local bottom=-24+(iy-1)*4
local o=math.clamp((h-bottom)/4,0,1)
local m=Enum.Material.Air
if o>0 then
m=Enum.Material.Rock
if bottom>h-7 then
m=(slope>1.05 and h>14) and Enum.Material.Rock or Enum.Material.Snow
if pd<4.5 and g>2 then m=Enum.Material.Salt end
if g<3 then m=Enum.Material.Sand end
end
elseif g<0 and bottom<0 then m=Enum.Material.Water; o=1 end
mats[ix][iy][iz],occ[ix][iy][iz]=m,o
end
end end
terrain:WriteVoxels(region,4,mats,occ)
task.wait()
end
end
local old=map:FindFirstChild('LandscapeDetails'); if old then old:Destroy() end
local details=Instance.new('Folder');details.Name='LandscapeDetails';details.Parent=map
local rng=Random.new(103)
local function part(name,size,cf,color,material,parent)
local p=Instance.new('Part'); p.Name=name;p.Size=size;p.CFrame=cf;p.Color=color;p.Material=material or Enum.Material.SmoothPlastic;p.Anchored=true;p.TopSurface=Enum.SurfaceType.Smooth;p.BottomSurface=Enum.SurfaceType.Smooth;p.Parent=parent or details;return p
end
local wood=Color3.fromRGB(125,78,43)
local function beam(a,b,width,color,parent)
return part('Rail',V(width,width,(b-a).Magnitude),CFrame.lookAt((a+b)/2,b),color or wood,Enum.Material.Wood,parent)
end
-- Move existing assets, keeping game markers and identifiers intact.
local tower=map.Watchtower
local tc,ts=tower:GetBoundingBox()
tower:PivotTo(tower:GetPivot()+V(-46-tc.X,60-(tc.Y-ts.Y/2),1377-tc.Z))
local cabin=map.BigCabin
local bc,bs=cabin:GetBoundingBox()
cabin:PivotTo(cabin:GetPivot()+V(-89-bc.X,8-(bc.Y-bs.Y/2),1512-bc.Z))
local small=map.SmallCabin;local sc,sz=small:GetBoundingBox()
small:PivotTo(small:GetPivot()+V(-24-sc.X,5-(sc.Y-sz.Y/2),1416-sc.Z))
-- An upper river runs beneath the existing bridge to the waterfall lip.
terrain:FillBlock(CF(46,34,1394),V(12,4,54),Enum.Material.Water)
terrain:FillBlock(CF(46,40,1394),V(12,8,54),Enum.Material.Air)
-- Cliff buttresses flank the falling water and support both bridge ends.
for _,b in {{27,17,1422,20,34,24},{68,17,1423,23,34,27}} do
terrain:FillBlock(CF(b[1],b[2],b[3]),V(b[4],b[5],b[6]),Enum.Material.Rock)
terrain:FillBlock(CF(b[1],35,b[3]-5),V(b[4],4,b[6]-10),Enum.Material.Snow)
end
-- Trail fencing follows the graded path, leaving the entrance open.
for i=3,#path do
local a,b=path[i-1],path[i]
local av,bv=V(a[1],a[3],a[2]),V(b[1],b[3],b[2])
local dir=V(b[1]-a[1],0,b[2]-a[2]).Unit;local side=V(-dir.Z,0,dir.X)*6
local steps=math.ceil((bv-av).Magnitude/9)
for _,sign in {-1,1} do
local prev
for j=0,steps do
local p=W+av:Lerp(bv,j/steps)+side*sign
part('TrailPost',V(0.65,3.7,0.65),CF(p+V(0,1.6,0)),wood,Enum.Material.Wood)
if prev then beam(prev+V(0,2.7,0),p+V(0,2.7,0),0.4);beam(prev+V(0,1.3,0),p+V(0,1.3,0),0.3) end
prev=p
end
end
end
-- Restore the established low-poly evergreen style from World1Builder.
local crownRotation=CFrame.Angles(math.rad(-35.264),0,0)*CFrame.Angles(0,0,math.rad(45))
local count=0
for i=1,520 do
local x,z=rng:NextNumber(-235,235),rng:NextNumber(-235,235)
local g=gap(x,z);local pd=pathInfo(x,z);local h=height(x,z)
local blocked=(x>-38 and x<38 and z>42 and z<100) or (math.abs(x+80)<29 and math.abs(z+50)<26) or (math.abs(x+24)<16 and math.abs(z+84)<15) or (math.abs(x+46)<20 and math.abs(z+123)<18) or (x>12 and x<86 and z< -65 and z> -152)
if g>10 and pd>12 and not blocked and h<100 then
local tree=Instance.new('Model');tree.Name='Pine'
local ht=rng:NextNumber(17,32);local p=W+V(x,h-0.5,z)
part('Trunk',V(ht*0.065,ht*0.55,ht*0.065),CF(p+V(0,ht*0.25,0)),Color3.fromRGB(91,65,39),Enum.Material.Wood,tree)
for tier=0,3 do
local s=ht*(0.43-tier*0.075)
local leaf=part('Needles',V(s,s,s),CF(p+V(0,ht*(0.3+tier*0.18),0))*CFrame.Angles(0,i*1.73,0)*crownRotation,Color3.fromRGB(43+tier*11,91+tier*12,51+tier*3),nil,tree)
leaf.CanCollide=false
end
tree.Parent=details;count+=1
end
if i%40==0 then task.wait() end
end
-- Shore rocks and low shrubs frame the lake without hiding the main landmarks.
for i=1,250 do
local x,z=rng:NextNumber(-125,125),rng:NextNumber(-145,90)
local g=gap(x,z);local pd=pathInfo(x,z)
if g>2 and g<13 and pd>9 and not (math.abs(x)<25 and z>35) and not (x>20 and x<78 and z< -60) then
local h=height(x,z);local s=rng:NextNumber(2,6)
local p=part('ShoreRock',V(s,s*0.65,s*0.8),CF(W+V(x,h,z))*CFrame.Angles(0.2,i,0.3),Color3.fromRGB(115,125,132))
if i%2==0 then
for j=1,3 do local q=part('Shrub',V(2.8,2.8,2.8),CF(W+V(x+j*1.1,h+1,z-2)),Color3.fromRGB(91+j*12,138+j*8,51));q.Shape=Enum.PartType.Ball;q.CanCollide=false end
end
end
end
local lighting=game:GetService('Lighting');lighting.ClockTime=15.2;lighting.Brightness=2.5;lighting.Ambient=Color3.fromRGB(125,137,145);lighting.OutdoorAmbient=Color3.fromRGB(145,152,139)
workspace.CurrentCamera.CFrame=CFrame.lookAt(V(8,17,1575),V(-10,25,1435))
map:SetAttribute('LandscapeRevision','ReferenceLandscape_v1')
return {trees=count,details=#details:GetDescendants(),pathPoints=#path}