From 7343464228e7547f6640cf5366aaca8d5cfaf21d Mon Sep 17 00:00:00 2001 From: MrStonedOne Date: Wed, 17 Jan 2018 22:13:41 -0800 Subject: [PATCH] Low memory mode Adds define to run the world in a reduced memory usage mode by skipping the creating of the space zlevels loading only centcom and runtime station. Mainly for lummox. --- _maps/_basemap.dm | 25 +++++++++++++++++++++++++ _maps/basemap.dm | 19 ------------------- code/_compile_options.dm | 3 +++ code/controllers/subsystem/mapping.dm | 4 ++-- tgstation.dme | 2 +- 5 files changed, 31 insertions(+), 22 deletions(-) create mode 100644 _maps/_basemap.dm delete mode 100644 _maps/basemap.dm diff --git a/_maps/_basemap.dm b/_maps/_basemap.dm new file mode 100644 index 00000000000..794f57ea58d --- /dev/null +++ b/_maps/_basemap.dm @@ -0,0 +1,25 @@ +//#define LOWMEMORYMODE //uncomment this to load centcom and runtime station and thats it. + +#include "map_files\generic\CentCom.dmm" +#include "map_files\generic\SpaceStation.dmm" + +#ifndef LOWMEMORYMODE + + #include "map_files\generic\Space.dmm" + #include "map_files\generic\SpaceDock.dmm" + #include "map_files\Mining\Lavaland.dmm" + #include "map_files\generic\City_of_Cogs.dmm" + + #ifdef ALL_MAPS + #include "map_files\debug\runtimestation.dmm" + #include "map_files\Deltastation\DeltaStation2.dmm" + #include "map_files\MetaStation\MetaStation.dmm" + #include "map_files\OmegaStation\OmegaStation.dmm" + #include "map_files\PubbyStation\PubbyStation.dmm" + #include "map_files\BoxStation\BoxStation.dmm" + + #ifdef TRAVISBUILDING + #include "templates.dm" + #endif + #endif +#endif \ No newline at end of file diff --git a/_maps/basemap.dm b/_maps/basemap.dm deleted file mode 100644 index 1336200863b..00000000000 --- a/_maps/basemap.dm +++ /dev/null @@ -1,19 +0,0 @@ -#include "map_files\generic\CentCom.dmm" -#include "map_files\generic\SpaceStation.dmm" -#include "map_files\generic\Space.dmm" -#include "map_files\generic\SpaceDock.dmm" -#include "map_files\Mining\Lavaland.dmm" -#include "map_files\generic\City_of_Cogs.dmm" - -#ifdef ALL_MAPS -#include "map_files\debug\runtimestation.dmm" -#include "map_files\Deltastation\DeltaStation2.dmm" -#include "map_files\MetaStation\MetaStation.dmm" -#include "map_files\OmegaStation\OmegaStation.dmm" -#include "map_files\PubbyStation\PubbyStation.dmm" -#include "map_files\BoxStation\BoxStation.dmm" - -#ifdef TRAVISBUILDING -#include "templates.dm" -#endif -#endif \ No newline at end of file diff --git a/code/_compile_options.dm b/code/_compile_options.dm index 1c58771f739..ac7b6ab9f9b 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -18,6 +18,9 @@ #endif // 1 to use the default behaviour; // 2 for preloading absolutely everything; +#ifdef LOWMEMORYMODE +#define FORCE_MAP "_maps/runtimestation.json" +#endif //Update this whenever you need to take advantage of more recent byond features #define MIN_COMPILER_VERSION 511 diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm index 8046dab41e3..90f3380b814 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -42,7 +42,7 @@ SUBSYSTEM_DEF(mapping) repopulate_sorted_areas() process_teleport_locs() //Sets up the wizard teleport locations preloadTemplates() - +#ifndef LOWMEMORYMODE // Create space levels for(var/I in 1 to ZLEVEL_SPACE_RUIN_COUNT) add_new_zlevel("Empty Area [2 + I]", CROSSLINKED, list(ZTRAIT_SPACE_RUINS = TRUE)) @@ -67,7 +67,7 @@ SUBSYSTEM_DEF(mapping) if (space_ruins.len) seedRuins(space_ruins, CONFIG_GET(number/space_budget), /area/space, space_ruins_templates) loading_ruins = FALSE - +#endif repopulate_sorted_areas() // Set up Z-level transitions. setup_map_transitions() diff --git a/tgstation.dme b/tgstation.dme index 8546db84b52..776157ba32d 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -13,7 +13,7 @@ // END_PREFERENCES // BEGIN_INCLUDE -#include "_maps\basemap.dm" +#include "_maps\_basemap.dm" #include "code\_compile_options.dm" #include "code\world.dm" #include "code\__DEFINES\_globals.dm"