Replaces our lighting system with CM's. (#21465)

Depends on #21458.

Ports https://github.com/cmss13-devs/cmss13/pull/4229, with the original
authors as:

- https://github.com/tgstation/TerraGov-Marine-Corps/pull/1964 for the
lighting controller (A-lexa)
- https://github.com/tgstation/TerraGov-Marine-Corps/pull/4747 and
https://github.com/tgstation/TerraGov-Marine-Corps/pull/7263 for the
lighting (TiviPlus)
- https://github.com/tgstation/tgstation/pull/54520 for the dir lighting
component
- https://github.com/tgstation/tgstation/pull/75018 for the out of
bounds fix in lighting
- https://github.com/tgstation/TerraGov-Marine-Corps/pull/6678 for the
emissives (TiviPlus)

The main driving reason behind this is that current lighting consumes
way too much processing power, especially for things like odysseys/away
sites where a billion light sources are processing/moving at once and
the game slows down to a crawl. Hopefully this improves the situation by
a good margin, but we will need some testmerging to confirm that.
<img width="1349" height="1349" alt="image"
src="https://github.com/user-attachments/assets/1059ba2b-c0c5-495a-9c76-2d75d0c42bf2"
/>
<img width="1349" height="1349" alt="image"
src="https://github.com/user-attachments/assets/9704b0f6-4cf6-4dfd-a6cb-5702ad07d677"
/>


- [x] Resolve todos
- [x] Look into open space fuckery (border objects)

---------

Co-authored-by: Matt Atlas <liermattia@gmail.com>
Co-authored-by: JohnWildkins <john.wildkins@gmail.com>
This commit is contained in:
Matt Atlas
2025-11-04 22:27:42 +01:00
committed by GitHub
parent 8ebd7c9ad5
commit 94d92803b4
395 changed files with 3906 additions and 3299 deletions
+7 -3
View File
@@ -54,7 +54,6 @@
/datum/map_template/proc/load_new_z(var/no_changeturf = TRUE)
var/x = round((world.maxx - width)/2)
var/y = round((world.maxy - height)/2)
var/initial_z = world.maxz + 1
if (x < 1) x = 1
if (y < 1) y = 1
@@ -97,8 +96,6 @@
//initialize things that are normally initialized after map load
init_atoms(atoms_to_initialise)
init_shuttles(shuttle_state)
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]")
message_admins("Z-level [name] loaded at [x], [y], [world.maxz]")
SSicon_smooth.can_fire = TRUE
@@ -164,10 +161,17 @@
T.post_change(FALSE)
if(template_flags & TEMPLATE_FLAG_NO_RUINS)
T.turf_flags |= TURF_NORUINS
if(istype(T,/turf/simulated))
var/turf/simulated/sim = T
sim.update_air_properties()
if(SSlighting.initialized) //don't generate lighting overlays before SSlighting in case these templates are loaded before
var/area/A = T.loc
if(A?.area_has_base_lighting)
continue
T.static_lighting_build_overlay()
/datum/map_template/proc/load(turf/T, centered = FALSE)
if(centered)
T = locate(T.x - round(width / 2) , T.y - round(height / 2) , T.z)
+1
View File
@@ -140,6 +140,7 @@ GLOBAL_DATUM_INIT(_preloader, /dmm_suite/preloader, new)
else
world.maxz = zcrd //create a new z_level if needed
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_NEW_Z, world.maxz)
SSzcopy.calculate_zstack_limits()
if(!no_changeturf)
WARNING("Z-level expansion occurred without no_changeturf set, this may cause problems when /turf/post_change is called.")
@@ -13,6 +13,7 @@
generate_linkages_for_z_level(new_z)
adding_new_zlevel = FALSE
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_NEW_Z, S)
SSzcopy.calculate_zstack_limits()
return S
/datum/controller/subsystem/mapping/proc/get_level(z)