Skip to content

Commit

Permalink
superconductivity removal
Browse files Browse the repository at this point in the history
  • Loading branch information
XeonMations committed Dec 27, 2024
1 parent 82a5bb7 commit caf4875
Show file tree
Hide file tree
Showing 14 changed files with 2 additions and 218 deletions.
1 change: 0 additions & 1 deletion code/__DEFINES/atmospherics/atmos_core.dm
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@

///moles in a 2.5 m^3 cell at 101.325 Pa and 20 degC (103 or so)
#define MOLES_CELLSTANDARD (ONE_ATMOSPHERE*CELL_VOLUME/(T20C*R_IDEAL_GAS_EQUATION))
///compared against for superconductivity
#define M_CELL_WITH_RATIO (MOLES_CELLSTANDARD * 0.005)
/// percentage of oxygen in a normal mixture of air
#define O2STANDARD 0.21
Expand Down
3 changes: 1 addition & 2 deletions code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,7 @@
#define SSAIR_HOTSPOTS 4
#define SSAIR_EXCITEDGROUPS 5
#define SSAIR_HIGHPRESSURE 6
#define SSAIR_SUPERCONDUCTIVITY 7
#define SSAIR_PROCESS_ATOMS 8
#define SSAIR_PROCESS_ATOMS 7

//Pipenet rebuild helper defines, these suck but it'll do for now
#define SSAIR_REBUILD_PIPENET 1
Expand Down
31 changes: 0 additions & 31 deletions code/controllers/subsystem/air.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ SUBSYSTEM_DEF(air)
var/cost_hotspots = 0
var/cost_groups = 0
var/cost_highpressure = 0
var/cost_superconductivity = 0
var/cost_pipenets = 0
var/cost_atmos_machinery = 0
var/cost_rebuilds = 0
Expand Down Expand Up @@ -41,7 +40,6 @@ SUBSYSTEM_DEF(air)


//Special functions lists
var/list/turf/active_super_conductivity = list()
var/list/turf/open/high_pressure_delta = list()
var/list/atom_process = list()
/// Reactions which will contribute to a hotspot's size.
Expand Down Expand Up @@ -73,7 +71,6 @@ SUBSYSTEM_DEF(air)
msg += "HS:[round(cost_hotspots,1)]|"
msg += "EG:[round(cost_groups,1)]|"
msg += "HP:[round(cost_highpressure,1)]|"
msg += "SC:[round(cost_superconductivity,1)]|"
msg += "PN:[round(cost_pipenets,1)]|"
msg += "AM:[round(cost_atmos_machinery,1)]|"
msg += "AO:[round(cost_atoms, 1)]|"
Expand All @@ -84,7 +81,6 @@ SUBSYSTEM_DEF(air)
msg += "HS:[hotspots.len]|"
msg += "EG:[excited_groups.len]|"
msg += "HP:[high_pressure_delta.len]|"
msg += "SC:[active_super_conductivity.len]|"
msg += "PN:[networks.len]|"
msg += "AM:[atmos_machinery.len]|"
msg += "AO:[atom_process.len]|"
Expand Down Expand Up @@ -243,18 +239,6 @@ SUBSYSTEM_DEF(air)
return
cost_highpressure = MC_AVERAGE(cost_highpressure, TICK_DELTA_TO_MS(cached_cost))
resumed = FALSE
currentpart = SSAIR_SUPERCONDUCTIVITY

if(currentpart == SSAIR_SUPERCONDUCTIVITY)
timer = TICK_USAGE_REAL
if(!resumed)
cached_cost = 0
process_super_conductivity(resumed)
cached_cost += TICK_USAGE_REAL - timer
if(state != SS_RUNNING)
return
cost_superconductivity = MC_AVERAGE(cost_superconductivity, TICK_DELTA_TO_MS(cached_cost))
resumed = FALSE
currentpart = SSAIR_PROCESS_ATOMS

if(currentpart == SSAIR_PROCESS_ATOMS)
Expand Down Expand Up @@ -285,7 +269,6 @@ SUBSYSTEM_DEF(air)
gas_reactions = SSair.gas_reactions
atmos_gen = SSair.atmos_gen
planetary = SSair.planetary
active_super_conductivity = SSair.active_super_conductivity
high_pressure_delta = SSair.high_pressure_delta
atom_process = SSair.atom_process
currentrun = SSair.currentrun
Expand Down Expand Up @@ -372,19 +355,6 @@ SUBSYSTEM_DEF(air)
if(MC_TICK_CHECK)
return


/datum/controller/subsystem/air/proc/process_super_conductivity(resumed = FALSE)
if (!resumed)
src.currentrun = active_super_conductivity.Copy()
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun
while(currentrun.len)
var/turf/T = currentrun[currentrun.len]
currentrun.len--
T.super_conduct()
if(MC_TICK_CHECK)
return

/datum/controller/subsystem/air/proc/process_hotspots(resumed = FALSE)
if (!resumed)
src.currentrun = hotspots.Copy()
Expand Down Expand Up @@ -848,7 +818,6 @@ GLOBAL_LIST_EMPTY(colored_images)
data["active_size"] = active_turfs.len
data["hotspots_size"] = hotspots.len
data["excited_size"] = excited_groups.len
data["conducting_size"] = active_super_conductivity.len
data["frozen"] = can_fire
data["show_all"] = display_all_groups
data["fire_count"] = times_fired
Expand Down
3 changes: 0 additions & 3 deletions code/controllers/subsystem/time_track.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ SUBSYSTEM_DEF(time_track)
"air_eg_cost",
"air_highpressure_cost",
"air_hotspots_cost",
"air_superconductivity_cost",
"air_pipenets_cost",
"air_rebuilds_cost",
"air_turf_count",
Expand Down Expand Up @@ -137,13 +136,11 @@ SUBSYSTEM_DEF(time_track)
SSair.cost_groups,
SSair.cost_highpressure,
SSair.cost_hotspots,
SSair.cost_superconductivity,
SSair.cost_pipenets,
SSair.cost_rebuilds,
length(SSair.hotspots),
length(SSair.networks),
length(SSair.high_pressure_delta),
//length(SSair.active_super_conductivity), // LINDA, I assume
SSdbcore.all_queries_num,
SSdbcore.queries_active_num,
SSdbcore.queries_standby_num
Expand Down
3 changes: 0 additions & 3 deletions code/game/machinery/doors/airlock_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,6 @@
DA.update_icon()
DA.update_name()

/obj/machinery/door/airlock/plasma/block_superconductivity() //we don't stop the heat~
return FALSE

/obj/machinery/door/airlock/plasma/attackby(obj/item/C, mob/user, params)
if(C.is_hot() > 300)//If the temperature of the object is over 300, then ignite
if(plasma_ignition(6, user))
Expand Down
5 changes: 0 additions & 5 deletions code/game/machinery/doors/door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,6 @@
if(!glass && GLOB.cameranet)
GLOB.cameranet.updateVisibility(src, 0)

/obj/machinery/door/block_superconductivity() // All non-glass airlocks block heat, this is intended.
if(opacity || heat_proof)
return TRUE
return FALSE

/obj/machinery/door/morgue
icon = 'icons/obj/doors/doormorgue.dmi'

Expand Down
3 changes: 0 additions & 3 deletions code/game/objects/structures/aliens.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,6 @@
smoothing_groups = list(SMOOTH_GROUP_ALIEN_RESIN, SMOOTH_GROUP_ALIEN_WALLS)
canSmoothWith = list(SMOOTH_GROUP_ALIEN_WALLS)

/obj/structure/alien/resin/wall/block_superconductivity()
return TRUE

/obj/structure/alien/resin/membrane
name = "resin membrane"
desc = "Resin just thin enough to let light pass through."
Expand Down
3 changes: 0 additions & 3 deletions code/game/objects/structures/holosign.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@
REMOVE_TRAIT(local, TRAIT_FIREDOOR_STOP, TRAIT_GENERIC)
return ..()

/obj/structure/holosign/barrier/atmos/block_superconductivity() //Didn't used to do this, but it's "normal", and will help ease heat flow transitions with the players.
return TRUE

/obj/structure/holosign/barrier/cyborg
name = "Energy Field"
desc = "A fragile energy field that blocks movement. Excels at blocking lethal projectiles."
Expand Down
3 changes: 0 additions & 3 deletions code/game/objects/structures/window.dm
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,6 @@ CREATION_TEST_IGNORE_SUBTYPES(/obj/structure/window)
explosion_block = 2
glass_type = /obj/item/stack/sheet/plasmarglass

/obj/structure/window/plasma/reinforced/block_superconductivity()
return TRUE

/datum/armor/plasma_reinforced
melee = 85
bullet = 20
Expand Down
3 changes: 0 additions & 3 deletions code/modules/antagonists/blob/structures/_blob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ CREATION_TEST_IGNORE_SUBTYPES(/obj/structure/blob)
result++
. -= result - 1

/obj/structure/blob/block_superconductivity()
return atmosblock

/obj/structure/blob/can_atmos_pass(turf/T, vertical = FALSE)
return !atmosblock

Expand Down
3 changes: 0 additions & 3 deletions code/modules/antagonists/cult/runes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -694,9 +694,6 @@ CREATION_TEST_IGNORE_SUBTYPES(/obj/effect/rune/wall)
GLOB.wall_runes -= src
return ..()

/obj/effect/rune/wall/block_superconductivity()
return density

/obj/effect/rune/wall/invoke(var/list/invokers)
if(recharging)
return
Expand Down
25 changes: 0 additions & 25 deletions code/modules/atmospherics/environmental/LINDA_system.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,12 @@
/turf/open/can_atmos_pass(turf/target_turf, vertical = FALSE)
var/can_pass = TRUE
var/direction = vertical ? get_dir_multiz(src, target_turf) : get_dir(src, target_turf)
var/opposite_direction = REVERSE_DIR(direction)
if(vertical && !(zAirOut(direction, target_turf) && target_turf.zAirIn(direction, src)))
can_pass = FALSE
if(blocks_air || target_turf.blocks_air)
can_pass = FALSE
//This path is a bit weird, if we're just checking with ourselves no sense asking objects on the turf
if (target_turf == src)
return can_pass

//Can't just return if canpass is false here, we need to set superconductivity
for(var/obj/checked_object in contents + target_turf.contents)
var/turf/other = (checked_object.loc == src ? target_turf : src)
if(CANATMOSPASS(checked_object, other, vertical))
continue
can_pass = FALSE
//the direction and open/closed are already checked on can_atmos_pass() so there are no arguments
if(checked_object.block_superconductivity())
atmos_superconductivity |= direction
target_turf.atmos_superconductivity |= opposite_direction
return FALSE //no need to keep going, we got all we asked (Is this even faster? fuck you it's soul)

//Superconductivity is a bitfield of directions we can't conduct with
//Yes this is really weird. Fuck you
atmos_superconductivity &= ~direction
target_turf.atmos_superconductivity &= ~opposite_direction

return can_pass

/atom/movable/proc/block_superconductivity() // objects that block air and don't let superconductivity act. Only firelocks atm.
return FALSE

/// This proc is a more deeply optimized version of immediate_calculate_adjacent_turfs
/// It contains dumbshit, and also stuff I just can't do at runtime
/// If you're not editing behavior, just read that proc. It's less bad
Expand Down
131 changes: 1 addition & 130 deletions code/modules/atmospherics/environmental/LINDA_turf_tile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

///list of turfs adjacent to us that air can flow onto
var/list/atmos_adjacent_turfs
///bitfield of dirs in which we are superconducitng
var/atmos_superconductivity = NONE

//used to determine whether we should archive
var/archived_cycle = 0
Expand Down Expand Up @@ -360,7 +358,7 @@
our_excited_group.turf_reactions |= reacting //Adds the flag to turf_reactions so excited groups can check for them before dismantling.

update_visuals()
if(!consider_superconductivity(starting = TRUE) && !active_hotspot && !(reacting & (REACTING | STOP_REACTIONS)))
if(!active_hotspot && !(reacting & (REACTING | STOP_REACTIONS)))
if(!our_excited_group) //If nothing of interest is happening, kill the active turf
SSair.remove_from_active(src) //This will kill any connected excited group, be careful (This broke atmos for 4 years)
if(cached_ticker > EXCITED_GROUP_DISMANTLE_CYCLES) //If you're stalling out, take a rest
Expand Down Expand Up @@ -560,132 +558,5 @@
display_id = wrapping_id
thing.vis_contents += GLOB.colored_turfs[display_id]

////////////////////////SUPERCONDUCTIVITY/////////////////////////////

/**
ALLLLLLLLLLLLLLLLLLLLRIGHT HERE WE GOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
Read the code for more details, but first, a brief concept discussion/area
Our goal here is to "model" heat moving through solid objects, so walls, windows, and sometimes doors.
We do this by heating up the floor itself with the heat of the gasmix ontop of it, this is what the coeffs are for here, they slow that movement
Then we go through the process below.
If an active turf is fitting, we add it to processing, conduct with any covered tiles, (read windows and sometimes walls)
Then we space some of our heat, and think about if we should stop conducting.
**/

/turf/proc/conductivity_directions()
if(archived_cycle < SSair.times_fired)
archive()
return ALL_CARDINALS

///Returns a set of directions that we should be conducting in, NOTE, atmos_superconductivity is ACTUALLY inversed, don't worrry about it
/turf/open/conductivity_directions()
if(blocks_air)
return ..()
for(var/direction in GLOB.cardinals)
var/turf/checked_turf = get_step(src, direction)
if(!(checked_turf in atmos_adjacent_turfs) && !(atmos_superconductivity & direction))
. |= direction

