New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MultiZ WIP/Staging #27189
MultiZ WIP/Staging #27189
Changes from 1 commit
c908dcc
ae86990
c1323c6
fdccd22
793847d
c9d9b42
f05e5ee
fc2e3d3
a85861d
c521ea9
c8f4845
8375d51
441bd0f
c3ffeba
8b83a6c
da10817
c133119
271d02e
c9f46a2
1995587
f6dd79d
b29247d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#if !defined(MAP_FILE) | ||
|
||
// MultiZ Station | ||
|
||
#define TITLESCREEN "title" | ||
|
||
#define MINETYPE "lavaland" | ||
|
||
#include "map_files\debug\multiz_test.dmm" | ||
|
||
#define MAP_PATH "map_files/debug" | ||
#define MAP_FILE "multiz_test.dmm" | ||
#define MAP_NAME "MultiZ Station" | ||
|
||
#define MAP_TRANSITION_CONFIG list(MAIN_STATION = UNAFFECTED) | ||
|
||
#elif !defined(MAP_OVERRIDE) | ||
|
||
#warn a map has already been included, ignoring MultiZ Station. | ||
|
||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -278,6 +278,13 @@ var/datum/subsystem/air/SSair | |
add_to_active(T) | ||
queued_for_activation.Cut() | ||
|
||
//Recalculated, for Multi-Z (In an ideal world I'd move setup_allturfs() here | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this got moved during the merge, woops. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was originally in |
||
//but it's sadly not that simple) | ||
for(var/t in block(locate(1, 1, 1), locate(world.maxx, world.maxy, world.maxz))) | ||
var/turf/T = t | ||
T.CalculateAdjacentTurfs() | ||
CHECK_TICK | ||
|
||
/datum/subsystem/air/proc/setup_allturfs() | ||
var/list/turfs_to_init = block(locate(1, 1, 1), locate(world.maxx, world.maxy, world.maxz)) | ||
var/list/active_turfs = src.active_turfs | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
var/datum/subsystem/z_levels/SSz | ||
|
||
/datum/subsystem/z_levels | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace these three lines with SUBSYSTEM_DEF(z_levels) |
||
name = "Z Levels" | ||
flags = SS_NO_FIRE | ||
init_order = 12 //before SSatoms | ||
var/list/vertical_connections //assoc list of "[Z number]" = list("[Other Z Number]" = TRUE/FALSE) | ||
var/list/zshadows | ||
|
||
/datum/subsystem/z_levels/New() | ||
NEW_SS_GLOBAL(SSz) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove these two lines |
||
|
||
|
||
/datum/subsystem/z_levels/stat_entry() | ||
var/c = 0 | ||
for(var/z in vertical_connections) | ||
var/list/L = vertical_connections[z] | ||
if(L) | ||
c += L.len //this will count A<->B twice, since it's A->B and B->A | ||
..("ZP:[c], ZS:[LAZYLEN(zshadows)]") //"Z Pairs", "Z Shadows" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
|
||
/* | ||
Remie note: | ||
I added proper multiZ, but this thing is ancient | ||
I "updated" it, and it DOES work, but it's | ||
not in RPDs, pipe dispensers etc and some of its | ||
content (on/off, volume_rate) aren't implemented. | ||
|
||
Use this for ruins and stuff I guess, or fix it up proper. | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. honestly just remove zvent There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By that I mean that cross-z connections should only happen between nodes. Making that work shouldn't be too difficult, but having a vent like this is unnecessary complexity for a redundant gain (pipe up connected to a vent is basically the same) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure I guess, it just seemed cruel to kill it when it survived, semi-working, for such a long time. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do appreciate the respect you had for this poor piece of oldmos There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ;_;7 |
||
|
||
|
||
/obj/machinery/zvent | ||
name = "interfloor air transfer system" | ||
|
||
|
@@ -21,9 +33,13 @@ | |
|
||
//all this object does, is make its turf share air with the ones above and below it, if they have a vent too. | ||
if(isturf(loc)) //if we're not on a valid turf, forget it | ||
for (var/new_z in list(-1,1)) //change this list if a fancier system of z-levels gets implemented | ||
var/turf/open/zturf_conn = locate(x,y,z+new_z) | ||
var/turf/T = loc | ||
for (var/ddir in list(DOWN,UP)) //change this list if a fancier system of z-levels gets implemented //meow | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Static list There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No point, dunc wants the file murdered. |
||
var/turf/open/zturf_conn = get_step(loc, ddir) | ||
if (istype(zturf_conn)) | ||
if(!AreZsConnected(zturf_conn.z, T.z)) | ||
continue | ||
|
||
var/obj/machinery/zvent/zvent_conn= locate(/obj/machinery/zvent) in zturf_conn | ||
if (istype(zvent_conn)) | ||
//both floors have simulated turfs, share() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
//where for art thou duncathan | ||
|
||
/obj/machinery/atmospherics/pipe/simple/multiz | ||
icon = 'icons/obj/atmospherics/pipes/multiz.dmi' | ||
var/basestate | ||
|
||
/obj/machinery/atmospherics/pipe/simple/multiz/update_icon() | ||
icon_state = "[basestate][invisibility ? "-f" : "" ]" | ||
|
||
|
||
/obj/machinery/atmospherics/pipe/simple/multiz/up | ||
initialize_directions = SOUTH|UP | ||
basestate = "up" | ||
|
||
/obj/machinery/atmospherics/pipe/simple/multiz/up/SetInitDirections() | ||
initialize_directions = dir|UP | ||
|
||
|
||
/obj/machinery/atmospherics/pipe/simple/multiz/down | ||
initialize_directions = SOUTH|DOWN | ||
basestate = "down" | ||
|
||
/obj/machinery/atmospherics/pipe/simple/multiz/down/SetInitDirections() | ||
initialize_directions = dir|DOWN | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
|
||
/atom | ||
var/atom/movable/zshadow/zshadow | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. move it to atoms.dm |
||
|
||
|
||
//TODO: Simplify for base atoms? (their shadows would never move, so they don't need a zshadow movable atom) | ||
/atom/proc/CreateZShadow() | ||
if(!zshadow) //if one exists, just sync it | ||
zshadow = new() | ||
zshadow.owner = src | ||
zshadow.Sync() | ||
return zshadow | ||
|
||
|
||
//Can we fall through to the Z below? (regardless of open turfs, etc.) | ||
//This is so mobs with jetpacks, thrown items, etc. can ignore falling | ||
/atom/proc/CanFallThroughZ() | ||
if(!has_gravity()) | ||
return FALSE | ||
return TRUE | ||
|
||
|
||
/atom/movable/CanFallThroughZ() | ||
. = ..() | ||
if(.) | ||
if(throwing) | ||
return FALSE | ||
|
||
|
||
/mob/CanFallThroughZ() | ||
. = ..() | ||
if(.) | ||
var/obj/item/weapon/tank/jetpack/J = get_jetpack() | ||
if(istype(J) && J.allow_thrust(0.01, src)) //working jetpack | ||
return FALSE | ||
|
||
|
||
|
||
//Hooks: | ||
//TODO: move to existing locations | ||
|
||
/atom/proc/SetupZShadow(mapload = FALSE) | ||
if(mapload) //This is before SSz, so we can't rely on connections yet | ||
var/turf/U = get_step(src, UP) | ||
if(U && U.z_open) | ||
CreateZShadow() | ||
else if(GetAboveConnectedTurf(src)) | ||
CreateZShadow() | ||
|
||
/atom/Initialize(mapload) | ||
..() | ||
SetupZShadow(mapload) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is gonna add overhead to every atom, just call it from atoms.dm There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I swear I left a //TODO to move these. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did actually, line 40. |
||
|
||
/turf/Initialize(mapload) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
..() | ||
if(z_open) | ||
var/turf/D = get_step(src, DOWN) | ||
if(D) | ||
ConnectVerticalZs(z, D.z) | ||
D.SetupZShadow() | ||
for(var/a in D) | ||
var/atom/A = a | ||
A.SetupZShadow(mapload) | ||
|
||
SetupZShadow(mapload) | ||
|
||
/atom/setDir(dir) | ||
..() | ||
if(zshadow) | ||
zshadow.setDir(dir) //dir is not an appearance var, so we can update it quickly | ||
|
||
/atom/Destroy() | ||
. = ..() | ||
if(zshadow) | ||
qdel(zshadow) | ||
|
||
/atom/movable/Moved() | ||
..() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The rest are fine, just these 3 are performance critical |
||
if(zshadow) | ||
zshadow.SyncLoc() | ||
else | ||
if(GetAboveConnectedTurf(src)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is meant to be |
||
CreateZShadow() | ||
|
||
|
||
//Get this to cascade somehow... | ||
/obj/update_icon() | ||
..() | ||
if(zshadow) | ||
zshadow.SyncAppearance() | ||
|
||
//Cascade somehow. | ||
/mob/update_icons() | ||
..() | ||
if(zshadow) | ||
zshadow.SyncAppearance() | ||
|
||
/turf/AfterChange() | ||
..() | ||
if(zshadow) | ||
zshadow.SyncAppearance() | ||
|
||
|
||
/turf/add_decal(decal,group) | ||
..() | ||
if(zshadow) | ||
zshadow.SyncAppearance() | ||
|
||
|
||
/turf/remove_decal(group) | ||
..() | ||
if(zshadow) | ||
zshadow.SyncAppearance() | ||
|
||
|
||
/turf/open/update_visuals() | ||
..() | ||
if(zshadow) | ||
zshadow.SyncAppearance() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
/turf | ||
var/z_open = FALSE //are we see the Z below us through this turf? (true/false) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. am gud att engrish |
||
|
||
|
||
/turf/open/open_z | ||
icon = null | ||
icon_state = "" | ||
desc = "" | ||
name = "zopen" | ||
invisibility = 101 //Not real!! | ||
z_open = TRUE | ||
|
||
|
||
/turf/open/open_z/Entered(atom/movable/AM, atom/oloc) | ||
..() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another performance worry |
||
var/turf/T = GetBelowConnectedTurf(src) | ||
if(AtomCanFallThrough(AM) && T) | ||
AM.forceMove(T) | ||
|
||
|
||
/turf/open/open_z/proc/AtomCanFallThrough(atom/movable/AM) | ||
. = FALSE | ||
if(AM.CanFallThroughZ()) | ||
. = TRUE | ||
if(locate(/obj/structure/lattice/catwalk) in src) | ||
. = FALSE | ||
|
||
|
||
/turf/open/open_z/CreateZShadow() //just no | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This entire file should be just #define FORCE_MAP "multiz_test.json"