Files
Bubberstation/code/controllers/subsystem/processing/turrets.dm
T
Lucy bb744805a0 Make turrets only process when something "interesting" is in its range. (#94777)
## About The Pull Request

Port from https://github.com/Monkestation/Monkestation2.0/pull/10330, as
promised in https://github.com/tgstation/tgstation/pull/94757

This adds a proximity monitor to all turrets - they now track
"interesting" targets within the turret's range, and the turret will
only process if at least 1 thing is being tracked.

The proximity monitor's checks for what's "interesting" are slightly
less thorough than the turret's, and thus, it may still track something
the turret will ignore regardless - but that's still better than the
turret processing when nothing's nearby anyways.

This also makes a new processing subsystem, SSturrets, as turret
processing can be somewhat intensive in process, so like, let's not let
them hog the SSmachines tick (plus, I honestly believe that splitting
things into more specific processing subsystems is better for allowing
the MC to manage tick time with more granularity). SSturrets has the
same flags and wait as SSmachines.

## Why It's Good For The Game

Should improve performance quite a bit - mainly, turrets on space ruins
shouldn't waste tick time when there's nothing even near them.

## Changelog
🆑
refactor: Refactored turrets so they only process if something
potentially "interesting" is within its range.
/🆑
2026-01-20 20:01:48 -05:00

7 lines
342 B
Plaintext

/// The subsystem used for portable turrets, as they're relatively more intensive compared to most other machines, so we don't want them hogging tick usage from everything else.
PROCESSING_SUBSYSTEM_DEF(turrets)
name = "Turret Processing"
flags = SS_NO_INIT | SS_KEEP_TIMING
wait = 2 SECONDS
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME