Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
cc0ea45
chapter 1: refactor nutrition
Jul 28, 2026
9017712
chapter 2: remove COMSIG_ATOm_EXITED
Jul 28, 2026
fb20c39
chapter 3: remove COMSIG_MOVABLE_ENTERED_OBJ
Jul 28, 2026
5feaca0
chapter 4: modernize /turf/Enter
Jul 28, 2026
1eacd1e
chapter 5: nuke (haha) space nuke disk code
Jul 28, 2026
4430d9a
chapter 6: optimize /turf/Entered (thats all i have)
Jul 28, 2026
68342bf
chapter 7: remove unncessary handle_rotation calls in AM/Move
Jul 28, 2026
d25b517
chapter 8: kill human/Crossed
Jul 28, 2026
6cb59bc
WIP
Jul 28, 2026
5191e2c
WIP
Jul 29, 2026
ff4632c
feature complete (aside form reflection/merging, potentially)
Jul 31, 2026
7ef8df1
unused vars
Jul 31, 2026
408ac7c
c&d fix
Aug 1, 2026
cc2b6d7
implement compounding falloff properly (to be tested in more detail)
Aug 1, 2026
d85907b
fix falloff calc and only apply resistance after explosive effects, t…
Aug 1, 2026
bf20015
WIP - remove cellauto
Aug 1, 2026
6208963
add logging and kill cellauto for good
Aug 1, 2026
15fb84f
remove leftovers
Aug 1, 2026
31a8f89
visual adjustments
Aug 1, 2026
cb11f20
fix init error message
Aug 1, 2026
8a84e4c
Bump up Explosions scheduling due to issues with hijack crash
Aug 1, 2026
258ac18
divide explosion ring duration by 2
Aug 1, 2026
6860387
defer everything during hijack crash
Aug 2, 2026
9de0e26
Made explosion effects more tame
Aug 2, 2026
ea84aaf
fix missing passing environemental damage parameter
Aug 2, 2026
80f96a9
fix not eating the wave on origin turf
Aug 2, 2026
aa46464
fix explosion ring sprite not disappearing
Aug 2, 2026
e814a90
less dirt, faster but less sparks, runtime fix
Aug 2, 2026
7ad9602
Add synchronizing with ending of current explosions ; allows hijack c…
Aug 2, 2026
368cbd5
fix runtime with particles
Aug 2, 2026
fff8611
unused var fix
Aug 2, 2026
aa3cd12
change explo propagation function to more accurately follow blockers
Aug 4, 2026
d000ba4
chapter 4b: fix improper usage of /turf/Enter preventing foam/vehicle…
Aug 4, 2026
c09bd11
alpha = intensity
Aug 4, 2026
e2916e9
wait = 2
Aug 4, 2026
6e72a62
fix propagation (again)
Aug 5, 2026
af834da
chapter 4c: fix climbing down into open_space
Aug 6, 2026
1d64643
wait = 1
Aug 7, 2026
4146f56
spiral explosion, resistance on entering turf, refactor epicenter, re…
Aug 9, 2026
c18ef93
fix SHARP mine not exploding
Aug 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions code/__DEFINES/dcs/signals/atom/signals_atom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
/// Called when an atom has emp_act called on it, from /atom/emp_act: (severity)
#define COMSIG_ATOM_EMP_ACT "atom_emp_act"

//from base of atom/Exited(): (atom/movable/exiting, direction)
#define COMSIG_ATOM_EXITED "atom_exited"

/// Called when an atom is crossed by a movable atom
#define COMSIG_ATOM_CROSSED "atom_crossed"

3 changes: 0 additions & 3 deletions code/__DEFINES/dcs/signals/atom/signals_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@

#define COMSIG_MOVABLE_TURF_ENTER "movable_turf_enter"

/// Called when a movable atom enters an obj's contents (obj/entered, atom/old_loc)
#define COMSIG_MOVABLE_ENTERED_OBJ "atom_entered"

#define COMSIG_MOVABLE_PREBUCKLE "prebuckle" // this is the last chance to interrupt and block a buckle before it finishes
#define COMPONENT_BLOCK_BUCKLE (1<<0)

Expand Down
4 changes: 4 additions & 0 deletions code/__DEFINES/dcs/signals/signals_subsystem.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@
// All signals send the source datum of the signal as the first argument

///Subsystem signals

/// Fired by SSexplosion_waves when reaching a synchronization checkpoint
#define COMSIG_SS_EXPLOSION_WAVES_CHECKPOINT_REACHED "ss_explosion_waves_checkpoint_reached"

///From base of datum/controller/subsystem/Initialize
#define COMSIG_SUBSYSTEM_POST_INITIALIZE "subsystem_post_initialize"
3 changes: 2 additions & 1 deletion code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,16 @@
#define SS_PRIORITY_TIMER 700
#define SS_PRIORITY_AUTOFIRE 450
#define SS_PRIORITY_SOUND 250
#define SS_PRIORITY_EXPLOSION_WAVES 240
#define SS_PRIORITY_TICKER 200
#define SS_PRIORITY_NIGHTMARE 180
#define SS_PRIORITY_CHAT 155
#define SS_PRIORITY_STATPANEL 154
#define SS_PRIORITY_CELLAUTO 152
#define SS_PRIORITY_PROJECTILES 151
#define SS_PRIORITY_MOB 150
#define SS_PRIORITY_XENO 149
#define SS_PRIORITY_HUMAN 148
#define SS_PRIORITY_DELAYED_EX_ACT 140
#define SS_PRIORITY_STAMINA 126
#define SS_PRIORITY_COMPONENT 125
#define SS_PRIORITY_NANOUI 120
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/turf_flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#define TURF_BURNT (1<<6)
#define TURF_BREAKABLE (1<<7)
#define TURF_BROKEN (1<<8)
/// Turf is primarily comprised of water, such as a river or ocean turf
#define TURF_IS_WATER (1<<9)

//ChangeTurf options to change its behavior
#define CHANGETURF_DEFER_CHANGE (1<<0)
Expand Down
29 changes: 0 additions & 29 deletions code/controllers/subsystem/cellauto.dm

This file was deleted.

10 changes: 5 additions & 5 deletions code/controllers/subsystem/cmtv.dm
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ SUBSYSTEM_DEF(cmtv)
return

RegisterSignal(future_perspective_mob, list(COMSIG_PARENT_QDELETING, COMSIG_MOB_STAT_SET_DEAD, COMSIG_MOB_NESTED, COMSIG_MOB_LOGOUT, COMSIG_MOB_DEATH), PROC_REF(handle_reset_signal))
RegisterSignal(future_perspective_mob, COMSIG_MOVABLE_ENTERED_OBJ, PROC_REF(handle_reset_signal_immediate))
RegisterSignal(future_perspective_mob, COMSIG_MOVABLE_MOVED, PROC_REF(handle_reset_signal_immediate))
RegisterSignal(future_perspective_mob, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(handle_z_change))
RegisterSignal(future_perspective_mob.client, COMSIG_CLIENT_EYE_CHANGED, PROC_REF(handle_eye_change))
RegisterSignal(future_perspective_mob.client, COMSIG_CLIENT_PIXEL_X_CHANGED, PROC_REF(handle_pixel_x_change))
Expand Down Expand Up @@ -329,7 +329,7 @@ SUBSYSTEM_DEF(cmtv)
COMSIG_MOB_LOGOUT,
COMSIG_MOB_DEATH,
COMSIG_MOVABLE_Z_CHANGED,
COMSIG_MOVABLE_ENTERED_OBJ,
COMSIG_MOVABLE_MOVED,
))

if(current_perspective.client)
Expand Down Expand Up @@ -371,10 +371,10 @@ SUBSYSTEM_DEF(cmtv)
reset_perspective("Current perspective is no longer eligible (signal)")

/// Reset handler that immediately switches perspective to something generic while we wait
/datum/controller/subsystem/cmtv/proc/handle_reset_signal_immediate()
/datum/controller/subsystem/cmtv/proc/handle_reset_signal_immediate(atom/movable/source, oldloc, direct)
SIGNAL_HANDLER

reset_perspective("Current perspective is no longer eligible (instant signal)", instant = TRUE)
if(source.loc != oldloc && isobj(source.loc))
reset_perspective("Current perspective is no longer eligible (instant signal)", instant = TRUE)

/datum/controller/subsystem/cmtv/proc/handle_eye_change(client/source_client, new_eye)
SIGNAL_HANDLER
Expand Down
32 changes: 32 additions & 0 deletions code/controllers/subsystem/delayed_ex_act.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/// Handles ex_act calls to expensive things like mobs as defered actions to preserve game under high load
SUBSYSTEM_DEF(delayed_ex_act)
name = "Delayed Explosion Effects"
priority = SS_PRIORITY_DELAYED_EX_ACT // High prio but not SS_TICKER and shouldn't be used much
wait = 0.5 DECISECONDS
flags = SS_NO_INIT
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY

var/list/list/queued_work = list()
var/list/list/current_work

/datum/controller/subsystem/delayed_ex_act/fire(resumed = FALSE)
if(!resumed)
current_work = queued_work.Copy()
queued_work = list()

while(length(current_work))
var/list/order = current_work[current_work.len]
current_work.len--
var/atom/target = order[1]
if(!QDELETED(target)) // Very neccessary here
var/list/arguments = order.Copy(2, 0)
if(isliving(target) && length(arguments) >= 3)
var/datum/cause_data/cause_data = arguments[3]
log_explosion(target, cause_data)
target.ex_act(arglist(arguments))

if(MC_TICK_CHECK)
return

/datum/controller/subsystem/delayed_ex_act/proc/queue(atom/target, power, dir, datum/cause_data/cause_data, pierce = FALSE, enviro = FALSE)
queued_work += list(list(target, power, dir, cause_data, pierce, enviro))
55 changes: 55 additions & 0 deletions code/controllers/subsystem/explosion_waves.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
SUBSYSTEM_DEF(explosion_waves)
name = "Explosion Waves"
wait = 1
flags = SS_TICKER | SS_NO_INIT
priority = SS_PRIORITY_EXPLOSION_WAVES

var/list/datum/explosion_wave/queued = list()
var/list/datum/explosion_wave/currentrun

/// List of synchronization checkpoints. An arbitrary tag, followed by the explosion_wave-s that existed at that time
/// When all of these waves are gone, we fire a signal to let listeners know we've progressed past that state
var/alist/checkpoints = alist()

/datum/controller/subsystem/explosion_waves/fire(resumed = FALSE)
if(!resumed)
currentrun = queued.Copy()

while(length(currentrun))
var/datum/explosion_wave/current = currentrun[currentrun.len]
currentrun.len--
var/ret = current?.process(wait * world.tick_lag)
if(ret == PROCESS_KILL)
queued -= current
if(MC_TICK_CHECK)
return

for(var/name, checkpoint in checkpoints)
if(!length(checkpoint & queued))
checkpoints -= name
SEND_GLOBAL_SIGNAL(COMSIG_SS_EXPLOSION_WAVES_CHECKPOINT_REACHED, name)

/datum/controller/subsystem/explosion_waves/proc/queue(datum/explosion_wave/item)
queued += item

/datum/controller/subsystem/explosion_waves/proc/forget(datum/explosion_wave/item)
queued -= item
currentrun -= item

for(var/name, contents in checkpoints)
var/list/datum/explosion_wave/checkpoint_waves = contents
checkpoint_waves -= item

/datum/controller/subsystem/explosion_waves/proc/set_checkpoint(name)
checkpoints[name] = queued.Copy()

/// Waits until reaching said checkpoint. DON'T USE THIS PLEASE USE THE SIGNALS ABOVE
/datum/controller/subsystem/explosion_waves/proc/synchronize(name)
if(isnull(name))
var/static/notch = 1
name = "_dynamic_checkpoint_[notch++]"
set_checkpoint(name)
else if(!(name in checkpoints))
return TRUE
UNTIL(!(name in checkpoints))
return TRUE
25 changes: 8 additions & 17 deletions code/controllers/subsystem/minimap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -636,20 +636,12 @@ SUBSYSTEM_DEF(minimaps)
pixel_x = MINIMAP_PIXEL_FROM_WORLD(movable_loc.x) + minimap.x_offset
pixel_y = MINIMAP_PIXEL_FROM_WORLD(movable_loc.y) + minimap.y_offset

UnregisterSignal(source, COMSIG_MOVABLE_MOVED)

///Used to handle minimap tracking inside other movables
/atom/movable/proc/override_minimap_tracking()
var/image/blip = SSminimaps.images_by_source[src]
blip.RegisterSignal(loc, COMSIG_MOVABLE_MOVED, TYPE_PROC_REF(/image, minimap_on_move))
RegisterSignal(loc, COMSIG_ATOM_EXITED, PROC_REF(cancel_override_minimap_tracking))

///Stops minimap override tracking
/atom/movable/proc/cancel_override_minimap_tracking(atom/movable/source, atom/movable/mover)
SIGNAL_HANDLER
if(mover != src)
return
var/image/blip = SSminimaps.images_by_source[src]
blip?.UnregisterSignal(source, COMSIG_MOVABLE_MOVED)
UnregisterSignal(source, COMSIG_ATOM_EXITED)


