diff --git a/code/modules/procedural mapping/mapGenerator.dm b/code/modules/procedural mapping/mapGenerator.dm index 8992380daa8..74bb3c8e692 100644 --- a/code/modules/procedural mapping/mapGenerator.dm +++ b/code/modules/procedural mapping/mapGenerator.dm @@ -11,11 +11,11 @@ //Combined defines #define CLUSTER_CHECK_SAMES 24 //Don't let any of the same type cluster #define CLUSTER_CHECK_DIFFERENTS 6 //Don't let any of different types cluster -#define CLUSTER_CHECK_ALL_TURFS 32 //Don't let ANY turfs cluster same and different types -#define CLUSTER_CHECK_ALL_ATOMS 64 //Don't let ANY atoms cluster same and different types +#define CLUSTER_CHECK_ALL_TURFS 10 //Don't let ANY turfs cluster same and different types +#define CLUSTER_CHECK_ALL_ATOMS 20 //Don't let ANY atoms cluster same and different types //All -#define CLUSTER_CHECK_ALL 96 //Don't let anything cluster, like, at all +#define CLUSTER_CHECK_ALL 30 //Don't let anything cluster, like, at all /datum/mapGenerator diff --git a/code/modules/procedural mapping/mapGeneratorModule.dm b/code/modules/procedural mapping/mapGeneratorModule.dm index 3bf97d9ca65..da08a540ef3 100644 --- a/code/modules/procedural mapping/mapGeneratorModule.dm +++ b/code/modules/procedural mapping/mapGeneratorModule.dm @@ -5,7 +5,7 @@ var/list/spawnableTurfs = list() var/clusterMax = 5 var/clusterMin = 1 - var/clusterCheckFlags = CLUSTER_CHECK_ALL_ATOMS + var/clusterCheckFlags = CLUSTER_CHECK_SAME_ATOMS var/allowAtomsOnSpace = FALSE @@ -31,6 +31,7 @@ return 0 var/clustering = 0 + var/skipLoopIteration = FALSE //Turfs don't care whether atoms can be placed here for(var/turfPath in spawnableTurfs) @@ -42,20 +43,23 @@ if(clusterCheckFlags & CLUSTER_CHECK_SAME_TURFS) clustering = rand(clusterMin,clusterMax) for(var/turf/F in trange(clustering,T)) - //if(F.type == turfPath) //NOT istype(), exact typematching if(istype(F,turfPath)) - continue - - if(locate(turfPath) in trange(clustering, T)) + skipLoopIteration = TRUE + break + if(skipLoopIteration) + skipLoopIteration = FALSE continue //You're DIFFERENT to me? I hate you I'm going home if(clusterCheckFlags & CLUSTER_CHECK_DIFFERENT_TURFS) clustering = rand(clusterMin,clusterMax) for(var/turf/F in trange(clustering,T)) - //if(F.type != turfPath) if(!(istype(F,turfPath))) - continue + skipLoopIteration = TRUE + break + if(skipLoopIteration) + skipLoopIteration = FALSE + continue //Success! if(prob(spawnableTurfs[turfPath])) @@ -74,17 +78,23 @@ if(clusterCheckFlags & CLUSTER_CHECK_SAME_ATOMS) clustering = rand(clusterMin, clusterMax) for(var/atom/movable/M in range(clustering,T)) - //if(M.type == atomPath) if(istype(M,atomPath)) - continue + skipLoopIteration = TRUE + break + if(skipLoopIteration) + skipLoopIteration = FALSE + continue //You're DIFFERENT from me? I hate you I'm going home if(clusterCheckFlags & CLUSTER_CHECK_DIFFERENT_ATOMS) clustering = rand(clusterMin, clusterMax) for(var/atom/movable/M in range(clustering,T)) - //if(M.type != atomPath) if(!(istype(M,atomPath))) - continue + skipLoopIteration = TRUE + break + if(skipLoopIteration) + skipLoopIteration = FALSE + continue //Success! if(prob(spawnableAtoms[atomPath])) @@ -126,11 +136,11 @@ //Settings appropriate for turfs/atoms that cover SOME of the map region, sometimes referred to as a splatter layer. /datum/mapGeneratorModule/splatterLayer clusterCheckFlags = CLUSTER_CHECK_ALL - spawnableAtoms = list(/atom = 15) - spawnableTurfs = list(/turf = 15) + spawnableAtoms = list(/atom = 30) + spawnableTurfs = list(/turf = 30) //Settings appropriate for turfs/atoms that cover a lot of the map region, eg a dense forest. /datum/mapGeneratorModule/denseLayer clusterCheckFlags = CLUSTER_CHECK_NONE - spawnableAtoms = list(/atom = 35) - spawnableTurfs = list(/turf = 35) \ No newline at end of file + spawnableAtoms = list(/atom = 75) + spawnableTurfs = list(/turf = 75) \ No newline at end of file diff --git a/code/modules/procedural mapping/mapGeneratorModules/nature.dm b/code/modules/procedural mapping/mapGeneratorModules/nature.dm index df8dbccb28c..09ca84574b1 100644 --- a/code/modules/procedural mapping/mapGeneratorModules/nature.dm +++ b/code/modules/procedural mapping/mapGeneratorModules/nature.dm @@ -4,11 +4,11 @@ //Pine Trees /datum/mapGeneratorModule/pineTrees - spawnableAtoms = list(/obj/structure/flora/tree/pine = 15) + spawnableAtoms = list(/obj/structure/flora/tree/pine = 30) //Dead Trees /datum/mapGeneratorModule/deadTrees - spawnableAtoms = list(/obj/structure/flora/tree/dead = 5) + spawnableAtoms = list(/obj/structure/flora/tree/dead = 10) //Random assortment of bushes /datum/mapGeneratorModule/randBushes @@ -18,7 +18,7 @@ ..() spawnableAtoms = typesof(/obj/structure/flora/ausbushes) for(var/i in spawnableAtoms) - spawnableAtoms[i] = 15 + spawnableAtoms[i] = 20 //Random assortment of rocks and rockpiles @@ -34,4 +34,4 @@ //Grass tufts with a high spawn chance /datum/mapGeneratorModule/denseLayer/grassTufts spawnableTurfs = list() - spawnableAtoms = list(/obj/structure/flora/ausbushes/grassybush = 35) + spawnableAtoms = list(/obj/structure/flora/ausbushes/grassybush = 75) diff --git a/code/modules/procedural mapping/mapGeneratorReadme.dm b/code/modules/procedural mapping/mapGeneratorReadme.dm index c083f077404..ae656b5b30b 100644 --- a/code/modules/procedural mapping/mapGeneratorReadme.dm +++ b/code/modules/procedural mapping/mapGeneratorReadme.dm @@ -136,10 +136,10 @@ Variable Breakdown (For Mappers): CLUSTER_CHECK_SAMES 24 //Don't let any of the same type cluster CLUSTER_CHECK_DIFFERENTS 6 //Don't let any different types cluster - CLUSTER_CHECK_ALL_TURFS 32 //Don't let ANY turfs cluster same and different types - CLUSTER_CHECK_ALL_ATOMS 64 //Don't let ANY atoms cluster same and different types + CLUSTER_CHECK_ALL_TURFS 10 //Don't let ANY turfs cluster same and different types + CLUSTER_CHECK_ALL_ATOMS 20 //Don't let ANY atoms cluster same and different types - CLUSTER_CHECK_ALL 96 //Don't let anything cluster, like, at all + CLUSTER_CHECK_ALL 30 //Don't let anything cluster, like, at all