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 -3
View File
@@ -12,17 +12,16 @@ GLOBAL_LIST_EMPTY(map_sectors)
/// to an instance of `/datum/map_template`.
GLOBAL_LIST_EMPTY(map_templates)
/area/overmap/
/area/overmap
name = "System Map"
icon_state = "start"
requires_power = 0
base_turf = /turf/unsimulated/map
dynamic_lighting = 0
base_lighting_alpha = 255
/turf/unsimulated/map
icon = 'icons/obj/overmap/overmap.dmi'
icon_state = "map"
permit_ao = FALSE
/turf/unsimulated/map/edge
opacity = 1
@@ -139,7 +139,6 @@
desc = "Government didn't want you to see this!"
density = TRUE
blocks_air = TRUE
dynamic_lighting = FALSE
icon = null
icon_state = null
@@ -270,7 +270,7 @@
gen_turf.resources[ORE_SAND] = rand(3, 5)
gen_turf.resources[ORE_COAL] = rand(3, 5)
if(ground_resources_roll)
var/image/resource_indicator = image('icons/obj/mining.dmi', null, "indicator_" + ground_resources_roll, gen_turf.layer, pick(GLOB.cardinals))
var/image/resource_indicator = image('icons/obj/mining.dmi', null, "indicator_" + ground_resources_roll, dir = pick(GLOB.cardinals))
resource_indicator.alpha = rand(30, 60)
gen_turf.resource_indicator = resource_indicator
if(!gen_turf.density)
@@ -279,6 +279,12 @@
var/rand_vals = ground_ore_levels[ground_resources_roll][OT]
gen_turf.resources[OT] = rand(rand_vals[1], rand_vals[2])
if(SSlighting.initialized) //don't generate lighting overlays before SSlighting in case these templates are loaded before
var/area/A = gen_turf.loc
if(A?.area_has_base_lighting)
continue
gen_turf.static_lighting_build_overlay()
if(gen_turf.density) // No need to check flora/fauna/grass if we're a wall
continue