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
-2
View File
@@ -549,7 +549,6 @@
light_power = 1
light_range = 6
light_wedge = LIGHT_WIDE
light_color = LIGHT_COLOR_FIRE
/obj/vehicle/train/cargo/engine/mining/Initialize()
@@ -601,7 +600,6 @@
light_power = 1
light_range = 3
light_wedge = LIGHT_OMNI
light_color = LIGHT_COLOR_FIRE
/obj/item/key/minecarts
+1 -1
View File
@@ -107,7 +107,7 @@
/turf/simulated/floor/exoplanet/basalt/cave/Initialize() // to make these tiles dark even on daytime exoplanets
. = ..()
set_light(0, 1, null)
set_light(0)
footprint_color = null
update_icon(1)
+25 -20
View File
@@ -76,12 +76,16 @@ GLOBAL_LIST_INIT(mineral_can_smooth_with, list(
if(is_station_level(z))
GLOB.station_turfs += src
if(dynamic_lighting)
luminosity = 0
else
luminosity = 1
if (light_range && light_power)
update_light()
has_opaque_atom = TRUE
//Get area light
var/area/current_area = loc
if(current_area?.lighting_effect)
overlays += current_area.lighting_effect
if(opacity)
directional_opacity = ALL_CARDINALS
if(smoothing_flags)
canSmoothWith = GLOB.mineral_can_smooth_with
@@ -210,12 +214,16 @@ GLOBAL_LIST_INIT(mineral_can_smooth_with, list(
if(is_station_level(z))
GLOB.station_turfs += src
if(dynamic_lighting)
luminosity = 0
else
luminosity = 1
if (light_range && light_power)
update_light()
has_opaque_atom = TRUE
//Get area light
var/area/current_area = loc
if(current_area?.lighting_effect)
overlays += current_area.lighting_effect
if(opacity)
directional_opacity = ALL_CARDINALS
if(smoothing_flags)
canSmoothWith = asteroid_can_smooth_with
@@ -753,14 +761,6 @@ GLOBAL_LIST_INIT(asteroid_floor_smooth, list(
if(is_station_level(z))
GLOB.station_turfs += src
if(dynamic_lighting)
luminosity = 0
else
luminosity = 1
if(mapload && permit_ao)
queue_ao()
if(smoothing_flags)
canSmoothWith = GLOB.asteroid_floor_smooth
pixel_x = -4
@@ -769,6 +769,11 @@ GLOBAL_LIST_INIT(asteroid_floor_smooth, list(
if(light_range && light_power)
update_light()
//Get area light
var/area/current_area = loc
if(current_area?.lighting_effect)
overlays += current_area.lighting_effect
return INITIALIZE_HINT_NORMAL
/turf/simulated/floor/exoplanet/asteroid/ex_act(severity)
@@ -926,7 +931,7 @@ GLOBAL_LIST_INIT(asteroid_floor_smooth, list(
return
/turf/simulated/floor/exoplanet/asteroid/proc/gets_dug(mob/user)
AddOverlays("asteroid_dug", TRUE)
AddOverlays("asteroid_dug")
if(prob(75))
new /obj/item/ore/glass(src)
@@ -980,7 +985,7 @@ GLOBAL_LIST_INIT(asteroid_floor_smooth, list(
if(dug <= 10)
dug += 1
AddOverlays("asteroid_dug", TRUE)
AddOverlays("asteroid_dug")
else
var/turf/below = GET_TURF_BELOW(src)
if(below)
+1 -1
View File
@@ -132,7 +132,7 @@
/mob/living/silicon/robot/drone/mining/update_robot_light()
if(lights_on)
set_light(5, 1, LIGHT_COLOR_FIRE, angle = LIGHT_OMNI)
set_light(5, 1, LIGHT_COLOR_FIRE)
else
set_light(0)