Files
Bubberstation/code/__DEFINES/_tick.dm
SkyratBot ea7677aedb [MIRROR] Enables 514 testing on master, Removes all reliance on extools outside of maptick (#3224)
* Enables 514 testing on master, Removes all reliance on extools outside of maptick (#56724)

* Uses 514's map_cpu var when it's available

* Uses auxtools for the debugger, to supply cross verison compatibility

* Nukes extools reference tracking, reinstates the old ref tracking system

* Enables 514 testing on master, Removes all reliance on extools outside of maptick

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2021-02-09 09:46:34 +00:00

33 lines
1.4 KiB
Plaintext

/// Percentage of tick to leave for master controller to run
#define MAPTICK_MC_MIN_RESERVE 58 //SKYRAT EDIT ORIGINAL: 70
/// internal_tick_usage is updated every tick by extools
#ifdef USE_EXTOOLS
#define MAPTICK_LAST_INTERNAL_TICK_USAGE ((GLOB.internal_tick_usage / world.tick_lag) * 100)
#else
#define MAPTICK_LAST_INTERNAL_TICK_USAGE (world.map_cpu)
#endif
/// Tick limit while running normally
#define TICK_BYOND_RESERVE 2
#define TICK_LIMIT_RUNNING (max(100 - TICK_BYOND_RESERVE - MAPTICK_LAST_INTERNAL_TICK_USAGE, MAPTICK_MC_MIN_RESERVE))
/// Tick limit used to resume things in stoplag
#define TICK_LIMIT_TO_RUN 58 //SKYRAT EDIT ORIGINAL: 70
/// Tick limit for MC while running
#define TICK_LIMIT_MC 58 //SKYRAT EDIT ORIGINAL: 70
/// Tick limit while initializing
#define TICK_LIMIT_MC_INIT_DEFAULT (100 - TICK_BYOND_RESERVE)
/// for general usage of tick_usage
#define TICK_USAGE world.tick_usage
/// to be used where the result isn't checked
#define TICK_USAGE_REAL world.tick_usage
/// Returns true if tick_usage is above the limit
#define TICK_CHECK ( TICK_USAGE > Master.current_ticklimit )
/// runs stoplag if tick_usage is above the limit
#define CHECK_TICK ( TICK_CHECK ? stoplag() : 0 )
/// Returns true if tick usage is above 95, for high priority usage
#define TICK_CHECK_HIGH_PRIORITY ( TICK_USAGE > 95 )
/// runs stoplag if tick_usage is above 95, for high priority usage
#define CHECK_TICK_HIGH_PRIORITY ( TICK_CHECK_HIGH_PRIORITY? stoplag() : 0 )