I’m working on making procedural terrain(I finally decided to try and fix it again… ), and to generate certain objects/structures I want to flatten off the area, and to do so, I’m having them seed based(ofc)
Currently I have a way to smooth the terrain out, but it only will smooth in the “chunk” that the object is generating in currently, and I want it to be able to find if within a certain radius(say 200 studs) it would be where an object would generate, since certain times the structure isn’t loaded but terrain around it is
I tried doing the classic double for loops when dealing with 2D maps
for x = 1, 200 do
for z = 1, 200 do
if math.noise(CurX + x, CurZ + z, 1951.2345) > .9 then
--do the stuff here ofc
end
end
end
Which has the issue of being really slow, or laggy(if I don’t yield every 50 or so iterations on x), since I have to yield now and then or it times out due to it literally just checking a table where I cached the previously found objects
One thing I could do, is not have the objects procedurally placed, and have static locations for them(kinda like how Minecraft Strongholds used to be), but I’d rather not do this, since I feel as though it reduces the immersion of an infinite world, since you can see the pattern to a certain extent.
If there’s a simple way that I’m too dumb to realize, that would be nice, but any input most likely will help, let me know if you need further information