///These two procs are a bit of a web, I belive in you
/turf/proc/neighbor_conduct_with_src(turf/open/other)
if(!other.blocks_air) //Solid but neighbor is open
other.temperature_share_open_to_solid(src)
else //Both tiles are solid
other.share_temperature_mutual_solid(src, thermal_conductivity)
temperature_expose(null, temperature)

/turf/open/neighbor_conduct_with_src(turf/other)
if(blocks_air)
return ..()

if(!other.blocks_air) //Both tiles are open
var/turf/open/open_other = other
open_other.air.temperature_share(air, WINDOW_HEAT_TRANSFER_COEFFICIENT)
else //Open but neighbor is solid
temperature_share_open_to_solid(other)
SSair.add_to_active(src)

/turf/proc/super_conduct()
var/conductivity_directions = conductivity_directions()

if(conductivity_directions)
//Conduct with tiles around me
for(var/direction in GLOB.cardinals)
if(!(conductivity_directions & direction))
continue
var/turf/neighbor = get_step(src, direction)

if(!neighbor.thermal_conductivity)
continue

if(neighbor.archived_cycle < SSair.times_fired)
neighbor.archive()

neighbor.neighbor_conduct_with_src(src)

neighbor.consider_superconductivity()

radiate_to_spess()

finish_superconduction()

/turf/proc/finish_superconduction(temp = temperature)
//Make sure still hot enough to continue conducting heat
if(temp < MINIMUM_TEMPERATURE_FOR_SUPERCONDUCTION)
SSair.active_super_conductivity -= src
return FALSE

/turf/open/finish_superconduction()
//Conduct with air on my tile if I have it
if(!blocks_air)
temperature = air.temperature_share(null, thermal_conductivity, temperature, heat_capacity)
..((blocks_air ? temperature : air.temperature))

///Should we attempt to superconduct?
/turf/proc/consider_superconductivity(starting)
if(!thermal_conductivity)
return FALSE

SSair.active_super_conductivity |= src
return TRUE

/turf/open/consider_superconductivity(starting)
if(air.temperature < (starting?MINIMUM_TEMPERATURE_START_SUPERCONDUCTION:MINIMUM_TEMPERATURE_FOR_SUPERCONDUCTION))
return FALSE
if(air.heat_capacity() < M_CELL_WITH_RATIO) // Was: MOLES_CELLSTANDARD*0.1*0.05 Since there are no variables here we can make this a constant.
return FALSE
return ..()

/turf/closed/consider_superconductivity(starting)
if(temperature < (starting?MINIMUM_TEMPERATURE_START_SUPERCONDUCTION:MINIMUM_TEMPERATURE_FOR_SUPERCONDUCTION))
return FALSE
return ..()

/turf/proc/radiate_to_spess() //Radiate excess tile heat to space
if(temperature <= T0C) //Considering 0 degC as te break even point for radiation in and out
return
var/delta_temperature = (temperature_archived - TCMB) //hardcoded space temperature
// Because we keep losing energy, makes more sense for us to be the T2 here.
if(heat_capacity <= 0 || abs(delta_temperature) <= MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
return
// Heat should be positive in most cases
// coefficient applied first because some turfs have very big heat caps.
var/heat = CALCULATE_CONDUCTION_ENERGY(thermal_conductivity * delta_temperature, HEAT_CAPACITY_VACUUM, heat_capacity)
temperature -= heat / heat_capacity

/turf/open/proc/temperature_share_open_to_solid(turf/sharer)
sharer.temperature = air.temperature_share(null, sharer.thermal_conductivity, sharer.temperature, sharer.heat_capacity)

/turf/proc/share_temperature_mutual_solid(turf/sharer, conduction_coefficient) //This is all just heat sharing, don't get freaked out
var/delta_temperature = sharer.temperature_archived - temperature_archived
if(abs(delta_temperature) <= MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER || !heat_capacity || !sharer.heat_capacity)
return
var/heat = conduction_coefficient * CALCULATE_CONDUCTION_ENERGY(delta_temperature, heat_capacity, sharer.heat_capacity)
temperature += heat / heat_capacity //The higher your own heat cap the less heat you get from this arrangement
sharer.temperature -= heat / sharer.heat_capacity

#undef LAST_SHARE_CHECK
#undef PLANET_SHARE_CHECK
3 changes: 0 additions & 3 deletions code/modules/power/turbine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,6 @@
if(compressor)
compressor.locate_machinery()

/obj/machinery/power/turbine/block_superconductivity()
return TRUE

/obj/machinery/power/turbine/process()

if(!compressor)
Expand Down

0 comments on commit caf4875

Please sign in to comment.