diff --git a/.vscode/launch.json b/.vscode/launch.json index e01beb7171..39f599fd9c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,6 +7,13 @@ "name": "Launch DreamSeeker", "preLaunchTask": "Build All", "dmb": "${workspaceFolder}/${command:CurrentDMB}" + }, + { + "type": "byond", + "request": "launch", + "name": "Launch DreamSeeker (TRACY)", + "preLaunchTask": "Build All (TRACY)", + "dmb": "${workspaceFolder}/${command:CurrentDMB}" }, { "type": "byond", @@ -45,6 +52,13 @@ "preLaunchTask": "Build All (LOWMEMORYMODE)", "dmb": "${workspaceFolder}/${command:CurrentDMB}", "dreamDaemon": true + }, + { + "type": "byond", + "request": "launch", + "name": "Launch DreamSeeker (LOWMEMORYMODE + TRACY)", + "preLaunchTask": "Build All (LOWMEMORYMODE TRACY)", + "dmb": "${workspaceFolder}/${command:CurrentDMB}" } ] } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 155c69ee99..5c8886b0c9 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -24,6 +24,31 @@ "dependsOn": "dm: reparse", "label": "Build All" }, + { + "type": "process", + "command": "tools/build/build", + "windows": { + "command": ".\\tools\\build\\build.bat" + }, + "options": { + "env": { + "DM_EXE": "${config:dreammaker.byondPath}" + } + }, + "problemMatcher": [ + "$dreammaker", + "$tsc", + "$eslint-stylish" + ], + "group": { + "kind": "build" + }, + "dependsOn": "dm: reparse", + "args": [ + "-DUSE_BYOND_TRACY" + ], + "label": "Build All (TRACY)" + }, { "type": "process", "command": "tools/build/build", @@ -74,6 +99,32 @@ ], "label": "Build All (LOWMEMORYMODE)" }, + { + "type": "process", + "command": "tools/build/build", + "windows": { + "command": ".\\tools\\build\\build.bat" + }, + "options": { + "env": { + "DM_EXE": "${config:dreammaker.byondPath}" + } + }, + "problemMatcher": [ + "$dreammaker", + "$tsc", + "$eslint-stylish" + ], + "group": { + "kind": "build" + }, + "dependsOn": "dm: reparse", + "args": [ + "-DLOWMEMORYMODE", + "-DUSE_BYOND_TRACY" + ], + "label": "Build All (LOWMEMORYMODE TRACY)" + }, { "type": "dreammaker", "dme": "tgstation.dme", diff --git a/code/_compile_options.dm b/code/_compile_options.dm index 1ed2075537..ef9692d2a3 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -45,6 +45,10 @@ //#define UNIT_TESTS //If this is uncommented, we do a single run though of the game setup and tear down process with unit tests in between +// If this is uncommented, will attempt to load and initialize prof.dll/libprof.so. +// We do not ship byond-tracy. Build it yourself here: https://github.com/mafemergency/byond-tracy/ +//#define USE_BYOND_TRACY + #ifndef PRELOAD_RSC //set to: #define PRELOAD_RSC 2 // 0 to allow using external resources or on-demand behaviour; #endif // 1 to use the default behaviour; diff --git a/code/controllers/master.dm b/code/controllers/master.dm index b6fb14a695..e695b0fd0b 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -292,7 +292,8 @@ GLOBAL_REAL(Master, /datum/controller/master) = new SS.state = SS_IDLE if (SS.flags & SS_TICKER) tickersubsystems += SS - timer += world.tick_lag * rand(1, 5) + // Timer subsystems aren't allowed to bunch up, so we offset them a bit + timer += world.tick_lag * rand(0, 1) SS.next_fire = timer continue @@ -371,14 +372,16 @@ GLOBAL_REAL(Master, /datum/controller/master) = new var/checking_runlevel = current_runlevel if(cached_runlevel != checking_runlevel) //resechedule subsystems + var/list/old_subsystems = current_runlevel_subsystems cached_runlevel = checking_runlevel current_runlevel_subsystems = runlevel_sorted_subsystems[cached_runlevel] - var/stagger = world.time - for(var/I in current_runlevel_subsystems) - var/datum/controller/subsystem/SS = I - if(SS.next_fire <= world.time) - stagger += world.tick_lag * rand(1, 5) - SS.next_fire = stagger + + //now we'll go through all the subsystems we want to offset and give them a next_fire + for(var/datum/controller/subsystem/SS as anything in current_runlevel_subsystems) + //we only want to offset it if it's new and also behind + if(SS.next_fire > world.time || (SS in old_subsystems)) + continue + SS.next_fire = world.time + world.tick_lag * rand(0, DS2TICKS(min(SS.wait, 2 SECONDS))) subsystems_to_check = current_runlevel_subsystems else diff --git a/code/game/turfs/simulated/openspace.dm b/code/game/turfs/simulated/openspace.dm index 935bfdc1a7..4ee865983e 100644 --- a/code/game/turfs/simulated/openspace.dm +++ b/code/game/turfs/simulated/openspace.dm @@ -38,7 +38,7 @@ GLOBAL_DATUM_INIT(openspace_backdrop_one_for_all, /atom/movable/openspace_backdr /turf/open/openspace/Initialize(mapload) // handle plane and layer here so that they don't cover other obs/turfs in Dream Maker . = ..() - vis_contents += GLOB.openspace_backdrop_one_for_all //Special grey square for projecting backdrop darkness filter on it. + overlays += GLOB.openspace_backdrop_one_for_all //Special grey square for projecting backdrop darkness filter on it. return INITIALIZE_HINT_LATELOAD /turf/open/openspace/LateInitialize() diff --git a/code/game/world.dm b/code/game/world.dm index c6a5a2ef95..4ca2259e50 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -14,6 +14,11 @@ GLOBAL_LIST(topic_status_cache) LIBCALL(dll, "auxtools_init")() enable_debugging() +#ifdef USE_BYOND_TRACY + #warn USE_BYOND_TRACY is enabled + init_byond_tracy() +#endif + world.Profile(PROFILE_START) log_world("World loaded at [TIME_STAMP("hh:mm:ss", FALSE)]!") @@ -369,3 +374,19 @@ GLOBAL_LIST(topic_status_cache) /world/proc/on_tickrate_change() SStimer?.reset_buckets() + +/world/proc/init_byond_tracy() + var/library + + switch (system_type) + if (MS_WINDOWS) + library = "prof.dll" + if (UNIX) + library = "libprof.so" + else + CRASH("Unsupported platform: [system_type]") + + var/init_result = call_ext(library, "init")("block") + if (init_result != "0") + CRASH("Error initializing byond-tracy: [init_result]") + diff --git a/code/modules/antagonists/slaughter/slaughterevent.dm b/code/modules/antagonists/slaughter/slaughterevent.dm index 9b62de57bf..8d1f92faac 100644 --- a/code/modules/antagonists/slaughter/slaughterevent.dm +++ b/code/modules/antagonists/slaughter/slaughterevent.dm @@ -8,6 +8,7 @@ category = EVENT_CATEGORY_ENTITIES description = "Spawns a slaughter demon, to hunt by travelling through pools of blood." +/* /datum/round_event_control/slaughter/canSpawnEvent() weight = initial(src.weight) var/list/allowed_turf_typecache = typecacheof(/turf/open) - typecacheof(/turf/open/space) @@ -24,6 +25,7 @@ weight += 0.03 CHECK_TICK return ..() +*/ /datum/round_event/ghost_role/slaughter minimum_required = 1 diff --git a/prof.dll b/prof.dll new file mode 100644 index 0000000000..3182f4dfc7 Binary files /dev/null and b/prof.dll differ