mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-01 04:52:16 +00:00
Misc priority & init order tweaks (#3977)
changes: early misc & seeds now load before atlas. ZAS now has priority 55 down from 80. Timer now has priority 45 down from (default) 50. Lighting now has priority 65 up from 20. The asteroid gen SS has been renamed to map finalization, and now does other map touch-up tasks like area sort, map datum finalization, and uplink init.
This commit is contained in:
@@ -78,3 +78,5 @@
|
||||
#define SS_INITSTATE_NONE 0
|
||||
#define SS_INITSTATE_STARTED 1
|
||||
#define SS_INITSTATE_DONE 2
|
||||
|
||||
#define SS_PRIORITY_DEFAULT 50
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
#define SS_INIT_MAPLOAD 22 // DMM parsing and load. Unless you know what you're doing, make sure this remains first.
|
||||
#define SS_INIT_JOBS 21
|
||||
#define SS_INIT_MISC_FIRST 20
|
||||
#define SS_INIT_SEEDS 19 // Plant controller setup.
|
||||
#define SS_INIT_ASTEROID 18 // Asteroid generation.
|
||||
#define SS_INIT_SHUTTLE 17 // Shuttle setup.
|
||||
#define SS_INIT_PARALLAX 16 // Parallax image cache generation. Must run before ghosts are able to join.
|
||||
#define SS_INIT_HOLOMAP 15
|
||||
#define SS_INIT_ATOMS 14 // World initialization. Will trigger lighting updates. Observers can join after this loads.
|
||||
#define SS_INIT_POWER 13 // Initial powernet build.
|
||||
#define SS_INIT_CARGO 12 // Random warehouse generation. Runs after SSatoms because it assumes objects are initialized when it runs.
|
||||
#define SS_INIT_PIPENET 11 // Initial pipenet build.
|
||||
#define SS_INIT_MACHINERY 10 // Machinery prune and powernet build.
|
||||
#define SS_INIT_AIR 9 // Air setup and pre-bake.
|
||||
#define SS_INIT_NIGHT 8 // Nightmode controller. Will trigger lighting updates.
|
||||
#define SS_INIT_SMOOTHING 7 // Object icon smoothing. Creates overlays.
|
||||
#define SS_INIT_ICON_UPDATE 6 // Icon update queue flush. Should run before overlays.
|
||||
#define SS_INIT_AO 5 // Wall AO neighbour build.
|
||||
#define SS_INIT_OVERLAY 4 // Overlay flush.
|
||||
#define SS_INIT_MISC 3 // Subsystems without an explicitly set initialization order start here.
|
||||
#define SS_INIT_SUNLIGHT 2 // Sunlight setup. Creates lots of lighting & SSopenturf updates.
|
||||
#define SS_INIT_LIGHTING 1 // Generation of lighting overlays and pre-bake. May cause openturf updates, should initialize before SSopenturf.
|
||||
#define SS_INIT_OPENTURF 0 // Openturf flush. Should run after SSoverlay & SSicon_smooth so it copies the smoothed sprites.
|
||||
#define SS_INIT_LOBBY -1 // Lobby timer starts here.
|
||||
#define SS_INIT_MISC_FIRST 22
|
||||
#define SS_INIT_SEEDS 21 // Plant controller setup.
|
||||
#define SS_INIT_MAPLOAD 20 // DMM parsing and load. Unless you know what you're doing, make sure this remains first.
|
||||
#define SS_INIT_JOBS 19
|
||||
#define SS_INIT_MAPFINALIZE 18 // Asteroid generation.
|
||||
#define SS_INIT_SHUTTLE 17 // Shuttle setup.
|
||||
#define SS_INIT_PARALLAX 16 // Parallax image cache generation. Must run before ghosts are able to join.
|
||||
#define SS_INIT_HOLOMAP 15
|
||||
#define SS_INIT_ATOMS 14 // World initialization. Will trigger lighting updates. Observers can join after this loads.
|
||||
#define SS_INIT_POWER 13 // Initial powernet build.
|
||||
#define SS_INIT_CARGO 12 // Random warehouse generation. Runs after SSatoms because it assumes objects are initialized when it runs.
|
||||
#define SS_INIT_PIPENET 11 // Initial pipenet build.
|
||||
#define SS_INIT_MACHINERY 10 // Machinery prune and powernet build.
|
||||
#define SS_INIT_AIR 9 // Air setup and pre-bake.
|
||||
#define SS_INIT_NIGHT 8 // Nightmode controller. Will trigger lighting updates.
|
||||
#define SS_INIT_SMOOTHING 7 // Object icon smoothing. Creates overlays.
|
||||
#define SS_INIT_ICON_UPDATE 6 // Icon update queue flush. Should run before overlays.
|
||||
#define SS_INIT_AO 5 // Wall AO neighbour build.
|
||||
#define SS_INIT_OVERLAY 4 // Overlay flush.
|
||||
#define SS_INIT_MISC 3 // Subsystems without an explicitly set initialization order start here.
|
||||
#define SS_INIT_SUNLIGHT 2 // Sunlight setup. Creates lots of lighting & SSopenturf updates.
|
||||
#define SS_INIT_LIGHTING 1 // Generation of lighting overlays and pre-bake. May cause openturf updates, should initialize before SSopenturf.
|
||||
#define SS_INIT_OPENTURF 0 // Openturf flush. Should run after SSoverlay & SSicon_smooth so it copies the smoothed sprites.
|
||||
#define SS_INIT_LOBBY -1 // Lobby timer starts here. The lobby timer won't actually start going down until the MC starts ticking, so you probably want this last.
|
||||
|
||||
// Something to remember when setting priorities: SS_TICKER runs before Normal, which runs before SS_BACKGROUND.
|
||||
// Each group has its own priority bracket.
|
||||
@@ -29,31 +29,35 @@
|
||||
|
||||
// SS_TICKER
|
||||
#define SS_PRIORITY_OVERLAY 500 // Applies overlays. May cause overlay pop-in if it gets behind.
|
||||
#define SS_PRIORITY_SMOOTHING 35 // Smooth turf generation.
|
||||
//#define SS_PRIORITY_DEFAULT 50 // This is defined somewhere else.
|
||||
#define SS_PRIORITY_TIMER 45 // Timed event scheduling. This is important.
|
||||
#define SS_PRIORITY_SMOOTHING 35 // Smooth turf generation.
|
||||
#define SS_PRIORITY_ORBIT 30 // Orbit datum updates.
|
||||
#define SS_PRIORITY_ICON_UPDATE 20 // Queued icon updates. Mostly used by APCs and tables.
|
||||
|
||||
// Normal
|
||||
#define SS_PRIORITY_TICKER 200 // Gameticker.
|
||||
#define SS_PRIORITY_MOB 150 // Mob Life().
|
||||
#define SS_PRIORITY_NANOUI 120 // UI updates.
|
||||
#define SS_PRIORITY_VOTE 110
|
||||
#define SS_PRIORITY_TICKER 200 // Gameticker.
|
||||
#define SS_PRIORITY_MOB 150 // Mob Life().
|
||||
#define SS_PRIORITY_NANOUI 120 // UI updates.
|
||||
#define SS_PRIORITY_VOTE 110
|
||||
#define SS_PRIORITY_ELECTRONICS 100 // Integrated Electronics processing.
|
||||
#define SS_PRIORITY_MACHINERY 95 // Machinery + powernet ticks.
|
||||
#define SS_PRIORITY_CHEMISTRY 90 // Multi-tick chemical reactions.
|
||||
#define SS_PRIORITY_SHUTTLE 85 // Shuttle movement.
|
||||
#define SS_PRIORITY_AIR 80 // ZAS processing.
|
||||
#define SS_PRIORITY_CALAMITY 75 // Singularity, Tesla, Nar'sie, blob, etc.
|
||||
#define SS_PRIORITY_EVENT 70
|
||||
#define SS_PRIORITY_LIGHTING 65 // Queued lighting engine updates.
|
||||
#define SS_PRIORITY_DISEASE 60 // Disease ticks.
|
||||
#define SS_PRIORITY_ALARMS 50
|
||||
#define SS_PRIORITY_AIR 55 // ZAS processing.
|
||||
//#define SS_PRIORITY_DEFAULT 50 // This is defined somewhere else.
|
||||
#define SS_PRIORITY_ALARMS 45
|
||||
#define SS_PRIORITY_PLANTS 40 // Spreading plant effects.
|
||||
#define SS_PRIORITY_EFFECTS 35 // Effect master (Sparks)
|
||||
#define SS_PRIORITY_LIGHTING 20 // Queued lighting engine updates.
|
||||
#define SS_PRIORITY_EFFECTS 35 // New-style effects manager. Timing of effects may be off if this gets too far behind.
|
||||
#define SS_PRIORITY_AIRFLOW 15 // Handles object movement due to ZAS airflow.
|
||||
#define SS_PRIORITY_OPENTURF 10 // Open turf icon generation/updates.
|
||||
|
||||
// SS_BACKGROUND
|
||||
//#define SS_PRIORITY_DEFAULT 50 // This is defined somewhere else.
|
||||
#define SS_PRIORITY_MODIFIER 18
|
||||
#define SS_PRIORITY_ARRIVALS 16 // Centcomm arrivals shuttle auto-launch. Usually asleep.
|
||||
#define SS_PRIORITY_PROCESSING 15 // Generic datum processor. Replaces objects processor.
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
/datum/controller/subsystem
|
||||
// Metadata; you should define these.
|
||||
name = "fire coderbus" //name of the subsystem
|
||||
var/init_order = SS_INIT_MISC //order of initialization. Higher numbers are initialized first, lower numbers later. Can be decimal and negative values.
|
||||
var/wait = 20 //time to wait between each call to fire(). Must be a positive integer. In ticks if SS_TICKER, deciseconds otherwise.
|
||||
var/priority = 50 //When mutiple subsystems need to run in the same tick, higher priority subsystems will run first and be given a higher share of the tick before MC_TICK_CHECK triggers a sleep.
|
||||
name = "fire coderbus" //name of the subsystem
|
||||
var/init_order = SS_INIT_MISC //order of initialization. Higher numbers are initialized first, lower numbers later. Can be decimal and negative values.
|
||||
var/wait = 20 //time to wait between each call to fire(). Must be a positive integer. In ticks if SS_TICKER, deciseconds otherwise.
|
||||
var/priority = SS_PRIORITY_DEFAULT //When mutiple subsystems need to run in the same tick, higher priority subsystems will run first and be given a higher share of the tick before MC_TICK_CHECK triggers a sleep.
|
||||
|
||||
var/flags = 0 //see master_controller.dm in __defines. Most flags must be set on world start to take full effect. (You can also restart the mc to force them to process again)
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
/datum/controller/subsystem/asteroid
|
||||
name = "Asteroid"
|
||||
flags = SS_NO_FIRE | SS_NO_DISPLAY
|
||||
init_order = SS_INIT_ASTEROID
|
||||
|
||||
/datum/controller/subsystem/asteroid/Initialize(timeofday)
|
||||
if(config.generate_asteroid)
|
||||
current_map.generate_asteroid()
|
||||
|
||||
..()
|
||||
@@ -63,8 +63,6 @@ var/datum/controller/subsystem/atlas/SSatlas
|
||||
|
||||
setup_multiz()
|
||||
|
||||
current_map.finalize_load()
|
||||
|
||||
QDEL_NULL(maploader)
|
||||
|
||||
..()
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
// The area list is put together here, because some things need it early on. Turrets controls, for example.
|
||||
|
||||
/datum/controller/subsystem/finalize
|
||||
name = "Map Finalization"
|
||||
flags = SS_NO_FIRE | SS_NO_DISPLAY
|
||||
init_order = SS_INIT_MAPFINALIZE
|
||||
|
||||
/datum/controller/subsystem/finalize/Initialize(timeofday)
|
||||
// Setup the global antag uplink. This needs to be done after SSatlas as it requires current_map.
|
||||
global.uplink = new
|
||||
|
||||
current_map.finalize_load()
|
||||
|
||||
if(config.generate_asteroid)
|
||||
current_map.generate_asteroid()
|
||||
|
||||
// Generate the area list.
|
||||
resort_all_areas()
|
||||
|
||||
..()
|
||||
|
||||
/proc/resort_all_areas()
|
||||
all_areas = list()
|
||||
for (var/area/A in world)
|
||||
all_areas += A
|
||||
|
||||
sortTim(all_areas, /proc/cmp_name_asc)
|
||||
@@ -1,6 +1,5 @@
|
||||
// This is one of the first subsystems initialized by the MC.
|
||||
// Stuff that should be loaded before everything else that isn't significant enough to get its own SS goes here.
|
||||
// The area list is put together here, because some things need it early on. Turrets controls, for example.
|
||||
|
||||
/datum/controller/subsystem/misc_early
|
||||
name = "Early Miscellaneous Init"
|
||||
@@ -8,11 +7,6 @@
|
||||
flags = SS_NO_FIRE | SS_NO_DISPLAY
|
||||
|
||||
/datum/controller/subsystem/misc_early/Initialize(timeofday)
|
||||
uplink = new
|
||||
|
||||
// Generate the area list.
|
||||
resort_all_areas()
|
||||
|
||||
// Create the data core, whatever that is.
|
||||
data_core = new /datum/datacore()
|
||||
|
||||
@@ -48,10 +42,3 @@
|
||||
discord_bot.alert_server_visibility()
|
||||
|
||||
..()
|
||||
|
||||
/proc/resort_all_areas()
|
||||
all_areas = list()
|
||||
for (var/area/A in world)
|
||||
all_areas += A
|
||||
|
||||
sortTim(all_areas, /proc/cmp_name_asc)
|
||||
@@ -7,7 +7,7 @@ var/datum/controller/subsystem/timer/SStimer
|
||||
/datum/controller/subsystem/timer
|
||||
name = "Timer"
|
||||
wait = 1 //SS_TICKER subsystem, so wait is in ticks
|
||||
init_order = 1
|
||||
priority = SS_PRIORITY_TIMER
|
||||
|
||||
flags = SS_FIRE_IN_LOBBY|SS_TICKER|SS_NO_INIT
|
||||
|
||||
|
||||
Reference in New Issue
Block a user