ID:1641843
 
(See the best response by Decius Reln.)
I took into consideration "Learning" some more of the language before I go off and ask for some more help on it. Ontop of that, I ran into an issue. (Previous post: http://www.byond.com/members/ Wks60?command=view_post&post=1378492)

    verb
RandomGenerate()
for(var/obj/turf/T in world)
T.iov=rand(0,100)
if(T.iov<50)
T.icon_state="grass"
T.density=0
else
T.icon_state="water"
T.density=1


This has made a random generation, and after referring to the article suggested by Ter13, I have found a solution. The thing is that I would need to set "Rules" to make the generation seem more organic compared to how it would look with current generation. And now, I have found yet another block in my road. How exactly should, and would I set these rules up? I have gotten a lot greater skill when using DM, however I still do not know how I'd set these up.
Would anyone know how to make a rule stating that (3) of one type have to be in the direct contact of the object?

My attempt is messy, and... Doesn't work. Also, I switched it to a proc, seeing as how it's an entire world event, rather than a mob-based verb.

Mind you, I am not good at coding in general, so I tend to... do messily.

world

proc
RandomPotato()

for(var/obj/turf/T in world)

T.iov=rand(0,100)
if(T.iov<50)
T.icon_state="grass"
src.name="grass"
T.density=0
else
T.icon_state="water"
src.name="water"
T.density=1
var/obj/turf/water/W
var/obj/turf/grass/G
for(G in range(1,T))
T.loe+=1

for(W in range(1,T))
T.loi+=1


if(T=="water")
if(T.loi<=1)


T.iov=rand(0,100)
if(T.iov<50)
T.icon_state="grass"
src.name="grass"
T.density=0
else
T.icon_state="water"
src.name="water"
T.density=1
else
RandomPotato()

if(T=="grass")
if(T.loe<=1)


T.iov=rand(0,100)
if(T.iov<50)
T.icon_state="grass"
src.name="grass"
T.density=0
else
T.icon_state="water"
src.name="water"
T.density=1
else
RandomPotato()


If anyone can improve my method, or provide a better, more efficient one, please say so. Even ideas, would help.

If any additional information is needed it can be given, or if anyone can reply ANYTHING, I'd appreciate it.
Best response
I might recommend first making the bottom layer, in your case water, and then placing the top layer in specific nodes that spread out and require for there to be three within one tile of the new tile, after having placed down randomly a fair number of tiles. Maybe this kind of thing.

randomGenerateProc()
placeLayer(/turf/water, ALL, clean=FALSE)

placeLayer(/turf/sand, ISLANDSIZE, clean=TRUE)

placeLayer(grass, ISLANDSIZE - BEACHSIZE, clean=TRUE)


placeLayer(turf_path, layer_size, clean) // Clean would be TRUE or FALSE
//put the code here for the layer. Make it the layer size.
//Have it 'clean' the edges after placing the layer, by removing any that doesn't have
//3 of its type within one tile of it.
//If clean is set. I recommend cleaning beind done in its own proc.


Of course that code won't work just placed in there, since it is pseudo-code, but it might give you an idea of something you can do.

Disclaimer: I've not played around with random generation before. Just here to give ideas. :p

Note: Likely will not be too efficient, but it should help provide something organic. Wouldn't recommend during runtime past an initial setup or something like that. :p
Alright. I've gotten mine to work, even with rules. (Yay). However.... Well. The entire thing is flawed. The rules state that if it isn't organic, in the way I designed, to remake it. Haha.... Haha.... Well, after what seemed like a few hundred "re-runs" it stopped working.

world

proc
RandomPotato()

sleep(5)
world << "delay"
for(var/obj/turf/T in world)

T.iov=rand(0,100)
if(T.iov<70)
T.icon_state="grass"
src.name="grass"
T.density=0
else
T.icon_state="water"
src.name="water"
T.density=1
var/obj/turf/water/W
var/obj/turf/grass/G
for(G in orange(1,T))
T.loe+=1

for(W in orange(1,T))
T.loi+=1

if(T.icon_state=="grass")
T.name="grass"
if(T.icon_state=="grass")
T.name="water"
if(T=="water")
if(T.loi>=3)


T.iov=rand(0,100)
if(T.iov<50)
T.icon_state="grass"
src.name="grass"
T.density=0
else
T.icon_state="water"
src.name="water"
T.density=1
else
RandomPotato()

if(T=="grass")
if(T.loe>=3)


T.iov=rand(0,100)
if(T.iov<50)
T.icon_state="grass"
src.name="grass"
T.density=0
else
T.icon_state="water"
src.name="water"
T.density=1

else
RandomPotato()
for(var/obj/turf/T in world)


if(T.loi<=4)
RandomPotato()
if(T.loe<=4)
RandomPotato()
I think I may have to restart from scratch, or try Decius Reins method.
From what I've read in the past, This is how I've seen basic generation of land vs. non-land.

*Create the water.
*Pick a single point in the water and convert it to land.
Provide this land with a 'seed' value. Larger for larger islands, smaller for fractal islands.
*Use this seed-distance to create neighboring turfs (seed being 95%, - 5% per each distance from origin - 4 tiles away would be 75% land mass). If necessary, you can also incorporate distance from edge of map into this to convince land mass to flow more to the center rather than cutting off at the edge of the world.
*repeat 2 & 3 until desired landmass of world is reached.
*if desired, auto-join edges and repeat for things like forests, deserts, etc.

That being said, I've never actually done it myself.

Pirion, you are always so helpful. The third part,

"*Use this seed-distance to create neighboring turfs (seed being 95%, - 5% per each distance from origin - 4 tiles away would be 75% land mass). If necessary, you can also incorporate distance from edge of map into this to convince land mass to flow more to the center rather than cutting off at the edge of the world. "

is exactly what I was looking for. And with how it is based, it seems really easy. I should have realized it before...