/**
Expand Down Expand Up @@ -1183,7 +1175,7 @@ SUBSYSTEM_DEF(minimaps)
if(to_track)
RegisterSignal(to_track, COMSIG_PARENT_QDELETING, TYPE_PROC_REF(/datum/action/minimap, clear_locator_override))
if(owner && owner.loc == to_track)
RegisterSignal(to_track, COMSIG_ATOM_EXITED, TYPE_PROC_REF(/datum/action/minimap, on_exit_check))
RegisterSignal(to_track, COMSIG_MOVABLE_MOVED, TYPE_PROC_REF(/datum/action/minimap, on_exit_check))
if(owner)
RegisterSignal(new_track, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(on_owner_z_change))
var/turf/old_turf = get_turf(tracking)
Expand All @@ -1195,7 +1187,7 @@ SUBSYSTEM_DEF(minimaps)
if(to_track)
RegisterSignal(to_track, COMSIG_PARENT_QDELETING, TYPE_PROC_REF(/datum/action/minimap, clear_locator_override))
if(owner.loc == to_track)
RegisterSignal(to_track, COMSIG_ATOM_EXITED, TYPE_PROC_REF(/datum/action/minimap, on_exit_check))
RegisterSignal(to_track, COMSIG_MOVABLE_MOVED, TYPE_PROC_REF(/datum/action/minimap, on_exit_check))
RegisterSignal(new_track, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(on_owner_z_change))
var/turf/old_turf = get_turf(tracking)
if(old_turf.z != new_track.z)
Expand All @@ -1205,18 +1197,17 @@ SUBSYSTEM_DEF(minimaps)
locator.update(new_track)

///checks if we should clear override if the owner exits this atom
/datum/action/minimap/proc/on_exit_check(datum/source, atom/movable/mover)
/datum/action/minimap/proc/on_exit_check(atom/movable/source, oldloc, direction, Forced)
SIGNAL_HANDLER
if(mover && mover != owner)
return
clear_locator_override()
if(source.loc != oldloc)
clear_locator_override()

///CLears the locator override in case the override target is deleted
/datum/action/minimap/proc/clear_locator_override()
SIGNAL_HANDLER
if(!locator_override)
return
UnregisterSignal(locator_override, list(COMSIG_PARENT_QDELETING, COMSIG_ATOM_EXITED))
UnregisterSignal(locator_override, list(COMSIG_PARENT_QDELETING, COMSIG_MOVABLE_MOVED))
if(owner)
UnregisterSignal(locator_override, COMSIG_MOVABLE_Z_CHANGED)
RegisterSignal(owner, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(on_owner_z_change))
Expand Down
1 change: 0 additions & 1 deletion code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ SUBSYSTEM_DEF(ticker)
* SSsound: lowering SSsound freq probably won't help because it's just a worker for the sound queue, same amount of work gets queued anyway
* SSmob/SShuman/SSxeno: you don't want to touch these, because several systems down the line rely on the timing (2 SECONDS) for gameplay logic
* SSchat/SSinput: these are perf intensive but need to be SS_TICKER, changing wait would be troublesome and/or inconsequential for perf
* SScellauto: can't touch this because it would directly affect explosion spread speed
*/

SSlighting?.wait = 0.6 SECONDS // From 0.4, same but also heavily scales on player/scene density (higher = less frequent lighting updates which is very noticeable as you move)
Expand Down
8 changes: 4 additions & 4 deletions code/datums/ammo/shrapnel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@
icon_state = "shrapnel_glass"

/particles/shrapnel
icon = 'icons/obj/items/weapons/projectiles.dmi'
icon_state = "shrapnel_bright2"
icon = 'icons/effects/particles/generic_particles.dmi'
icon_state = "spark"
width = 1000
height = 1000
count = 100
count = 200
spawning = 0
lifespan = 0.6 SECONDS
fadein = 0.2 SECONDS
Expand All @@ -169,7 +169,7 @@
/obj/shrapnel_effect/New()
. = ..()
particles = new /particles/shrapnel
particles.spawning = rand(5,9) + rand(5,9)
particles.spawning = rand(50,80)
addtimer(CALLBACK(src, PROC_REF(stop)), 0.1 SECONDS)
QDEL_IN(src, 0.9 SECONDS)

Expand Down
Loading
Loading