mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-21 04:48:18 +01:00
Runtime map now loads in ~11 seconds instead of ~40, sped up various other things (#19957)
Runtime map now has a bunch of new areas / items with often-tested stuffs, and some hard-to-put-at-runtime stuffs. Runtime map jobs now are positioned to make it faster to reach the aforementioned often-tested stuffs. Runtime map doesn't generate an overmap anymore by default, which speeds up the process. Runtime map now loads in ~11 seconds instead of ~40 seconds as it was before. Updated the maploader to be faster in parsing maps. Bapi is not engaged anymore if we're only measuring the map size, which speeds up the process. In fastboot we do not generate the codexes anymore, which speeds up the process. In fastboot and if exoplanets and away sites are not enabled, we do not parse the map templates anymore, which speeds up the process. Updated the icon smoothing to be faster. Optimized cargo area code. Other optimizations.
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
var/loaded = 0 // Times loaded this round
|
||||
var/static/dmm_suite/maploader = new
|
||||
var/list/shuttles_to_initialise = list()
|
||||
var/list/subtemplates_to_spawn
|
||||
var/base_turf_for_zs = null
|
||||
var/accessibility_weight = 0
|
||||
var/template_flags = TEMPLATE_FLAG_ALLOW_DUPLICATES
|
||||
@@ -42,7 +41,7 @@
|
||||
/datum/map_template/proc/preload_size(path)
|
||||
var/list/bounds = list(1.#INF, 1.#INF, 1.#INF, -1.#INF, -1.#INF, -1.#INF)
|
||||
|
||||
var/datum/map_load_metadata/M = maploader.load_map(file(mappath), 1, 1, cropMap=FALSE, measureOnly=TRUE)
|
||||
var/datum/map_load_metadata/M = maploader.load_map_impl(file(mappath), 1, 1, cropMap=FALSE, measureOnly=TRUE, no_changeturf=TRUE)
|
||||
if(M)
|
||||
bounds = extend_bounds_if_needed(bounds, M.bounds)
|
||||
else
|
||||
@@ -96,7 +95,6 @@
|
||||
//initialize things that are normally initialized after map load
|
||||
init_atoms(atoms_to_initialise)
|
||||
init_shuttles(shuttle_state)
|
||||
after_load(initial_z)
|
||||
for(var/light_z = initial_z to world.maxz)
|
||||
create_lighting_overlays_zlevel(light_z)
|
||||
log_game("Z-level [name] loaded at [x], [y], [world.maxz]")
|
||||
@@ -129,25 +127,18 @@
|
||||
for(var/atom/A as anything in atoms)
|
||||
if(isnull(A) || (A.flags_1 & INITIALIZED_1))
|
||||
atoms -= A
|
||||
continue
|
||||
if(istype(A, /turf))
|
||||
else if(istype(A, /turf))
|
||||
turfs += A
|
||||
continue
|
||||
if(istype(A, /obj/structure/cable))
|
||||
else if(istype(A, /obj/structure/cable))
|
||||
cables += A
|
||||
continue
|
||||
if(istype(A,/obj/effect/landmark/map_load_mark))
|
||||
LAZYADD(subtemplates_to_spawn, A)
|
||||
continue
|
||||
|
||||
//Not mutually exclusive anymore section, no continue here, keep checking
|
||||
|
||||
if(istype(A, /obj/machinery/atmospherics))
|
||||
atmos_machines += A
|
||||
//Not mutually exclusive anymore section, pay close attention!
|
||||
if(istype(A, /obj/machinery))
|
||||
machines += A
|
||||
if(istype(A, /obj/machinery/power/apc))
|
||||
apcs += A
|
||||
if(istype(A, /obj/machinery/atmospherics))
|
||||
atmos_machines += A
|
||||
else if(istype(A, /obj/machinery/power/apc))
|
||||
apcs += A
|
||||
|
||||
var/notsuspended
|
||||
if(!SSmachinery.can_fire)
|
||||
@@ -161,16 +152,13 @@
|
||||
if(notsuspended)
|
||||
SSmachinery.can_fire = TRUE
|
||||
|
||||
for (var/i in apcs)
|
||||
var/obj/machinery/power/apc/apc = i
|
||||
for (var/obj/machinery/power/apc/apc as anything in apcs)
|
||||
apc.update() // map-loading areas and APCs is weird, okay
|
||||
|
||||
for (var/i in machines)
|
||||
var/obj/machinery/machine = i
|
||||
for (var/obj/machinery/machine as anything in machines)
|
||||
machine.power_change()
|
||||
|
||||
for (var/i in turfs)
|
||||
var/turf/T = i
|
||||
for (var/turf/T as anything in turfs)
|
||||
T.post_change(FALSE)
|
||||
if(template_flags & TEMPLATE_FLAG_NO_RUINS)
|
||||
T.turf_flags |= TURF_NORUINS
|
||||
@@ -225,13 +213,3 @@
|
||||
for (var/max_bound in list(MAP_MAXX, MAP_MAXY, MAP_MAXZ))
|
||||
bounds_to_combine[max_bound] = max(existing_bounds[max_bound], new_bounds[max_bound])
|
||||
return bounds_to_combine
|
||||
|
||||
/datum/map_template/proc/after_load(z)
|
||||
for(var/obj/effect/landmark/map_load_mark/mark in subtemplates_to_spawn)
|
||||
subtemplates_to_spawn -= mark
|
||||
if(LAZYLEN(mark.templates))
|
||||
var/template = pick(mark.templates)
|
||||
var/datum/map_template/M = new template()
|
||||
M.load(get_turf(mark), TRUE)
|
||||
qdel(mark)
|
||||
LAZYCLEARLIST(subtemplates_to_spawn)
|
||||
|
||||
Reference in New Issue
Block a user