mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 19:47:47 +01:00
Merge branch 'master' into kk-charpod
This commit is contained in:
+30
-4
@@ -18,6 +18,15 @@
|
||||
#define MC_AVG_FAST_UP_SLOW_DOWN(average, current) (average > current ? MC_AVERAGE_SLOW(average, current) : MC_AVERAGE_FAST(average, current))
|
||||
#define MC_AVG_SLOW_UP_FAST_DOWN(average, current) (average < current ? MC_AVERAGE_SLOW(average, current) : MC_AVERAGE_FAST(average, current))
|
||||
|
||||
///creates a running average of "things elapsed" per time period when you need to count via a smaller time period.
|
||||
///eg you want an average number of things happening per second but you measure the event every tick (50 milliseconds).
|
||||
///make sure both time intervals are in the same units. doesn't work if current_duration > total_duration or if total_duration == 0
|
||||
#define MC_AVG_OVER_TIME(average, current, total_duration, current_duration) ((((total_duration) - (current_duration)) / (total_duration)) * (average) + (current))
|
||||
|
||||
#define MC_AVG_MINUTES(average, current, current_duration) (MC_AVG_OVER_TIME(average, current, 1 MINUTES, current_duration))
|
||||
|
||||
#define MC_AVG_SECONDS(average, current, current_duration) (MC_AVG_OVER_TIME(average, current, 1 SECONDS, current_duration))
|
||||
|
||||
#define NEW_SS_GLOBAL(varname) if(varname != src){if(istype(varname)){Recover();qdel(varname);}varname = src;}
|
||||
|
||||
#define START_PROCESSING(Processor, Datum) if (!(Datum.datum_flags & DF_ISPROCESSING)) {Datum.datum_flags |= DF_ISPROCESSING;Processor.processing += Datum}
|
||||
@@ -70,18 +79,35 @@
|
||||
|
||||
#define SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/##X);\
|
||||
/datum/controller/subsystem/##X/New(){\
|
||||
NEW_SS_GLOBAL(SS##X);\
|
||||
PreInit();\
|
||||
NEW_SS_GLOBAL(SS##X);\
|
||||
PreInit();\
|
||||
}\
|
||||
/datum/controller/subsystem/##X
|
||||
|
||||
#define TIMER_SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/timer/##X);\
|
||||
/datum/controller/subsystem/timer/##X/New(){\
|
||||
NEW_SS_GLOBAL(SS##X);\
|
||||
PreInit();\
|
||||
}\
|
||||
/datum/controller/subsystem/timer/##X/fire() {..() /*just so it shows up on the profiler*/} \
|
||||
/datum/controller/subsystem/timer/##X
|
||||
|
||||
#define PROCESSING_SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/processing/##X);\
|
||||
/datum/controller/subsystem/processing/##X/New(){\
|
||||
NEW_SS_GLOBAL(SS##X);\
|
||||
PreInit();\
|
||||
NEW_SS_GLOBAL(SS##X);\
|
||||
PreInit();\
|
||||
}\
|
||||
/datum/controller/subsystem/processing/##X/fire() {..() /*just so it shows up on the profiler*/} \
|
||||
/datum/controller/subsystem/processing/##X
|
||||
|
||||
#define VERB_MANAGER_SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/verb_manager/##X);\
|
||||
/datum/controller/subsystem/verb_manager/##X/New(){\
|
||||
NEW_SS_GLOBAL(SS##X);\
|
||||
PreInit();\
|
||||
}\
|
||||
/datum/controller/subsystem/verb_manager/##X/fire() {..() /*just so it shows up on the profiler*/} \
|
||||
/datum/controller/subsystem/verb_manager/##X
|
||||
|
||||
// Boilerplate code for multi-step processors. See machines.dm for example use.
|
||||
#define INTERNAL_PROCESS_STEP(this_step, initial_step, proc_to_call, cost_var, next_step)\
|
||||
if(current_step == this_step || (initial_step && !resumed)) /* So we start at step 1 if not resumed.*/ {\
|
||||
|
||||
@@ -187,6 +187,10 @@ What is the naming convention for planes or layers?
|
||||
#define PLANE_PLAYER_HUD_ITEMS 96 //Separate layer with which to apply colorblindness
|
||||
#define PLANE_PLAYER_HUD_ABOVE 97 //Things above the player hud
|
||||
|
||||
#define RADIAL_BACKGROUND_LAYER 0
|
||||
///1000 is an unimportant number, it's just to normalize copied layers
|
||||
#define RADIAL_CONTENT_LAYER 1000
|
||||
|
||||
#define PLANE_ADMIN3 99 //Purely for shenanigans (above HUD)
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#define GLOBAL_PROC "some_magic_bullshit"
|
||||
|
||||
#define GLOBAL_PROC "some_magic_bullshit"
|
||||
/// A shorthand for the callback datum, [documented here](datum/callback.html)
|
||||
#define CALLBACK new /datum/callback
|
||||
|
||||
#define INVOKE_ASYNC world.ImmediateInvokeAsync
|
||||
|
||||
/// like CALLBACK but specifically for verb callbacks
|
||||
#define VERB_CALLBACK new /datum/callback/verb_callback
|
||||
|
||||
@@ -189,6 +189,8 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G
|
||||
#define FIRE_PRIORITY_CHAT 400
|
||||
#define FIRE_PRIORITY_OVERLAYS 500
|
||||
#define FIRE_PRIORITY_TIMER 700
|
||||
#define FIRE_PRIORITY_SPEECH_CONTROLLER 900
|
||||
#define FIRE_PRIORITY_DELAYED_VERBS 950
|
||||
#define FIRE_PRIORITY_INPUT 1000 // This must always always be the max highest priority. Player input must never be lost.
|
||||
|
||||
/**
|
||||
|
||||
@@ -1 +1,49 @@
|
||||
#define MOB_WATER_LAYER 36
|
||||
// These are used as the layers for the icons, as well as indexes in a list that holds onto them.
|
||||
// Technically the layers used are all -100+layer to make them FLOAT_LAYER overlays.
|
||||
//Human Overlays Indexes/////////
|
||||
#define MUTATIONS_LAYER 1 //Mutations like fat, and lasereyes
|
||||
#define SKIN_LAYER 2 //Skin things added by a call on species
|
||||
#define BLOOD_LAYER 3 //Bloodied hands/feet/anything else
|
||||
#define BODYPARTS_LAYER 4 //Bodyparts layer
|
||||
#define MOB_DAM_LAYER 5 //Injury overlay sprites like open wounds
|
||||
#define SURGERY_LAYER 6 //Overlays for open surgical sites
|
||||
#define UNDERWEAR_LAYER 7 //Underwear/bras/etc
|
||||
#define TAIL_LOWER_LAYER 8 //Tail as viewed from the south
|
||||
#define WING_LOWER_LAYER 9 //Wings as viewed from the south
|
||||
#define SHOES_LAYER_ALT 10 //Shoe-slot item (when set to be under uniform via verb)
|
||||
#define UNIFORM_LAYER 11 //Uniform-slot item
|
||||
#define ID_LAYER 12 //ID-slot item
|
||||
#define SHOES_LAYER 13 //Shoe-slot item
|
||||
#define GLOVES_LAYER 14 //Glove-slot item
|
||||
#define BELT_LAYER 15 //Belt-slot item
|
||||
#define SUIT_LAYER 16 //Suit-slot item
|
||||
#define TAIL_UPPER_LAYER 17 //Some species have tails to render (As viewed from the N, E, or W)
|
||||
#define GLASSES_LAYER 18 //Eye-slot item
|
||||
#define BELT_LAYER_ALT 19 //Belt-slot item (when set to be above suit via verb)
|
||||
#define SUIT_STORE_LAYER 20 //Suit storage-slot item
|
||||
#define BACK_LAYER 21 //Back-slot item
|
||||
#define HAIR_LAYER 22 //The human's hair
|
||||
#define HAIR_ACCESSORY_LAYER 23 //Simply move this up a number if things are added.
|
||||
#define EARS_LAYER 24 //Both ear-slot items (combined image)
|
||||
#define EYES_LAYER 25 //Mob's eyes (used for glowing eyes)
|
||||
#define FACEMASK_LAYER 26 //Mask-slot item
|
||||
#define GLASSES_LAYER_ALT 27 //So some glasses can appear on top of hair and things
|
||||
#define HEAD_LAYER 28 //Head-slot item
|
||||
#define HANDCUFF_LAYER 29 //Handcuffs, if the human is handcuffed, in a secret inv slot
|
||||
#define LEGCUFF_LAYER 30 //Same as handcuffs, for legcuffs
|
||||
#define L_HAND_LAYER 31 //Left-hand item
|
||||
#define R_HAND_LAYER 32 //Right-hand item
|
||||
#define WING_LAYER 33 //Wings or protrusions over the suit.
|
||||
#define TAIL_UPPER_LAYER_ALT 34 //Modified tail-sprite layer. Tend to be larger.
|
||||
#define MODIFIER_EFFECTS_LAYER 35 //Effects drawn by modifiers
|
||||
#define FIRE_LAYER 36 //'Mob on fire' overlay layer
|
||||
#define MOB_WATER_LAYER 37
|
||||
#define TARGETED_LAYER 38 //'Aimed at' overlay layer
|
||||
#define VORE_BELLY_LAYER 39
|
||||
#define VORE_TAIL_LAYER 40
|
||||
|
||||
#define TOTAL_LAYERS 40 // <---- KEEP THIS UPDATED, should always equal the highest number here, used to initialize a list.
|
||||
|
||||
//These two are only used for gargoyles currently
|
||||
#define HUMAN_BODY_LAYERS list(MUTATIONS_LAYER, TAIL_LOWER_LAYER, WING_LOWER_LAYER, BODYPARTS_LAYER, SKIN_LAYER, BLOOD_LAYER, MOB_DAM_LAYER, TAIL_UPPER_LAYER, HAIR_LAYER, HAIR_ACCESSORY_LAYER, EYES_LAYER, WING_LAYER, VORE_BELLY_LAYER, VORE_TAIL_LAYER, TAIL_UPPER_LAYER_ALT)
|
||||
#define HUMAN_OTHER_LAYERS list(MODIFIER_EFFECTS_LAYER, FIRE_LAYER, MOB_WATER_LAYER, TARGETED_LAYER)
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* verb queuing thresholds. remember that since verbs execute after SendMaps the player wont see the effects of the verbs on the game world
|
||||
* until SendMaps executes next tick, and then when that later update reaches them. thus most player input has a minimum latency of world.tick_lag + player ping.
|
||||
* however thats only for the visual effect of player input, when a verb processes the actual latency of game state changes or semantic latency is effectively 1/2 player ping,
|
||||
* unless that verb is queued for the next tick in which case its some number probably smaller than world.tick_lag.
|
||||
* so some verbs that represent player input are important enough that we only introduce semantic latency if we absolutely need to.
|
||||
* its for this reason why player clicks are handled in SSinput before even movement - semantic latency could cause someone to move out of range
|
||||
* when the verb finally processes but it was in range if the verb had processed immediately and overtimed.
|
||||
*/
|
||||
|
||||
///queuing tick_usage threshold for verbs that are high enough priority that they only queue if the server is overtiming.
|
||||
///ONLY use for critical verbs
|
||||
#define VERB_OVERTIME_QUEUE_THRESHOLD 100
|
||||
///queuing tick_usage threshold for verbs that need lower latency more than most verbs.
|
||||
#define VERB_HIGH_PRIORITY_QUEUE_THRESHOLD 95
|
||||
///default queuing tick_usage threshold for most verbs which can allow a small amount of latency to be processed in the next tick
|
||||
#define VERB_DEFAULT_QUEUE_THRESHOLD 85
|
||||
|
||||
///attempt to queue this verb process if the server is overloaded. evaluates to FALSE if queuing isnt necessary or if it failed.
|
||||
///_verification_args... are only necessary if the verb_manager subsystem youre using checks them in can_queue_verb()
|
||||
///if you put anything in _verification_args that ISNT explicitely put in the can_queue_verb() override of the subsystem youre using,
|
||||
///it will runtime.
|
||||
#define TRY_QUEUE_VERB(_verb_callback, _tick_check, _subsystem_to_use, _verification_args...) (_queue_verb(_verb_callback, _tick_check, _subsystem_to_use, _verification_args))
|
||||
///queue wrapper for TRY_QUEUE_VERB() when you want to call the proc if the server isnt overloaded enough to queue
|
||||
#define QUEUE_OR_CALL_VERB(_verb_callback, _tick_check, _subsystem_to_use, _verification_args...) \
|
||||
if(!TRY_QUEUE_VERB(_verb_callback, _tick_check, _subsystem_to_use, _verification_args)) {\
|
||||
_verb_callback:InvokeAsync() \
|
||||
};
|
||||
|
||||
//goes straight to SSverb_manager with default tick threshold
|
||||
#define DEFAULT_TRY_QUEUE_VERB(_verb_callback, _verification_args...) (TRY_QUEUE_VERB(_verb_callback, VERB_DEFAULT_QUEUE_THRESHOLD, null, _verification_args))
|
||||
#define DEFAULT_QUEUE_OR_CALL_VERB(_verb_callback, _verification_args...) QUEUE_OR_CALL_VERB(_verb_callback, VERB_DEFAULT_QUEUE_THRESHOLD, null, _verification_args)
|
||||
|
||||
//default tick threshold but nondefault subsystem
|
||||
#define TRY_QUEUE_VERB_FOR(_verb_callback, _subsystem_to_use, _verification_args...) (TRY_QUEUE_VERB(_verb_callback, VERB_DEFAULT_QUEUE_THRESHOLD, _subsystem_to_use, _verification_args))
|
||||
#define QUEUE_OR_CALL_VERB_FOR(_verb_callback, _subsystem_to_use, _verification_args...) QUEUE_OR_CALL_VERB(_verb_callback, VERB_DEFAULT_QUEUE_THRESHOLD, _subsystem_to_use, _verification_args)
|
||||
Reference in New Issue
Block a user