From 0806a20ca4ef8cc08e5b5c72588ea8e0e3aea55e Mon Sep 17 00:00:00 2001 From: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com> Date: Tue, 4 Jun 2024 12:33:40 -0700 Subject: [PATCH] Adds Biomes to the Cave Generator, for all of your procedurally-placed cave biome needs! (#83138) Implements biomes into the Cave Generator, using some adapted code from the biomes feature of the Jungle Generator. It's there as a tool for whomever would want to implement it on /tg/, I simply don't have the sprites, mobs and motivation to add biomes to anything at this current point in time, even though I'm fully open to helping anyone that would be interested in doing so. Here's how it works: You supply a 2D list of biomes based on the two arbitrary criteria 'heat' and 'humidity', you can treat these as simply two independent variables that would affect your biome distribution. There's three levels of each, `LOW`, `MEDIUM` and `HIGH`, take a look at `possible_biomes` for a good example of it. Here's what it looks like by default (yes, that's the default on the jungle generator as well, except here we use 3x3 instead of 4x4): ![image](https://github.com/tgstation/tgstation/assets/58045821/2c53b46b-f4f9-497f-9647-efc2cc118805) On the `/datum/biome`, you have three important stats, split into two each: flora, features and fauna. They are evaluated in this order, so if a flora spawns, no feature nor fauna will spawn. If a feature spawns, no fauna will spawn, and if fauna spawns, then that's cool. Each of these stats have a corresponding `density` (i.e. `flora_density`), which is simply the probability for that thing to be spawned if it's eligible, and a `types` list (i.e. `flora_types`), which is a weighted list that then gets expanded at runtime in order to make the `pick()` operation faster. The areas you want to have the biomes in also need to have their `area_flags` set up to include `FLORA_ALLOWED` for both flora and features, and `MOB_SPAWN_ALLOWED` for fauna to spawn. The fauna currently does just about every check that is done in `cave_generator`'s `populate_terrain()`, except for handling megafauna differently, or taking megafauna into account. If that's desired, it can be added easily, I simply chose not to add it because it felt like wasted processor time over something that would probably not be pertinent in the majority of cases. I've run a few tests, and keeping in mind that I've got a high-specs computer, generating the caves with biomes takes about 1 second for an entire z-level covered in biomes. For comparison, I compile the repo in about 36 seconds. ~~It may increase the amount of time spent initializing the atoms subsystem, however, I'll need to compare that, I'd really appreciate some help optimizing that if anyone knows how to.~~ It didn't seem to have an effect, I just had seen things a bit weird. I optimized things by moving rust-g calls outside of the for loop, and we gained about 0.3-0.4 seconds, which is pretty nice. Biomes are cool, and since we use mainly cave generators for z-level generation, I decided to add biomes to that, so that the biome code added by floyd lives on. Here's an example of ice box with jungle caves, just as a proof of concept, to prove that it works: ![image](https://github.com/tgstation/tgstation/assets/58045821/33b348db-513b-4a2e-b11f-907e80b65177) :cl: GoldenAlpharex add: Added Biomes capabilities to the Cave Generator, to allow for procedurally-placed biomes to be introduced in cave generation. This feature is not currently used on any map, but the tools are all there for anyone with the motivation to add biomes to any cave-generating area, like Lavaland and Ice Box. code: Biomes can now affect features (which are usually structures), on top of flora and fauna. /:cl: --- code/__DEFINES/maps.dm | 2 + code/datums/mapgen/CaveGenerator.dm | 180 ++++++++++++++++++++++++- code/datums/mapgen/biomes/_biome.dm | 202 ++++++++++++++++++++++++++-- code/game/turfs/turf.dm | 4 + 4 files changed, 375 insertions(+), 13 deletions(-) diff --git a/code/__DEFINES/maps.dm b/code/__DEFINES/maps.dm index 322eb40fd6d1..6f57980436f7 100644 --- a/code/__DEFINES/maps.dm +++ b/code/__DEFINES/maps.dm @@ -178,11 +178,13 @@ Always compile, always use that verb, and always make sure that it works for wha #define BIOME_LOW_HEAT "low_heat" #define BIOME_LOWMEDIUM_HEAT "lowmedium_heat" +#define BIOME_MEDIUM_HEAT "medium_heat" #define BIOME_HIGHMEDIUM_HEAT "highmedium_heat" #define BIOME_HIGH_HEAT "high_heat" #define BIOME_LOW_HUMIDITY "low_humidity" #define BIOME_LOWMEDIUM_HUMIDITY "lowmedium_humidity" +#define BIOME_MEDIUM_HUMIDITY "medium_humidity" #define BIOME_HIGHMEDIUM_HUMIDITY "highmedium_humidity" #define BIOME_HIGH_HUMIDITY "high_humidity" diff --git a/code/datums/mapgen/CaveGenerator.dm b/code/datums/mapgen/CaveGenerator.dm index e407198faf3f..c7420dd8ffa6 100644 --- a/code/datums/mapgen/CaveGenerator.dm +++ b/code/datums/mapgen/CaveGenerator.dm @@ -1,3 +1,6 @@ +/// The random offset applied to square coordinates, causes intermingling at biome borders +#define BIOME_RANDOM_SQUARE_DRIFT 2 + /datum/map_generator/cave_generator var/name = "Cave Generator" ///Weighted list of the types that spawns if the turf is open @@ -28,7 +31,23 @@ var/list/weighted_feature_spawn_list ///Expanded list of extra features that can spawn in the area. Reads from the weighted list var/list/feature_spawn_list - + /// The turf types to replace with a biome-related turf, as typecache. + /// Leave empty for all open turfs (but not closed turfs) to be hijacked. + var/list/biome_accepted_turfs = list() + /// An associative list of biome type to the list of turfs that were + /// generated of that biome specifically. Helps to improve the efficiency + /// of biome-related operations. Is populated through + /// `generate_terrain_with_biomes()`. + var/list/generated_turfs_per_biome = list() + /// 2D list of all biomes based on heat and humidity combos. Associative by + /// `BIOME_X_HEAT` and then by `BIOME_X_HUMIDITY` (i.e. + /// `possible_biomes[BIOME_LOW_HEAT][BIOME_LOWMEDIUM_HUMIDITY]`). + /// Check /datum/map_generator/cave_generator/jungle for an example + /// of how to set it up properly. + var/list/possible_biomes = list() + /// Used to select "zoom" level into the perlin noise, higher numbers + /// result in slower transitions + var/perlin_zoom = 65 ///Base chance of spawning a mob var/mob_spawn_chance = 6 @@ -48,6 +67,7 @@ ///How little neighbours does a alive cell need to die var/death_limit = 3 + /datum/map_generator/cave_generator/New() . = ..() if(!weighted_mob_spawn_list) @@ -77,6 +97,9 @@ if(!(generate_in.area_flags & CAVES_ALLOWED)) return + if(length(possible_biomes)) + return generate_terrain_with_biomes(turfs, generate_in) + var/start_time = REALTIMEOFDAY string_gen = rustg_cnoise_generate("[initial_closed_chance]", "[smoothing_iterations]", "[birth_limit]", "[death_limit]", "[world.maxx]", "[world.maxy]") //Generate the raw CA data @@ -99,8 +122,102 @@ if(gen_turf.turf_flags & NO_RUINS) new_turf.turf_flags |= NO_RUINS - if(closed)//Open turfs have some special behavior related to spawning flora and mobs. - CHECK_TICK + var/message = "[name] terrain generation finished in [(REALTIMEOFDAY - start_time)/10]s!" + to_chat(world, span_boldannounce("[message]")) + log_world(message) + + +/** + * This proc handles including biomes in the cave generation. This is slower than + * `generate_terrain()`, so please use it only if you actually need biomes. + * + * This should only be called by `generate_terrain()`, if you have to call this, + * you're probably doing something wrong. + */ +/datum/map_generator/cave_generator/proc/generate_terrain_with_biomes(list/turfs, area/generate_in) + if(!(generate_in.area_flags & CAVES_ALLOWED)) + return + + var/humidity_seed = rand(0, 50000) + var/heat_seed = rand(0, 50000) + + var/start_time = REALTIMEOFDAY + string_gen = rustg_cnoise_generate("[initial_closed_chance]", "[smoothing_iterations]", "[birth_limit]", "[death_limit]", "[world.maxx]", "[world.maxy]") //Generate the raw CA data + + var/humidity_gen = list() + humidity_gen[BIOME_HIGH_HUMIDITY] = rustg_dbp_generate("[humidity_seed]", "60", "75", "[world.maxx]", "-0.1", "1.1") + humidity_gen[BIOME_MEDIUM_HUMIDITY] = rustg_dbp_generate("[humidity_seed]", "60", "75", "[world.maxx]", "-0.3", "-0.1") + + var/heat_gen = list() + heat_gen[BIOME_HIGH_HEAT] = rustg_dbp_generate("[heat_seed]", "60", "75", "[world.maxx]", "-0.1", "1.1") + heat_gen[BIOME_MEDIUM_HEAT] = rustg_dbp_generate("[heat_seed]", "60", "75", "[world.maxx]", "-0.3", "-0.1") + + var/list/expanded_closed_turfs = src.closed_turf_types + var/list/expanded_open_turfs = src.open_turf_types + + for(var/turf/gen_turf as anything in turfs) //Go through all the turfs and generate them + var/closed = string_gen[world.maxx * (gen_turf.y - 1) + gen_turf.x] != "0" + var/new_turf_type = pick(closed ? expanded_closed_turfs : expanded_open_turfs) + + var/datum/biome/selected_biome + + // Here comes the meat of the biome code. + var/drift_x = clamp((gen_turf.x + rand(-BIOME_RANDOM_SQUARE_DRIFT, BIOME_RANDOM_SQUARE_DRIFT)), 1, world.maxx) // / perlin_zoom + var/drift_y = clamp((gen_turf.y + rand(-BIOME_RANDOM_SQUARE_DRIFT, BIOME_RANDOM_SQUARE_DRIFT)), 2, world.maxy) // / perlin_zoom + + // Where we go in the generated string (generated outside of the loop for s p e e d) + var/coordinate = world.maxx * (drift_y - 1) + drift_x + + // Type of humidity zone we're in (LOW-MEDIUM-HIGH) + var/humidity_level = text2num(humidity_gen[BIOME_HIGH_HUMIDITY][coordinate]) ? \ + BIOME_HIGH_HUMIDITY : text2num(humidity_gen[BIOME_MEDIUM_HUMIDITY][coordinate]) ? BIOME_MEDIUM_HUMIDITY : BIOME_LOW_HUMIDITY + // Type of heat zone we're in (LOW-MEDIUM-HIGH) + var/heat_level = text2num(heat_gen[BIOME_HIGH_HEAT][coordinate]) ? \ + BIOME_HIGH_HEAT : text2num(heat_gen[BIOME_MEDIUM_HEAT][coordinate]) ? BIOME_MEDIUM_HEAT : BIOME_LOW_HEAT + + selected_biome = possible_biomes[heat_level][humidity_level] + + // Currently, we only affect open turfs, because biomes don't currently + // have a definition for biome-specific closed turfs. + if((!length(biome_accepted_turfs) && !closed) || biome_accepted_turfs[new_turf_type]) + LAZYADD(generated_turfs_per_biome[selected_biome], gen_turf) + + else + // The assumption is this will be faster then changeturf, and changeturf isn't required since by this point + // The old tile hasn't got the chance to init yet + var/turf/new_turf = new new_turf_type(gen_turf) + + if(gen_turf.turf_flags & NO_RUINS) + new_turf.turf_flags |= NO_RUINS + + CHECK_TICK + + for(var/biome in generated_turfs_per_biome) + var/datum/biome/generating_biome = SSmapping.biomes[biome] + + var/list/turf/generated_turfs = generating_biome.generate_turfs_for_terrain(generated_turfs_per_biome[biome]) + + generated_turfs_per_biome[biome] = generated_turfs + + var/message = "[name] terrain generation finished in [(REALTIMEOFDAY - start_time)/10]s!" + to_chat(world, span_boldannounce("[message]")) + log_world(message) + + +/datum/map_generator/cave_generator/populate_terrain(list/turfs, area/generate_in) + if(length(possible_biomes)) + return populate_terrain_with_biomes(turfs, generate_in) + + // Area var pullouts to make accessing in the loop faster + var/flora_allowed = (generate_in.area_flags & FLORA_ALLOWED) && length(flora_spawn_list) + var/feature_allowed = (generate_in.area_flags & FLORA_ALLOWED) && length(feature_spawn_list) + var/mobs_allowed = (generate_in.area_flags & MOB_SPAWN_ALLOWED) && length(mob_spawn_list) + var/megas_allowed = (generate_in.area_flags & MEGAFAUNA_SPAWN_ALLOWED) && length(megafauna_spawn_list) + + var/start_time = REALTIMEOFDAY + + for(var/turf/target_turf as anything in turfs) + if(!(target_turf.type in open_turf_types)) //only put stuff on open turfs we generated, so closed walls and rivers and stuff are skipped continue // If we've spawned something yet @@ -170,3 +287,60 @@ var/message = "[name] finished in [(REALTIMEOFDAY - start_time)/10]s!" to_chat(world, span_boldannounce("[message]")) log_world(message) + + +/** + * This handles the population of terrain with biomes. Should only be called by + * `populate_terrain()`, if you find yourself calling this, you're probably not + * doing it right. + * + * This proc won't do anything if the area we're trying to generate in does not + * have `FLORA_ALLOWED` or `MOB_SPAWN_ALLOWED` in its `area_flags`. + */ +/datum/map_generator/cave_generator/proc/populate_terrain_with_biomes(list/turfs, area/generate_in) + // Area var pullouts to make accessing in the loop faster + var/flora_allowed = (generate_in.area_flags & FLORA_ALLOWED) + var/features_allowed = (generate_in.area_flags & FLORA_ALLOWED) + var/fauna_allowed = (generate_in.area_flags & MOB_SPAWN_ALLOWED) + + var/start_time = REALTIMEOFDAY + + // No sense in doing anything here if nothing is allowed anyway. + if(!flora_allowed && !features_allowed && !fauna_allowed) + var/message = "[name] terrain population finished in [(REALTIMEOFDAY - start_time)/10]s!" + to_chat(world, span_boldannounce("[message]")) + log_world(message) + return + + for(var/biome in generated_turfs_per_biome) + var/datum/biome/generating_biome = SSmapping.biomes[biome] + generating_biome.populate_turfs(generated_turfs_per_biome[biome], flora_allowed, features_allowed, fauna_allowed) + + CHECK_TICK + + var/message = "[name] terrain population finished in [(REALTIMEOFDAY - start_time)/10]s!" + to_chat(world, span_boldannounce("[message]")) + log_world(message) + + +/datum/map_generator/cave_generator/jungle + possible_biomes = list( + BIOME_LOW_HEAT = list( + BIOME_LOW_HUMIDITY = /datum/biome/plains, + BIOME_MEDIUM_HUMIDITY = /datum/biome/mudlands, + BIOME_HIGH_HUMIDITY = /datum/biome/water + ), + BIOME_MEDIUM_HEAT = list( + BIOME_LOW_HUMIDITY = /datum/biome/plains, + BIOME_MEDIUM_HUMIDITY = /datum/biome/jungle/deep, + BIOME_HIGH_HUMIDITY = /datum/biome/jungle + ), + BIOME_HIGH_HEAT = list( + BIOME_LOW_HUMIDITY = /datum/biome/wasteland, + BIOME_MEDIUM_HUMIDITY = /datum/biome/plains, + BIOME_HIGH_HUMIDITY = /datum/biome/jungle/deep + ) + ) + + +#undef BIOME_RANDOM_SQUARE_DRIFT diff --git a/code/datums/mapgen/biomes/_biome.dm b/code/datums/mapgen/biomes/_biome.dm index 025b904434d2..a0672059d93a 100644 --- a/code/datums/mapgen/biomes/_biome.dm +++ b/code/datums/mapgen/biomes/_biome.dm @@ -2,39 +2,221 @@ /datum/biome ///Type of turf this biome creates var/turf_type - ///Chance of having a structure from the flora types list spawn + /// Chance of having a structure from the flora types list spawn var/flora_density = 0 - ///Chance of having a mob from the fauna types list spawn + /// Chance of spawning special features, such as geysers. + var/feature_density = 0 + /// Chance of having a mob from the fauna types list spawn var/fauna_density = 0 - ///list of type paths of objects that can be spawned when the turf spawns flora - var/list/flora_types = list(/obj/structure/flora/grass/jungle/a/style_random) - ///list of type paths of mobs that can be spawned when the turf spawns fauna + /// Weighted list of type paths of flora that can be spawned when the + /// turf spawns flora. + var/list/flora_types = list() + /// Weighted list of extra features that can spawn in the biome, such as + /// geysers. Gets expanded automatically. + var/list/feature_types = list() + /// Weighted list of type paths of fauna that can be spawned when the + /// turf spawns fauna. var/list/fauna_types = list() + +/datum/biome/New() + . = ..() + if(length(flora_types)) + flora_types = expand_weights(fill_with_ones(flora_types)) + + if(length(fauna_types)) + fauna_types = expand_weights(fill_with_ones(fauna_types)) + + if(length(feature_types)) + feature_types = expand_weights(feature_types) + + ///This proc handles the creation of a turf of a specific biome type /datum/biome/proc/generate_turf(turf/gen_turf) gen_turf.ChangeTurf(turf_type, null, CHANGETURF_DEFER_CHANGE) + if(length(flora_types) && prob(flora_density)) + var/obj/structure/flora = pick(flora_types) + new flora(gen_turf) + return + + if(length(feature_types) && prob(feature_density)) + var/atom/picked_feature = pick(feature_types) + new picked_feature(gen_turf) + return + if(length(fauna_types) && prob(fauna_density)) var/mob/fauna = pick(fauna_types) new fauna(gen_turf) - if(length(flora_types) && prob(flora_density)) + +/// This proc handles the creation of a turf of a specific biome type, assuming +/// that the turf has not been initialized yet. Don't call this unless you know +/// what you're doing. +/datum/biome/proc/generate_turf_for_terrain(turf/gen_turf) + var/turf/new_turf = new turf_type(gen_turf) + return new_turf + + +/** + * This proc handles the sequential creation of turfs of a specific biome type + * in order to optimize the generation for large amount of turfs. + * + * Arguments: + * * gen_turfs - List of turfs to use for turf generation. + * + * Returns a new list of turfs that were generated by the biome. + */ +/datum/biome/proc/generate_turfs_for_terrain(list/turf/gen_turfs) + var/list/turf/new_turfs = list() + + for(var/turf/gen_turf as anything in gen_turfs) + var/turf/new_turf = new turf_type(gen_turf) + new_turfs += new_turf + + if(gen_turf.turf_flags & NO_RUINS) + new_turf.turf_flags |= NO_RUINS + + CHECK_TICK + + return new_turfs + + +/// This proc handles populating the given turf based on whether flora, +/// features and fauna are allowed. Does not take megafauna into account. +/datum/biome/proc/populate_turf(turf/target_turf, flora_allowed, features_allowed, fauna_allowed) + if(flora_allowed && length(flora_types) && prob(flora_density)) var/obj/structure/flora = pick(flora_types) - new flora(gen_turf) + new flora(target_turf) + return TRUE + + if(features_allowed && prob(feature_density)) + var/can_spawn = TRUE + + var/atom/picked_feature = pick(feature_types) + + for(var/obj/structure/existing_feature in range(7, target_turf)) + if(istype(existing_feature, picked_feature)) + can_spawn = FALSE + break + + if(can_spawn) + new picked_feature(target_turf) + return TRUE + + if(fauna_allowed && length(fauna_types) && prob(fauna_density)) + var/mob/picked_mob = pick(fauna_types) + + // prevents tendrils spawning in each other's collapse range + if(ispath(picked_mob, /obj/structure/spawner/lavaland)) + for(var/obj/structure/spawner/lavaland/spawn_blocker in range(2, target_turf)) + return FALSE + + // if the random is not a tendril (hopefully meaning it is a mob), avoid spawning if there's another one within 12 tiles + else + var/list/things_in_range = range(12, target_turf) + for(var/mob/living/mob_blocker in things_in_range) + if(ismining(mob_blocker)) + return FALSE + + new picked_mob(target_turf) + return TRUE + + return FALSE + + +/** + * This proc handles populating the given turfs based on whether flora, features + * and fauna are allowed. Does not take megafauna into account. + * + * Does nothing if `flora_allowed`, `features_allowed` and `fauna_allowed` are + * `FALSE`, or if there's no flora, feature or fauna types for the matching + * allowed type. Aka, we return early if the proc wouldn't do anything anyway. + */ +/datum/biome/proc/populate_turfs(list/turf/target_turfs, flora_allowed, features_allowed, fauna_allowed) + if(!(flora_allowed && length(flora_types)) && !(features_allowed && length(feature_types)) && !(fauna_allowed && length(fauna_types))) + return + + + for(var/turf/target_turf as anything in target_turfs) + // We do the CHECK_TICK here because there's a bunch of continue calls + // in this. + CHECK_TICK + + if(flora_allowed && length(flora_types) && prob(flora_density)) + var/obj/structure/flora = pick(flora_types) + new flora(target_turf) + continue + + if(features_allowed && prob(feature_density)) + var/can_spawn = TRUE + + var/atom/picked_feature = pick(feature_types) + + for(var/obj/structure/existing_feature in range(7, target_turf)) + if(istype(existing_feature, picked_feature)) + can_spawn = FALSE + break + + if(can_spawn) + new picked_feature(target_turf) + continue + + if(fauna_allowed && length(fauna_types) && prob(fauna_density)) + var/mob/picked_mob = pick(fauna_types) + + // prevents tendrils spawning in each other's collapse range + if(ispath(picked_mob, /obj/structure/spawner/lavaland)) + for(var/obj/structure/spawner/lavaland/spawn_blocker in range(2, target_turf)) + continue + + // if the random is not a tendril (hopefully meaning it is a mob), avoid spawning if there's another one within 12 tiles + else + var/list/things_in_range = range(12, target_turf) + for(var/mob/living/mob_blocker in things_in_range) + if(ismining(mob_blocker)) + continue + + new picked_mob(target_turf) + /datum/biome/mudlands turf_type = /turf/open/misc/dirt/jungle/dark - flora_types = list(/obj/structure/flora/grass/jungle/a/style_random,/obj/structure/flora/grass/jungle/b/style_random, /obj/structure/flora/rock/pile/jungle/style_random, /obj/structure/flora/rock/pile/jungle/large/style_random) + flora_types = list( + /obj/structure/flora/grass/jungle/a/style_random = 1, + /obj/structure/flora/grass/jungle/b/style_random = 1, + /obj/structure/flora/rock/pile/jungle/style_random = 1, + /obj/structure/flora/rock/pile/jungle/large/style_random = 1, + ) flora_density = 3 /datum/biome/plains turf_type = /turf/open/misc/grass/jungle - flora_types = list(/obj/structure/flora/grass/jungle/a/style_random,/obj/structure/flora/grass/jungle/b/style_random, /obj/structure/flora/tree/jungle/style_random, /obj/structure/flora/rock/pile/jungle/style_random, /obj/structure/flora/bush/jungle/a/style_random, /obj/structure/flora/bush/jungle/b/style_random, /obj/structure/flora/bush/jungle/c/style_random, /obj/structure/flora/bush/large/style_random, /obj/structure/flora/rock/pile/jungle/large/style_random) + flora_types = list( + /obj/structure/flora/grass/jungle/a/style_random = 1, + /obj/structure/flora/grass/jungle/b/style_random = 1, + /obj/structure/flora/tree/jungle/style_random = 1, + /obj/structure/flora/rock/pile/jungle/style_random = 1, + /obj/structure/flora/bush/jungle/a/style_random = 1, + /obj/structure/flora/bush/jungle/b/style_random = 1, + /obj/structure/flora/bush/jungle/c/style_random = 1, + /obj/structure/flora/bush/large/style_random = 1, + /obj/structure/flora/rock/pile/jungle/large/style_random = 1, + ) flora_density = 15 /datum/biome/jungle turf_type = /turf/open/misc/grass/jungle - flora_types = list(/obj/structure/flora/grass/jungle/a/style_random,/obj/structure/flora/grass/jungle/b/style_random, /obj/structure/flora/tree/jungle/style_random, /obj/structure/flora/rock/pile/jungle/style_random, /obj/structure/flora/bush/jungle/a/style_random, /obj/structure/flora/bush/jungle/b/style_random, /obj/structure/flora/bush/jungle/c/style_random, /obj/structure/flora/bush/large/style_random, /obj/structure/flora/rock/pile/jungle/large/style_random) + flora_types = list( + /obj/structure/flora/grass/jungle/a/style_random = 1, + /obj/structure/flora/grass/jungle/b/style_random = 1, + /obj/structure/flora/tree/jungle/style_random = 1, + /obj/structure/flora/rock/pile/jungle/style_random = 1, + /obj/structure/flora/bush/jungle/a/style_random = 1, + /obj/structure/flora/bush/jungle/b/style_random = 1, + /obj/structure/flora/bush/jungle/c/style_random = 1, + /obj/structure/flora/bush/large/style_random = 1, + /obj/structure/flora/rock/pile/jungle/large/style_random = 1, + ) flora_density = 40 /datum/biome/jungle/deep diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index af91dcc1ef1e..bf490fb76d5e 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -99,6 +99,7 @@ GLOBAL_LIST_EMPTY(station_turfs) /// Never directly access this, use get_explosive_block() instead var/inherent_explosive_resistance = -1 + /turf/vv_edit_var(var_name, new_value) var/static/list/banned_edits = list(NAMEOF_STATIC(src, x), NAMEOF_STATIC(src, y), NAMEOF_STATIC(src, z)) if(var_name in banned_edits) @@ -180,6 +181,7 @@ GLOBAL_LIST_EMPTY(station_turfs) . = QDEL_HINT_IWILLGC if(!changing_turf) stack_trace("Incorrect turf deletion") + changing_turf = FALSE if(GET_LOWEST_STACK_OFFSET(z)) var/turf/T = GET_TURF_ABOVE(src) @@ -188,6 +190,7 @@ GLOBAL_LIST_EMPTY(station_turfs) T = GET_TURF_BELOW(src) if(T) T.multiz_turf_del(src, UP) + if(force) ..() //this will completely wipe turf state @@ -195,6 +198,7 @@ GLOBAL_LIST_EMPTY(station_turfs) for(var/A in B.contents) qdel(A) return + LAZYCLEARLIST(blueprint_data) flags_1 &= ~INITIALIZED_1 requires_activation = FALSE