Skip to content

Commit 3e79c82

Browse files
authored
ZAS Debug improvements (#1169)
* fixes & improvements * minor formatting
1 parent abfad67 commit 3e79c82

File tree

9 files changed

+154
-98
lines changed

9 files changed

+154
-98
lines changed

_maps/map_files/generic/CentCom.dmm

+13-13
Original file line numberDiff line numberDiff line change
@@ -2505,7 +2505,7 @@
25052505
pixel_y = 17
25062506
},
25072507
/obj/structure/fluff/tram_rail,
2508-
/turf/open/lava/plasma,
2508+
/turf/open/lava/plasma/snow_air,
25092509
/area/centcom/syndicate_mothership/control)
25102510
"hm" = (
25112511
/obj/structure/flora/ausbushes/lavendergrass,
@@ -6054,7 +6054,7 @@
60546054
dir = 1
60556055
},
60566056
/obj/structure/railing,
6057-
/turf/open/lava/plasma,
6057+
/turf/open/lava/plasma/snow_air,
60586058
/area/centcom/syndicate_mothership/control)
60596059
"ri" = (
60606060
/obj/effect/turf_decal/stripes/full,
@@ -7234,7 +7234,7 @@
72347234
/obj/structure/railing{
72357235
dir = 10
72367236
},
7237-
/turf/open/lava/plasma,
7237+
/turf/open/lava/plasma/snow_air,
72387238
/area/centcom/syndicate_mothership/control)
72397239
"uX" = (
72407240
/obj/machinery/shower{
@@ -8979,7 +8979,7 @@
89798979
/obj/structure/railing{
89808980
dir = 9
89818981
},
8982-
/turf/open/lava/plasma,
8982+
/turf/open/lava/plasma/snow_air,
89838983
/area/centcom/syndicate_mothership/control)
89848984
"zZ" = (
89858985
/obj/effect/turf_decal/tile/brown{
@@ -10571,7 +10571,7 @@
1057110571
/obj/structure/railing{
1057210572
dir = 1
1057310573
},
10574-
/turf/open/lava/plasma,
10574+
/turf/open/lava/plasma/snow_air,
1057510575
/area/centcom/syndicate_mothership/control)
1057610576
"Es" = (
1057710577
/obj/effect/light_emitter{
@@ -10733,7 +10733,7 @@
1073310733
/obj/structure/railing{
1073410734
dir = 8
1073510735
},
10736-
/turf/open/lava/plasma,
10736+
/turf/open/lava/plasma/snow_air,
1073710737
/area/centcom/syndicate_mothership/control)
1073810738
"ES" = (
1073910739
/obj/structure/sign/poster/contraband/lamarr{
@@ -10941,7 +10941,7 @@
1094110941
/obj/structure/railing{
1094210942
dir = 9
1094310943
},
10944-
/turf/open/lava/plasma,
10944+
/turf/open/lava/plasma/snow_air,
1094510945
/area/centcom/syndicate_mothership/control)
1094610946
"Fy" = (
1094710947
/obj/structure/chair/stool/directional/south,
@@ -12178,7 +12178,7 @@
1217812178
/obj/structure/railing{
1217912179
dir = 10
1218012180
},
12181-
/turf/open/lava/plasma,
12181+
/turf/open/lava/plasma/snow_air,
1218212182
/area/centcom/syndicate_mothership/control)
1218312183
"Jo" = (
1218412184
/obj/machinery/door/airlock/centcom{
@@ -12443,7 +12443,7 @@
1244312443
/turf/open/misc/asteroid/snow/airless,
1244412444
/area/centcom/syndicate_mothership)
1244512445
"Ki" = (
12446-
/turf/open/lava/plasma,
12446+
/turf/open/lava/plasma/snow_air,
1244712447
/area/centcom/syndicate_mothership/control)
1244812448
"Kk" = (
1244912449
/obj/docking_port/stationary{
@@ -13400,7 +13400,7 @@
1340013400
/obj/structure/railing{
1340113401
dir = 6
1340213402
},
13403-
/turf/open/lava/plasma,
13403+
/turf/open/lava/plasma/snow_air,
1340413404
/area/centcom/syndicate_mothership/control)
1340513405
"Np" = (
1340613406
/obj/structure/bookcase/random,
@@ -13428,7 +13428,7 @@
1342813428
/obj/structure/railing{
1342913429
dir = 6
1343013430
},
13431-
/turf/open/lava/plasma,
13431+
/turf/open/lava/plasma/snow_air,
1343213432
/area/centcom/syndicate_mothership/control)
1343313433
"Nt" = (
1343413434
/obj/structure/filingcabinet/medical,
@@ -15268,7 +15268,7 @@
1526815268
/obj/structure/railing{
1526915269
dir = 9
1527015270
},
15271-
/turf/open/lava/plasma,
15271+
/turf/open/lava/plasma/snow_air,
1527215272
/area/centcom/syndicate_mothership/control)
1527315273
"SL" = (
1527415274
/obj/structure/rack,
@@ -15734,7 +15734,7 @@
1573415734
/obj/structure/railing{
1573515735
dir = 10
1573615736
},
15737-
/turf/open/lava/plasma,
15737+
/turf/open/lava/plasma/snow_air,
1573815738
/area/centcom/syndicate_mothership/control)
1573915739
"TO" = (
1574015740
/obj/machinery/keycard_auth/directional/south,

code/controllers/subsystem/zas.dm

+10
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,11 @@ SUBSYSTEM_DEF(zas)
514514
active_edges -= E
515515
E.excited = FALSE
516516

517+
#ifdef ZASDBG
518+
for(var/turf/T as anything in E.connecting_turfs)
519+
T.vis_contents -= zasdbgovl_edge
520+
#endif
521+
517522
///Wakes an edge, adding it to the active process list.
518523
/datum/controller/subsystem/zas/proc/excite_edge(connection_edge/E)
519524
#ifdef ZASDBG
@@ -524,6 +529,11 @@ SUBSYSTEM_DEF(zas)
524529
active_edges += E
525530
E.excited = TRUE
526531

532+
#ifdef ZASDBG
533+
for(var/turf/T as anything in E.connecting_turfs)
534+
T.vis_contents += zasdbgovl_edge
535+
#endif
536+
527537
///Returns the edge between zones A and B. If one doesn't exist, it creates one. See header for more information
528538
/datum/controller/subsystem/zas/proc/get_edge(zone/A, zone/B) //Note: B can also be a turf.
529539
var/connection_edge/edge

code/modules/atmospherics/ZAS/ConnectionGroup.dm

+18
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ Class Procs:
111111
#ifdef ZASDBG
112112
if(verbose)
113113
zas_log("[type] Erased.")
114+
115+
for(var/turf/T in connecting_turfs)
116+
T.vis_contents -= zasdbgovl_edge
114117
#endif
115118

116119
///Called every air tick on edges in the processing list. Equalizes gas.
@@ -184,9 +187,16 @@ Class Procs:
184187
/connection_edge/zone/add_connection(connection/c)
185188
. = ..()
186189
connecting_turfs += c.A
190+
#ifdef ZASDBG
191+
if(excited)
192+
c.A.vis_contents += zasdbgovl_edge
193+
#endif
187194

188195
/connection_edge/zone/remove_connection(connection/c)
189196
connecting_turfs -= c.A
197+
#ifdef ZASDBG
198+
c.A.vis_contents -= zasdbgovl_edge
199+
#endif
190200
return ..()
191201

192202
/connection_edge/zone/contains_zone(zone/Z)
@@ -239,6 +249,7 @@ Class Procs:
239249

240250
flow(attracted, abs(differential), 0)
241251
flow(repelled, abs(differential), 1)
252+
242253
/connection_edge/unsimulated
243254
var/turf/B
244255
var/datum/gas_mixture/air
@@ -261,10 +272,17 @@ Class Procs:
261272
. = ..()
262273
connecting_turfs += c.B
263274
air.group_multiplier = coefficient
275+
#ifdef ZASDBG
276+
if(excited)
277+
c.B.vis_contents += zasdbgovl_edge
278+
#endif
264279

265280
/connection_edge/unsimulated/remove_connection(connection/c)
266281
connecting_turfs -= c.B
267282
air.group_multiplier = coefficient
283+
#ifdef ZASDBG
284+
c.B.vis_contents -= zasdbgovl_edge
285+
#endif
268286
return ..()
269287

270288
/connection_edge/unsimulated/erase()

code/modules/atmospherics/ZAS/Debug.dm

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ GLOBAL_REAL_VAR(obj/effect/zasdbg/merged/zasdbgovl_merged) = new
66
GLOBAL_REAL_VAR(obj/effect/zasdbg/invalid_zone/zasdbgovl_invalid_zone) = new
77
GLOBAL_REAL_VAR(obj/effect/zasdbg/blocked/zasdbgovl_blocked) = new
88
GLOBAL_REAL_VAR(obj/effect/zasdbg/mark/zasdbgovl_mark) = new
9+
GLOBAL_REAL_VAR(obj/effect/zasdbg/edge/zasdbgovl_edge) = new
910

1011
GLOBAL_REAL_VAR(list/zasdbgovl_dirblock) = list(
1112
"north" = new /obj/effect/zasdbg/air_blocked/north,
@@ -31,6 +32,7 @@ GLOBAL_REAL_VAR(list/zasdbgovl_dirzoneblock) = list(
3132
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
3233
layer = FLY_LAYER
3334
vis_flags = NONE
35+
appearance_flags = RESET_COLOR | RESET_TRANSFORM | KEEP_APART
3436

3537
/obj/effect/zasdbg/assigned
3638
icon_state = "assigned"
@@ -44,6 +46,8 @@ GLOBAL_REAL_VAR(list/zasdbgovl_dirzoneblock) = list(
4446
icon_state = "fullblock"
4547
/obj/effect/zasdbg/mark
4648
icon_state = "mark"
49+
/obj/effect/zasdbg/edge
50+
icon_state = "edge"
4751

4852
/obj/effect/zasdbg/zone_blocked
4953
icon_state = "zoneblock"

code/modules/atmospherics/ZAS/Diagnostic.dm

+17-16
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
/client/proc/Zone_Info(turf/T as null|turf)
22
set category = "Debug"
3-
if(T)
4-
if(T.simulated && T.zone)
5-
T.zone.dbg_data(src)
6-
if(length(T.zone.contents) < ZONE_MIN_SIZE)
7-
to_chat(mob, span_notice("This turf's zone is below the minimum size, and will merge over zone blockers."))
3+
var/list/out = list()
4+
if(!T)
5+
return
6+
7+
if(T.simulated && T.zone)
8+
out += T.zone.dbg_data(src)
89

9-
else
10-
to_chat(mob, span_admin("ZASDBG: No zone here."))
11-
var/datum/gas_mixture/mix = T.unsafe_return_air()
12-
to_chat(mob,span_admin( "ZASDBG_MAIN: [mix.returnPressure()] kPa [mix.temperature] k"))
13-
for(var/g in mix.gas)
14-
to_chat(mob, span_admin("ZASDBG_GAS: [g]: [mix.gas[g]]\n"))
1510
else
16-
if(zone_debug_images)
17-
for(var/zone in zone_debug_images)
18-
images -= zone_debug_images[zone]
19-
zone_debug_images = null
11+
var/datum/gas_mixture/air = T.unsafe_return_air()
12+
out += span_info("Unsimulated Turf ([T.type])")
13+
out += span_info("<br>Moles: [air.total_moles]")
14+
out += span_info("Pressure: [air.returnPressure()] kPa")
15+
out += span_info("Temperature: [air.temperature]°K ([air.temperature - T0C]°C)")
16+
out += span_info("Volume: [air.volume]L")
17+
18+
out += span_info("Mixture:")
19+
for(var/g in air.gas)
20+
out += span_info("[FOURSPACES]- [xgm_gas_data.name[g]]: [air.gas[g]] ([round((air.gas[g] / air.total_moles) * 100, ATMOS_PRECISION)]%) ")
2021

21-
/client/var/list/zone_debug_images
22+
to_chat(src, examine_block("ZAS Debug: [COORD(T)]<hr>"+ jointext(out, "<br>")))
2223

2324
/client/proc/Test_ZAS_Connection(turf/T as turf)
2425
set category = "Debug"

code/modules/atmospherics/ZAS/Zone.dm

+28-10
Original file line numberDiff line numberDiff line change
@@ -233,25 +233,43 @@ Class Procs:
233233

234234
///Prints debug information to the given mob. Used by the "Zone Info" verb. Does not require ZASDBG compile define.
235235
/zone/proc/dbg_data(mob/M)
236-
to_chat(M, name)
236+
. = list()
237+
. += span_info("[name][invalid ? " ([span_alert("Invalid")])" : ""]")
238+
if(length(contents) < ZONE_MIN_SIZE)
239+
. += span_alert("This turf's zone is below the minimum size, and will merge over zone blockers.")
240+
. += span_info("<br>Moles: [air.total_moles]")
241+
. += span_info("Pressure: [air.returnPressure()] kPa")
242+
. += span_info("Temperature: [air.temperature]°K ([air.temperature - T0C]°C)")
243+
. += span_info("Volume: [air.volume]L")
244+
. += span_info("Mixture:")
237245
for(var/g in air.gas)
238-
to_chat(M, "[xgm_gas_data.name[g]]: [air.gas[g]]")
239-
to_chat(M, "P: [air.returnPressure()] kPa V: [air.volume]L T: [air.temperature]°K ([air.temperature - T0C]°C)")
240-
to_chat(M, "O2 per N2: [(air.gas[GAS_NITROGEN] ? air.gas[GAS_OXYGEN]/air.gas[GAS_NITROGEN] : "N/A")] Moles: [air.total_moles]")
241-
to_chat(M, "Simulated: [contents.len] ([air.group_multiplier])")
242-
to_chat(M, "Edges: [edges.len]")
243-
if(invalid) to_chat(M, "Invalid!")
246+
. += span_info("[FOURSPACES]- [xgm_gas_data.name[g]]: [air.gas[g]] ([round((air.gas[g] / air.total_moles) * 100, ATMOS_PRECISION)]%)")
247+
248+
. += span_info("<br>Turfs: [contents.len] (Mult: [air.group_multiplier])")
249+
. += span_info("All Edges: [edges.len]")
250+
244251
var/zone_edges = 0
245252
var/space_edges = 0
246253
var/space_coefficient = 0
254+
var/list/unsim_pressures = list()
255+
var/list/zone_pressures = list()
256+
247257
for(var/edge_source in edges)
248258
var/connection_edge/E = edges[edge_source]
259+
var/turf/jump_target = E.connecting_turfs[1]
260+
249261
if(E.type == /connection_edge/zone)
250262
zone_edges++
263+
var/zone/enemy_zone = edge_source
264+
zone_pressures += span_info("[FOURSPACES]- [enemy_zone.air.returnPressure()] kPa ([E.excited ? span_alert("Excited") : span_good("Sleeping")]) [ADMIN_JMP(jump_target)]")
265+
251266
else
252267
space_edges++
253268
space_coefficient += E.coefficient
254-
to_chat(M, " - [E:air:returnPressure()]kPa")
269+
var/connection_edge/unsimulated/unsim_edge = E
270+
unsim_pressures += span_info("[FOURSPACES]- [unsim_edge.air.returnPressure()] kPa ([unsim_edge.excited ? span_alert("Excited") : span_good("Sleeping")]) [ADMIN_JMP(jump_target)]")
255271

256-
to_chat(M, "Zone Edges: [zone_edges]")
257-
to_chat(M, "Unsimulated Edges: [space_edges] ([space_coefficient] connections)\n")
272+
. += span_info("Zone Edges: [zone_edges]")
273+
. += zone_pressures
274+
. += span_info("Unsimulated Edges: [space_edges] ([space_coefficient] connections)")
275+
. += unsim_pressures

code/modules/awaymissions/mission_code/snowdin.dm

+5
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@
220220
baseturfs = /turf/open/lava/plasma/mafia
221221
slowdown = 0
222222

223+
//matches /turf/open/misc/asteroid/snow
224+
/turf/open/lava/plasma/snow_air
225+
initial_gas = OPENTURF_LOW_PRESSURE
226+
temperature = 180
227+
223228
/////////// papers
224229

225230

0 commit comments

Comments
 (0)