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:
Fluffy
2024-10-06 21:31:01 +00:00
committed by GitHub
parent 9636363e60
commit b8902e2e16
124 changed files with 1238 additions and 134598 deletions
@@ -17,8 +17,8 @@
pixel_x = -4
pixel_y = -4
icon_state = pick("snow[rand(1,2)]","snow0","snow0")
SSicon_smooth.add_to_queue_neighbors(src)
SSicon_smooth.add_to_queue(src)
QUEUE_SMOOTH_NEIGHBORS(src)
QUEUE_SMOOTH(src)
/turf/simulated/floor/exoplanet/snow/fire_act(exposed_temperature, exposed_volume)
. = ..()
@@ -55,7 +55,7 @@
if(data["mobile_platform"])
data["platform_direction"] = platform_direction
data["platform_directions"] = list("NORTH", "NORTHEAST", "EAST", "SOUTHEAST", "SOUTH", "SOUTHWEST", "WEST", "NORTHWEST")
if(linked.targeting)
if(linked?.targeting)
for(var/obj/machinery/ship_weapon/SW in linked.ship_weapons)
if(!SW.special_firing_mechanism)
data["guns"] += list(get_gun_data(SW))
@@ -81,13 +81,13 @@
var/newlim = tgui_input_number(usr, "Input the new thrust limit.", "Thrust Limit", connected.thrust_limit*100, 100, 0)
if(!CanInteract(usr, GLOB.physical_state))
return TOPIC_NOACTION
connected.thrust_limit = Clamp(newlim/100, 0, 1)
connected.thrust_limit = clamp(newlim/100, 0, 1)
for(var/datum/ship_engine/E in connected.engines)
E.set_thrust_limit(connected.thrust_limit)
return TOPIC_REFRESH
if(href_list["global_limit"])
connected.thrust_limit = Clamp(connected.thrust_limit + text2num(href_list["global_limit"]), 0, 1)
connected.thrust_limit = clamp(connected.thrust_limit + text2num(href_list["global_limit"]), 0, 1)
for(var/datum/ship_engine/E in connected.engines)
E.set_thrust_limit(connected.thrust_limit)
return TOPIC_REFRESH
@@ -98,13 +98,13 @@
var/newlim = tgui_input_number(usr, "Input the new thrust limit.", "Thrust Limit", E.get_thrust_limit(), 100, 0)
if(!CanInteract(usr, GLOB.physical_state))
return
var/limit = Clamp(newlim/100, 0, 1)
var/limit = clamp(newlim/100, 0, 1)
if(istype(E))
E.set_thrust_limit(limit)
return TOPIC_REFRESH
if(href_list["limit"])
var/datum/ship_engine/E = locate(href_list["engine"])
var/limit = Clamp(E.get_thrust_limit() + text2num(href_list["limit"]), 0, 1)
var/limit = clamp(E.get_thrust_limit() + text2num(href_list["limit"]), 0, 1)
if(istype(E))
E.set_thrust_limit(limit)
return TOPIC_REFRESH
+5 -5
View File
@@ -217,8 +217,8 @@
var/newy = input("Input new entry y coordinate", "Coordinate input", connected.y) as num
if(!CanInteract(usr, GLOB.physical_state))
return FALSE
R.fields["x"] = Clamp(newx, 1, world.maxx)
R.fields["y"] = Clamp(newy, 1, world.maxy)
R.fields["x"] = clamp(newx, 1, world.maxx)
R.fields["y"] = clamp(newy, 1, world.maxy)
known_sectors[sec_name] = R
if (action == "remove")
@@ -232,14 +232,14 @@
if(!CanInteract(usr, GLOB.physical_state))
return
if (newx)
dx = Clamp(newx, 1, world.maxx)
dx = clamp(newx, 1, world.maxx)
if (action == "sety")
var/newy = input("Input new destination y coordinate", "Coordinate input", dy) as num|null
if(!CanInteract(usr, GLOB.physical_state))
return
if (newy)
dy = Clamp(newy, 1, world.maxy)
dy = clamp(newy, 1, world.maxy)
if (action == "xy")
dx = text2num(params["x"])
@@ -268,7 +268,7 @@
if (action == "speedlimit")
var/newlimit = input("Input new speed limit for autopilot (0 to brake)", "Autopilot speed limit", speedlimit*1000) as num|null
if(newlimit)
speedlimit = Clamp(newlimit/1000, 0, 100)
speedlimit = clamp(newlimit/1000, 0, 100)
if (action == "accellimit")
var/newlimit = input("Input new acceleration limit", "Acceleration limit", accellimit*1000) as num|null
+18 -14
View File
@@ -110,18 +110,22 @@
data["viewing"] = viewing_overmap(user)
data["muted"] = muted
data["grid_x"] = linked.x
data["grid_y"] = linked.y
data["direction"] = dir2angle(linked.dir)
var/linked_x = linked.x
var/linked_y = linked.y
var/obj/effect/overmap/visitable/ship/linked_ship = linked
if(istype(linked_ship))
linked_x += linked_ship.position[1] / 2.0
linked_y += linked_ship.position[2] / 2.0
data["is_ship"] = TRUE
data["x"] = linked_x
data["y"] = linked_y
var/linked_x
var/linked_y
if(linked)
data["grid_x"] = linked.x
data["grid_y"] = linked.y
data["direction"] = dir2angle(linked.dir)
linked_x = linked.x
linked_y = linked.y
var/obj/effect/overmap/visitable/ship/linked_ship = linked
if(istype(linked_ship))
linked_x += linked_ship.position[1] / 2.0
linked_y += linked_ship.position[2] / 2.0
data["is_ship"] = TRUE
data["x"] = linked_x
data["y"] = linked_y
if(sensors)
data["on"] = sensors.use_power
@@ -268,14 +272,14 @@
if(!CanInteract(usr, GLOB.default_state))
return FALSE
if (nrange)
sensors.set_desired_range(Clamp(nrange, 1, sensors.max_range))
sensors.set_desired_range(clamp(nrange, 1, sensors.max_range))
return TRUE
if(action == "range_choice")
var/nrange = text2num(params["range_choice"])
if(!CanInteract(usr, GLOB.default_state))
return FALSE
if(nrange)
sensors.set_desired_range(Clamp(nrange, 1, sensors.max_range))
sensors.set_desired_range(clamp(nrange, 1, sensors.max_range))
return TRUE
if (action == "toggle")
sensors.toggle()
+1 -1
View File
@@ -1,7 +1,7 @@
var/const/OVERMAP_SPEED_CONSTANT = (1 SECOND)
#define SHIP_MOVE_RESOLUTION 0.00001
#define MOVING(speed) abs(speed) >= min_speed
#define SANITIZE_SPEED(speed) SIGN(speed) * Clamp(abs(speed), 0, max_speed)
#define SANITIZE_SPEED(speed) SIGN(speed) * clamp(abs(speed), 0, max_speed)
#define CHANGE_SPEED_BY(speed_var, v_diff) \
v_diff = SANITIZE_SPEED(v_diff);\
if(!MOVING(speed_var + v_diff)) \