var/islands = 5
var/islandbasefailrate = 5
var/islandfailrate = 10
var/islanddeathtime = 4
var/islandspawnheight = 10
world
view = 15
New()
..()
WorldLoad()
proc
WorldLoad()
for(var/i, i<=islands,i++)
var/x = rand(10,world.maxx-10)
var/y = rand(10,world.maxy-10)
var/turf/islandspawn = new/turf/grass(locate(x,y,1))
islandgen(islandspawn, islandspawnheight)
islandgen(turf/T, H)
if(H <= islanddeathtime) return
for(var/turf/A in view(2,T))
if(!(isnull(A)))
if(A.type == /turf/water/middle && !(A.type == /turf/grass))
var/AH = H - rand(islandbasefailrate,islandfailrate) / 10
var/Tile = FindTile(AH)
var/turf/AT = new Tile(A)
islandgen(AT,AH)
FindTile(H)
if(H <= 4.20) return /turf/water/shore
if(H <= 4.30) return /turf/sand
if(H <= 100) return /turf/grass
So so, what im trying to do is generate a simple island for people to have fun on and it looks good, the problem? well everything i generate and island its comes out perfect... with 1 flaw, there is sand EVERYWHERE its like i went and put
turf
grass
New()
..()
if(rand(1,2)) new/turf/sand(src)
in my codes, which i didnt but still, if i can end up posting a picture i will right...
here:
if theres nothing there then i couldnt post a picture, but yeah, anyone know why or even have a tip for island genning? this is really my first time where ive gotten results near expectation with generating land btw, so im pretty nooby with generating land :S
(Note that the ugly tiles with the little red S in them are the 'shore' tiles.)
I can only assume that you meant shore when you said sand, or perhaps they are sharing the same icon, or there are other factors that I did not consider when making my quick simulation of it.
I went ahead and took the liberty of editing a few settings, after taking a close look at the code, and this is the island that ended up resulting:
You'll note that there is quite a bit more grass and sand. In order to figure out how to 'fix' your specific problem, though, I do need to know what you actually want the behavior to be. Your code appears to be working, just not having the behavior that you wanted-- and it's important to know if these few edits give you the behavior you want, or if you should use a different method/find other edits to make.
Thoughts?