Nuke Limb Processing (#22814)

<img width="1549" height="857" alt="image"
src="https://github.com/user-attachments/assets/3830233d-0635-4942-b2aa-024651e6cffa"
/>

Limbs make up roughly half of the "Per additional player" processing
overhead, while Organs make up most of the other half.
Not every organ is an easy candidate for "Event-only processing", but
external limbs are significantly easier to do so.

So this PR makes it so that External Limbs no longer require Processing
unless an event happens that would justify them requiring processing.
Which SIGNIFICANTLY reduces the overall additional cost to the
Processing subsystem per player that joins the server.

Oh and I also made the Appendix and Kidneys not require constant
processing. The Appendix will only process if it is hit by an
Appendicitis event, and the Kidneys will only process if they are either
damaged, or you get poisoned.
This commit is contained in:
VMSolidus
2026-07-12 16:45:24 -04:00
committed by GitHub
parent 48d8a06d1c
commit e117ef3f87
44 changed files with 310 additions and 216 deletions
+4 -6
View File
@@ -39,20 +39,17 @@
return ..()
/// Sets the internal organ as belonging to the targeted external organ, and matches the target's species/robotness. Also updates all organ lists belonging to the owner.
/obj/item/organ/internal/replaced(var/mob/living/carbon/human/target, var/obj/item/organ/external/affected)
if(!istype(target))
return 0
/obj/item/organ/internal/replaced(mob/living/carbon/human/target, obj/item/organ/external/affected)
. = ..()
// robotic organs emulate behavior of the equivalent flesh organ of the species
if(BP_IS_ROBOTIC(src) || !species)
species = target.species
..()
target.internal_organs |= src
affected.internal_organs |= src
target.internal_organs_by_name[organ_tag] = src
return 1
return TRUE
/obj/item/organ/internal/die()
..()
@@ -121,6 +118,7 @@
min_bruised_damage = FLOOR(0.25 * max_damage, 1)
/obj/item/organ/internal/proc/take_internal_damage(amount, var/silent=0)
START_PROCESSING(SSprocessing, src)
if(BP_IS_ROBOTIC(src))
damage = between(0, src.damage + (amount * 0.8), max_damage)
else
+8 -1
View File
@@ -21,6 +21,13 @@
/// The amount of damage an appendix takes per second while in stage 2 of appendicitis.
var/stage_two_organ_damage_per_second = 0.006
/**
* Override so that the appendix will never process on its own.
* It is instead added to processing via the spontaneous_appendicitis event.
*/
/obj/item/organ/internal/appendix/process_initialize()
return
/obj/item/organ/internal/appendix/update_icon()
..()
if(inflamed)
@@ -30,7 +37,7 @@
/obj/item/organ/internal/appendix/process(seconds_per_tick)
..()
if(!owner || !inflamed || !BP_IS_ROBOTIC(src))
return
return PROCESS_KILL
if(owner.stasis_value > 0)
// Decrease the effective tickrate when in stasis.
+6 -3
View File
@@ -43,9 +43,9 @@
var/dead_toxin_accumulation_per_second = 0.66
/obj/item/organ/internal/kidneys/process(seconds_per_tick)
..()
if(!owner)
return
. = ..()
if(. == PROCESS_KILL || !owner)
return PROCESS_KILL
if(owner.stasis_value > 0) // Decrease the effective tickrate when in stasis.
seconds_per_tick /= owner.stasis_value
@@ -72,3 +72,6 @@
owner.adjustToxLoss(broken_toxin_accumulation_per_second * seconds_per_tick)
if(status & ORGAN_DEAD)
owner.adjustToxLoss(dead_toxin_accumulation_per_second * seconds_per_tick)
if (!owner.getToxLoss() && !damage) // None of the conditions triggered, therefore we have healthy kidneys that we don't care about.
return PROCESS_KILL