Commit Graph

197 Commits

Author SHA1 Message Date
SkyratBot
93a02f7e21 [MIRROR] Fix out of bounds in lighting subsystem [MDB IGNORE] (#21413)
* Fix out of bounds in lighting subsystem (#75018)

## About The Pull Request
Fixes #74697

Look at this for loop

bfba2c5934/code/controllers/subsystem/lighting.dm (L34-L39)

Now look at update corners

bfba2c5934/code/modules/lighting/lighting_source.dm (L428-L430)

Now look at refresh values. this proc has a chance to delete itself here

bfba2c5934/code/modules/lighting/lighting_source.dm (L315-L318)
And here

bfba2c5934/code/modules/lighting/lighting_source.dm (L331-L334)

Now look at the Destroy proc, specifically focus on the needs_update
condition

bfba2c5934/code/modules/lighting/lighting_source.dm (L66-L67)

We are removing the light from the subsystem source queue while the
subsystem is still iterating through them causing big problems for this
for loop

bfba2c5934/code/controllers/subsystem/lighting.dm (L33-L37)

which causes the out of bounds exception because loop variable `i` is
not updated accordingly when this list size is reduced mid iteration.

The solution? we have to move the loop variable `i` back whenever the
source is deleted i.e. removed from the list so we don't overflow

## Changelog

🆑
fix: out of bounds when updating lights in lighting subsystem
/🆑

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@ users.noreply.github.com>

* Fix out of bounds in lighting subsystem

---------

Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@ users.noreply.github.com>
2023-05-25 17:22:43 -07:00
SkyratBot
0371ac21af [MIRROR] Flood lights update their color when spray painted [MDB IGNORE] (#20746)
* Flood lights update their color when spray painted (#74926)

## About The Pull Request
Fixes #74921

All colourful & stuff

https://user-images.githubusercontent.com/110812394/233796341-cbdd5be1-7483-4d8d-b4ef-2b5a02bed6fa.mp4

## Changelog
🆑
fix: flood light now shines with their object color
/🆑

---------

Co-authored-by: san7890 <the@ san7890.com>

* Flood lights update their color when spray painted

---------

Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: san7890 <the@ san7890.com>
2023-04-24 19:25:34 -07:00
Gandalf
e4b4d4d3c0 MISSED MIRROR [Lints Against Unmanaged Local Defines] (#20204)
* https://github.com/tgstation/tgstation/pull/74333

https: //github.com/tgstation/tgstation/pull/74333
Co-Authored-By: tattle <66640614+dragomagol@users.noreply.github.com>

* var stuff

Co-Authored-By: tattle <66640614+dragomagol@users.noreply.github.com>

* vars

* Update sol_fed.dm

---------

Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com>
2023-04-01 01:15:22 +01:00
SkyratBot
edfaf6836a [MIRROR] Removes Starlight Config [MDB IGNORE] (#20134)
* Removes Starlight Config (#74289)

## About The Pull Request

It was config'd off to save init time, but having it function in testing
and mapping is more valuble then the time spend on it.

On that topic, we spend roughly 1.7 seconds of init on this.
~1.3 is spent handling the light sources and their light object
modifications (this is potentailly inflated since other sources could
cause the same objects to need updates)
~0.3 is spent searching for space turfs around lighting_objects during
init.
This will impact change_turf slightly too, costing about ~0.07 in local
testing.

It does save time for live however, since we avoid these config checks.

## Why It's Good For The Game

I believe this time is worth spending.
I've had people try to "fix" artifacts of starlight not being enabled,
things that aren't bugs.
The test environment should as much as we can make it reflect the visual
reality of the game. This helps ensure that

## Changelog
🆑
server: The starlight config has been removed, as it is enabled by
default
/🆑

* Removes Starlight Config

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2023-03-29 22:28:51 +01:00
SkyratBot
db33d75a5e [MIRROR] Space/Changeturf fixes and optimizations [MDB IGNORE] (#19201)
Space/Changeturf fixes and optimizations

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
2023-02-28 15:23:35 -05:00
SkyratBot
f302798585 [MIRROR] Fixes the labor claim console not properly linking in shuttle loads [MDB IGNORE] (#19507)
* Fixes the labor claim console not properly linking in shuttle loads (#73590)

## About The Pull Request

Caused by f88edef0fb

I prevented lighting objects transfering between space turfs and not
space turfs.
This meant if you went from space turf -> non space turf, we had to
spawn you a new lighting object.

This would set your luminosity to 0, then queue you for updates.

This meant that shuttles would go fulldark (To things without
see_in_dark) on move. So when we'd try and do a view check to look for a
stacking machine to feed from, we'd get blocked

Lets swap from a view to a dview() then, and default to lit instead of
unlit turfs

Because mobs use infi see_in_dark this only impacts redundant view()
calls. Lets just be nice to em yeah?

## Why It's Good For The Game

Closes #73324

## Changelog
🆑
fix: The gulag shuttle's point claim console will load in again. Whooops
/🆑

* Fixes the labor claim console not properly linking in shuttle loads

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2023-02-24 01:25:29 -08:00
SkyratBot
32c31b8fc0 [MIRROR] Lighting source refactor (Tiny) [MDB IGNORE] (#19370)
* Lighting source refactor (Tiny) (#73284)

## About The Pull Request

I'm doing two things here. Let's get the boring bit out of the way.

Lighting source updates do three distinct things, and those things were
all in one proc.
I've split that one proc into three, with the first two feeding into the
third.

Second, more interesting thing.

An annoying aspect of our lighting system is the math we use for
calculating luminosity is hardcoded.
This means that we can't have subtypes that are angled, or that have
squared falloff, etc. All has to look the same.
This sucks, and it shows.

It has to be, goes the thinking, because we need very fast lookups that
OOP cannot provide.
We can't bog down the main equation with fluff, because the main
equation needs to be really speedy.

The thing about this equation is the only variants on a turf to turf
basis is exactly how far turfs are from the center.
So what if, instead of doing the math in our corner worker loop, we
build lookup tables to match our current source's state.
The tables, like a heatmap, could encode the lighting of any point along
the line.

This is actually faster then doing the math each time, because the list
generation can be cached.
It also means we've pulled the part we want to override out of hotcode.
It's cheap to override now, and a complex subtype, with angles and such
would have no impact on the typical usage.

So the code's faster, easier to read, and more extensible.
And we can do stuff like squared falloff for some lights in future
without breaking others.

Winning!

## Why It's Good For The Game

Winning

* Lighting source refactor (Tiny)

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2023-02-16 19:08:28 -05:00
SkyratBot
5f9f60713b [MIRROR] Starlight Polish (Space is blue!) [MDB IGNORE] (#19059)
* Starlight Polish (Space is blue!) (#72886)

<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

Adds support to underlays to realize_overlays
Ensures decals properly handle plane offsets
Fixes space lighting double applying if it's changeturf'd into. this
will be important later
Makes solar vis_contents block emissives as expected
Moves transit tube overlays to update_overlays, adds emissive blockers
to them

#### Adds render steps

An expansion on render_target based emissive blockers. 
They allow us to hijack an object's appearance and draw it somewhere
else, or even modify it, THEN draw it somewhere else.
They chain quite nicely

Fixes shuttles deleting z holder objects

#### Makes space emissive, makes walls and floors block emissives
The core idea here goes like this:
We make space glow, and give its overlays some color

This way, the tile and space parallax remain fullbright, along with
anything that doesn't block emissives, but anything that does block
emissives will instead get shaded the color of starlight

This requires a bit of extra work, see later

This is done automatically with render relays, which now support
specifiying layer and color (Need to make an editor for these one of
these days)

The emissive blocking floor stuff requires making a second render plate
to prevent double scaling

Also adds some new layering defines for lighting, and ensures all turf
lights have a layer. We'll get to this soon

#### Makes things in space blue

We color them the same as starlight, by taking advantage of space being
emissive
This means that things in space that block emissive will block it
correctly and be colored blue by the light overlay, but space itself
will remain fullbright

This does require redefining what always_lit means, but nothing but
cordons use that so it's fineee


#### Makes glass above space glow, and some other stuff

Glass tiles that sit above space will now shine light with matching
color to the glasses color. This includes mat tiles.

Glass tiles (not mat because they have no alpha) also only partially
block emissives.
Adds a new proc that uses render steps to acomplish this, essentially
we're cutting out bits below X alpha and drawing what remains as an
emissive.

#### Modifies partial space showing to support glow

Essentially, alongside displaying space as an underlay, we also display
a light overlay colored like starlight.
That starlight overlay gets masked to only be visible in bits that do
not contain any alpha.

We also mask the turf lighting to not go into bits that have no alpha,
to ensure we get the effect we want.
This is done with that lighting layer thing I mentioned earlier.

#### Makes appearance realization's list output ordered

I want it output in order of overlay, sub overlay suboverlay, next
overlay
Need to use insert for that

## Why It's Good For The Game

Pretty!
Also having space be emissive is a very very good way to test for fucked
emissive blockers (If it's broken why are we even drawing the overlay)
I know for a fact mob blockers on lizards and socks are kinda yorked, I
think there's more

<details>
<summary>
Old
</summary>


![image](https://user-images.githubusercontent.com/58055496/213916157-d4b38aa7-3ab6-42a4-989f-7bfba2dc2cba.png)

![image](https://user-images.githubusercontent.com/58055496/213916077-637fa288-bbee-477d-aded-730d9683477e.png)

![image](https://user-images.githubusercontent.com/58055496/213916088-0657a8a2-5627-48e2-8c4b-870c90ef2072.png)

</details>


<details>
<summary>
New
</summary>


![image](https://user-images.githubusercontent.com/58055496/213916107-2af74e64-1817-4a44-b528-180a9160cb9e.png)

![image](https://user-images.githubusercontent.com/58055496/213916115-5fa36fcc-b988-4ccf-850e-21c26ed463d0.png)

![image](https://user-images.githubusercontent.com/58055496/213916120-6833187d-b12e-42a7-ac4b-63c56deb71e5.png)

</details>

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

🆑
add: Space now makes things in it starlight faintly blue
fix: Glass floors that display space now properly let space shine
through them, rather then hiding it in the dark
add: Glass floors above space now glow faintly depending on their glass
type
/🆑

<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>

* update modular

* Update _decal.dm

* Update _decal.dm

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
2023-02-12 00:42:28 -08:00
nevimer
b095316f2f Mirrors https://github.com/tgstation/tgstation/pull/67678 (#18835)
Adds a visualizer for lighting object updating. Optimizes the same (#67678)

It occured to me, we didn't have a good way to "see" what turfs were actually being updated
Figured I'd fix that

I've also added some debug vars on SSlighting to make testing with/without some checks easier

Speaking of which, I've added a second check to lighting corner updating
Basically, if our past and current cached rgb values are the same, there's no point updating

This is possible because static lighting is relative. If you've got a
TON of blue, it'll outweight the red and green you have in smaller amounts

We also do some rounding to ensure values look right

Similarly, if you've got roughly the same lighting, and a bit of something you already have a lot of is added, you're not likely to actually enter a new "bracket" of color

Anyway uh, it's hard to profile this, but I've seen it help quite a bit, mostly with things like emergency lighting that updates lighting in small amounts often, and in constricted spaces.

To some extent just comes down to map design

(cherry picked from commit a6d4e180ad)

# Conflicts:
#	code/modules/lighting/lighting_object.dm

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2023-01-20 14:25:43 -05:00
SkyratBot
4cce4bcf10 [MIRROR] Minor plane cube cleanup [MDB IGNORE] (#18223)
* Minor plane cube cleanup (#72038)

## About The Pull Request

[Fixes area lighting not working on turf change in multiz
cases](7b92deffbc)

If you modify a area lit turf when using multiz, it'd end up using the
wrong plane for its light, because of stupid shit on my part.
Stupid shit resolved

[Fixes some uses of plane masters that only specified one rather then
all](a59ec96d29)

We almost never only want to show SOME hidden planes.
Should really make a helper for this someday

* Minor plane cube cleanup

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2022-12-19 19:18:41 -05:00
SkyratBot
257feb1be7 [MIRROR] More horrible 515 proc compatibility. [MDB IGNORE] (#17671)
* More horrible 515 proc compatibility.

* Feex

* Hopefully we're done now

Co-authored-by: AnturK <AnturK@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
2022-11-27 14:46:36 -08:00
SkyratBot
24eb8217c0 [MIRROR] Builds logic that manages turfs contained inside an area [MDB IGNORE] (#17379)
* Builds logic that manages turfs contained inside an area

* Mirror Conflict

* Modular!

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Funce <funce.973@gmail.com>
Co-authored-by: tastyfish <crazychris32@gmail.com>
2022-11-16 14:42:22 -05:00
Zonespace
f7c26bbf25 515 Compat (#17465)
* ONLY SKYRAT CHANGES

* ACTUALLY SKYRAT CHANGES

* yolo, revert later

* Update alternate_byond_versions.txt

Co-authored-by: AnturK <AnturK@users.noreply.github.com>
2022-11-15 06:59:06 +00:00
SkyratBot
94f5571711 [MIRROR] Fixes compile error in lighting code when testing mode is enabled [MDB IGNORE] (#16914)
* Fixes compile error in lighting code when testing mode is enabled

* Update code/modules/lighting/lighting_object.dm

Co-authored-by: GoblinBackwards <22856555+GoblinBackwards@users.noreply.github.com>
Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
2022-10-17 15:57:46 +01:00
SkyratBot
9bf006d189 [MIRROR] Multiz Rework: Human Suffering Edition (Contains PLANE CUBE) [MDB IGNORE] (#16472)
* Multiz Rework: Human Suffering Edition (Contains PLANE CUBE)

* skyrat changes

* bodyparts merge

* unres door floorlight fix

* Future upstream fix for blindness

* upcoming upstream airlock fix

* fix button emissive

* Fix FOV markings?

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: tastyfish <crazychris32@gmail.com>
2022-10-02 23:30:09 -04:00
SkyratBot
110fd07f34 [MIRROR] Micros the lighting subsystem (Saves a second of init) [MDB IGNORE] (#16461)
* Micros the lighting subsystem (Saves a second of init)

* Update stat_tracking.dm

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Zonespace <41448081+Zonespace27@users.noreply.github.com>
2022-09-28 12:19:43 -07:00
SkyratBot
a1724d5b14 [MIRROR] Removes 1.4 seconds from game init on LOWMEMORYMODE [MDB IGNORE] (#15929)
* Removes 1.4 seconds from game init on LOWMEMORYMODE (#69455)

We were spending 1.4 seconds on doing an add_overlay on EVERY turf in
/area/space

There's no fukin reason to do this, you CAN JUST ADD OVERLAYS TO AREAS
IT WAS POINTLESS. I HATE IT HERE

* Removes 1.4 seconds from game init on LOWMEMORYMODE

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2022-08-30 07:21:17 -07:00
SkyratBot
4af0dd0b8f [MIRROR] addresses reviews on the tram pr made after merge, fixes diagonal movement bugs [MDB IGNORE] (#14943)
* addresses reviews on the tram pr made after merge, fixes diagonal movement bugs (#68033)

* addresses reviews on the tram pr made after merge, fixes diagonal movement bugs

* wew

Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2022-07-19 00:51:33 +00:00
SkyratBot
18a56ffeeb [MIRROR] (code bounty) The tram is now unstoppably powerful. it cannot be stopped, it cannot be slowed, it cannot be reasoned with. YOU HAVE NO IDEA HOW READY YOU ARE [MDB IGNORE] (#14477)
* (code bounty) The tram is now unstoppably powerful. it cannot be stopped, it cannot be slowed, it cannot be reasoned with. YOU HAVE NO IDEA HOW READY YOU ARE

* fex

* fex

Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2022-06-25 01:24:00 +01:00
SkyratBot
2f76afada5 [MIRROR] Cleans up some varedit procs using strings for var names instead of the proper helper [MDB IGNORE] (#12384)
* Cleans up some varedit procs not using strings instead of the proper helper (#65769)

Although these vars are unlikely to ever change, if the vars were ever renamed it would result in these strings not erroring properly if they weren't updated as well.

* Cleans up some varedit procs using strings for var names instead of the proper helper

Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>
2022-03-30 14:59:41 +01:00
SkyratBot
c67f06ffdc [MIRROR] Renames the change_area proc to be more accurate [MDB IGNORE] (#12372)
* Renames the `change_area` proc to be more accurate (#65758)

* Renames the `change_area` proc to be more accurate

Co-authored-by: Seth Scherer <supernovaa41@gmx.com>
2022-03-29 16:49:13 -07:00
SkyratBot
dc3c8e9e52 [MIRROR] Fixes bugged lighting overlays on dark tiles [MDB IGNORE] (#9835)
* Fixes bugged lighting overlays on dark tiles (#63171)

* Fixes bugged lighting overlays on dark tiles

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
2021-12-02 22:24:00 +00:00
SkyratBot
7954d664a8 [MIRROR] removes double spaces before symbols [MDB IGNORE] (#9117)
* removes double spaces before symbols (#62397)

This can apparently cause some bugs on occasions, so I thought I might as well try to kill them all.

* removes double spaces before symbols

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
2021-10-29 04:14:00 +01:00
SkyratBot
3d8e5c3f81 [MIRROR] Fixes base lighting appearance inheritance (corner shadows bug see pics inside) [MDB IGNORE] (#8774)
* Fix base lighting appearance inheritance (#62042)

* Fixes base lighting appearance inheritance (corner shadows bug see pics inside)

Co-authored-by: Wayland-Smithy <64715958+Wayland-Smithy@users.noreply.github.com>
2021-10-13 11:07:24 +01:00
SkyratBot
556d6f074b [MIRROR] fix lighting mapping placement (#8272)
* fix lighting (#61530)

* fix lighting mapping placement

Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com>
2021-09-19 15:51:56 +01:00
SkyratBot
033fca0b7b [MIRROR] Default Baselighting to white (#8270)
* Default Baselighting to white (#61544)

* Default Baselighting to white

Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com>
2021-09-19 15:51:38 +01:00
SkyratBot
2c682cf83e [MIRROR] Things that love the station may no longer leave the station, even when Dr. Anomaly says they should. (#8254)
* Things that love the station may no longer leave the station, even when Dr. Anomaly says they should. (#61335)

Bluespace anomalies detonating Move() things. When something is Move()d, none of the logic in forceMove() or doMove() is called, and thus stationloving things can't tell when they've left the z-level (since that's where the logic for it is).

There are a number of approaches I could have taken: Refactoring anomalies to use different movement code. Refactoring Movement code to send more signals in various scenarios. Refactoring the stationloving component.

I settled on two steps. First, refactoring the component to bring it up to modern code standards. Second, moving the logic for COMSIG_MOVABLE_Z_CHANGED to Moved() so the signal always fires regardless of if Move() or forceMove() or doMove() is used, with an optional var for whether the z-change is communicated to contents. This means the ore box was changed to actually send the signal instead of just returning with no parent call or signal sent. Stationloving ore boxes when?

stationloving procs no longer call SIGNAL_HANDLERs directly. Var names are now more descriptive. Things are renamed and documented. At least for the parts of the code I know.

Probably some other code cleanups.

* Things that love the station may no longer leave the station, even when Dr. Anomaly says they should.

Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
2021-09-18 21:45:42 +01:00
SkyratBot
1501a322ef var/static_lighting proper varedit support (#8065)
Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-09-11 16:30:10 +01:00
Gandalf
8eb1a428f3 Revert "Revert "[MIRROR] Refactor area and turf lighting"" (#8063)
* Revert "Revert "[MIRROR] Refactor area and turf lighting (#7775)" (#7902)"

This reverts commit 64c4c52d12.

* This should probably fix it

* I love linters

Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
2021-09-10 19:01:18 -04:00
Gandalf
64c4c52d12 Revert "[MIRROR] Refactor area and turf lighting (#7775)" (#7902)
This reverts commit 1219e433be.
2021-09-08 18:48:29 +01:00
SkyratBot
a7d6611e0b Reduces copypasta in emissive code. (#8040)
Co-authored-by: TemporalOroboros <TemporalOroboros@gmail.com>
2021-09-07 19:53:49 +01:00
SkyratBot
1219e433be [MIRROR] Refactor area and turf lighting (#7775)
* Refactor area and turf lighting

* AAAAAAAA

Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-08-29 00:43:40 +01:00
SkyratBot
c3d3637fdb [MIRROR] Only blend areas when it's actually needed (#6978)
* Only blend areas when it's actually needed (#60237)

* Only blend areas when it's actually needed

* Respect varedits

* Only blend areas when it's actually needed

Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com>
2021-07-19 20:11:16 +12:00
SkyratBot
00519c0c1a [MIRROR] Turns lighting objects into a datum, makes all lighting be performed with an underlay. big maptick fix very good! (#6286)
* Turns lighting objects into a datum, makes all lighting be performed with an underlay. big maptick fix very good!

* Mirror!

Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>
Co-authored-by: Funce <funce.973@gmail.com>
2021-06-14 18:43:14 +12:00
SkyratBot
6f3b151bb8 [MIRROR] Fixes a bunch of harddels that are sourced from player action (#6252)
* Fixes a bunch of harddels that are sourced from player action

* Mirror!

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Funce <funce.973@gmail.com>
2021-06-11 03:13:33 +01:00
SkyratBot
2d04f758b2 [MIRROR] [READY] Lighting list cleanup. (#6238)
* [READY] Lighting list cleanup. (#59002)

Removed a bunch of back reference lists that were either entirely unused, or contained references that could be found within the datums contained in other lists.

lighting corner datums now get deleted with unused.

light sources no longer track lighting corners where the appiled light rounds to 0.

Fix lighting on turfs that gained dynamic lighting mid round. lazy init corner datums.

these two are related. by decoupling corner datums from the turfs dynamic lighting state, we can use them to know what level of light a non-dynamic light turf should have once it gains dynamic light.

Also should free up some memory not storing these datums in maint. Corner datums only exist on a turf that has light cast upon it by the dynamic lighting system.

Lighting corners are now lazy inited and deleted. they should always (and only exist) if there is a light source shining on it within range (even if the turf has no dynamic lighting). This is needed to support turfs that become lighting enabled mid round. On the plus side, they will no longer be generated on full dark turfs.

* [READY] Lighting list cleanup.

Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
2021-06-10 23:47:04 +01:00
SkyratBot
01af3694ce [MIRROR] Emissive system refactor (#5234)
* Emissive system refactor (#58130)

The emissives system is the system that both lets computer screens and vendors glow in the dark and lets mobs and items block those glows. The current implementation relies on using filters to let mobs and items mask out the glow in the dark overlays on some structures. This is difficult to extend properly without massively increasing maptick. This PR changes the emissives system to use BYONDs native image layering to mask emissive overlays. This should prove to be a more extensible option.

tldr; There exists a system that lets computer screens glow on the dark and lets mobs and items block the glow. It isn't very extensible and this PR attempts to make it more extensible.

How emissive overlays used to work

Currently emissive overlays and the emissive blockers that mask those overlays are handled using a system of inter-masking planes. The emissive overlays and the emissive blockers are placed on separate, hidden plane masters. These are essentially rendering layers and groups. The emissive blocker plane is then used to mask the emissive overlay plane which effectively allows the emissive blockers to block the emissive overlays from being seen. After is has been masked the emissive overlay plane is used to mask the lighting plane, essentially creating holes in the shadows wherever an unblocked glowing thing exists.

Why this is a potential problem

This system works fine. In fact it works great! The computer screens glow, any person or item that winds up on a computer blocks the glow, and everything just works. However, this system runs into some issues when you try to extend it to work on things other than structures. Namely, the current system only supports emissive overlays on structures and emissive overlays that are completely unblockable by any means. As a result, several interesting uses to the system require extending the system.

As a result, if you want to apply emissive overlays to items (which exist between structures and mobs) or emissive overlays to turfs (which exist below structures) you must extend the emissives system to get the emissive overlays and emissive blockers to properly function. Doing this naively, by adding extra emissive overlay and emissive blocker planes and applying all of the relevant masking filters, is not exactly performant.

Maptick is a major contributor to lag and the higher the maptick the more free lag you, the player, get delivered fresh to your client. Trying the naive method resulted in #55782 (1f1b58bb26), an attempt to add glowing carpet to the game. Since the PR revolved around adding glowing carpet it had to extend the emissives system to allow for emissive turfs and emissive blocking structures. Extending the system was done naively as described above and you can see the results. 1.5 times the maptick across the board. Ouch.

So, we know that extending the system in it's current form is impractical. At least if done naively. Thus we are stuck.

tldr; The emissive system currently uses inter-plane masking to allow for emissive blockers to function. This is difficult to reasonably extend without murdering maptick. See #56496 (1f1b58bb26) for the results of naively extending this system.

How emissive overlays are going to work

Alright, so we know that the current system of using planes to let the emissive blockers mask the emissive overlays is difficult to extend in it's current form. The solution is to change how the system works so that it can be extended in a more efficient manner. What we want is a system that allows one set of images to be out masked by another set of images and for the first set of images to be capable of masking the light plane. Preferably, we would also like the ability to interleave the masking effect between emissives and emissive blockers with almost arbitrary layering.

Conveniently, this layering and masking is something BYOND already does to normal items and objects. If we put the emissive overlays and the emissive blockers on the same plane we can use their layers to interleave them almost arbitrarily like any normal structures and items! All we need is a way to mask away the emissive blockers from the resulting rendered plane and we can mask the lighting plane with the remaining emissive overlays.

Luckily, BYOND has provided a single filter that is capable of this task. The color matrix filter. This filter can be used to apply a color matrix to an image! Provided that the emissive overlays and the emissive blockers are different colors we can use a color matrix filter to effectively mask out the emissive blockers from the plane! The resulting emissive plane can be applied as an alpha mask to the lighting plane as it used to, to the same effect. The best part is, we get layering practically for free!

This is exactly what this PR does. It converts the emissives system from the old plane and masking based blocking to a new layer-based system which uses BYONDs native layer handling to mask the emissive overlays.

* Emissive system refactor

Co-authored-by: TemporalOroboros <TemporalOroboros@gmail.com>
2021-04-27 00:03:46 +01:00
Gandalf
d14f4ea7c9 Revert "Revert "[MIRROR] Layer overhaul (#4503)" (#4509)" (#4536)
This reverts commit b27ede689e.
2021-03-31 02:08:56 +01:00
Useroth
b27ede689e Revert "[MIRROR] Layer overhaul (#4503)" (#4509)
This reverts commit 8ac892d340.
2021-03-30 23:45:08 +01:00
SkyratBot
8ac892d340 [MIRROR] Layer overhaul (#4503)
* Layer overhaul (#57915)

## About The Pull Request
Changes up some layer and plane defines for no particular reason lol

## Why It's Good For The Game
Planes actually override layers, and layers control ordering within planes. A lot of the usage of plane and layer was wholly unnecessary. This refactor helps future maintainability while also being needed staging for _future features._

* Layer overhaul

* aaaaaaaaa

a

Co-authored-by: Rob Bailey <actioninja@gmail.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-03-29 16:36:36 +01:00
SkyratBot
9ffdf58259 [MIRROR] Some explosions code cleanup (#4276)
* Some explosions code cleanup (#57493)

Clears out two deprecated explosions systems (explosion ids and explosion levels)
Refactors a bunch of contents_explosions procs to be maybe slightly faster.
Cleans up a bunch of ex_act code.
Slightly cleaner code
A few less unused vars on /atom and /turf

* Some explosions code cleanup

Co-authored-by: TemporalOroboros <TemporalOroboros@gmail.com>
2021-03-21 01:03:36 +00:00
SkyratBot
c2d6dd7d75 [MIRROR] Fixes a ton of harddels (#4215)
* Fixes a ton of harddels (#57736)

Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
Co-authored-by: ShizCalev <ShizCalev@ users.noreply.github.com>

* Fixes a ton of harddels

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
Co-authored-by: ShizCalev <ShizCalev@ users.noreply.github.com>
2021-03-17 20:42:47 +00:00
SkyratBot
63de7b4b0d [MIRROR] Refactors the Light Eater and gives it some flavortext. Some minor behavior changes included. (#3415)
* Refactors the Light Eater and gives it some flavortext. Some minor behavior changes included. (#55551)

Converts the effects of the nightmares light eater into a component and a couple elements
Adds some flavor text to the light eater
Makes the effects of the nightmare's light eater dispel if the armblade is destroyed
Probably a net increase in code quality
More flavortext
The nightmare's light eater effect can be dispelled if you are willing to sacrifice the armblade

* Refactors the Light Eater and gives it some flavortext. Some minor behavior changes included.

Co-authored-by: TemporalOroboros <TemporalOroboros@gmail.com>
2021-02-16 00:45:39 +00:00
SkyratBot
b332b46b65 [MIRROR] Remove hideous inline tab indentation, and bans it in contributing guidelines (#3394)
* Remove hideous inline tab indentation, and bans it in contributing guidelines

* a

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: Gandalf2k15 <jzo123@hotmail.com>
2021-02-15 15:32:02 +00:00
SkyratBot
70024ef6ad [MIRROR] Reverts Adds Neon Carpet (#55782) (#3040)
* reverts Adds Neon Carpet (#55782), it appears to have been causing massive amounts of maptick (#56496)

It appears to have been causing massive amounts of maptick, this'll need a testmerge so we can test my hypothesis

* Reverts Adds Neon Carpet (#55782)

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2021-02-03 10:22:43 +01:00
SkyratBot
902f0a06d7 [MIRROR] Adds Neon Carpet (#2882)
* Adds Neon Carpet

* HARDSET

* Update tgstation.dme

Co-authored-by: TemporalOroboros <TemporalOroboros@gmail.com>
Co-authored-by: Gandalf2k15 <jzo123@hotmail.com>
2021-01-25 17:01:58 +00:00
SkyratBot
5c59e5d537 [MIRROR] Tweaked insulated spray-on gloves (#2783)
* Tweaked insulated spray-on gloves (#56232)

Some tweaking and code smoothing of the spray-on gloves. The only
mechanical change is in also letting them be washed off (although it
takes a while under a shower or using a sink).

A visible message also provides better feedback.

* Make /wash a SHOULD_CALL_PARENT proc

A number of things depend on that signal being called.

* Makes suggested changes

- Adds SIGNAL_HANDLER to signal handler
- Changes name of turf variable for readability
- Reenables lighting object override of parent

* Tweaked insulated spray-on gloves

Co-authored-by: coiax <yellowbounder@gmail.com>
2021-01-19 10:36:10 +00:00
SkyratBot
7882d911c0 [MIRROR] You can look into the gateway now (#2516)
* You can look into the gateway now (#55624)

Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@ users.noreply.github.com>

* You can look into the gateway now

Co-authored-by: Qustinnus <Floydje123@hotmail.com>
Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@ users.noreply.github.com>
2021-01-06 01:25:36 +00:00
SkyratBot
c487c73f39 [MIRROR] Grep for space indentation (#1969)
* Grep for space indentation

* aa

* Update species.dm

* Update species.dm

* Update maps.dm

* Update examine.dm

Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com>
Co-authored-by: Azarak <azarak10@gmail.com>
2020-12-01 12:26:41 +01:00
SkyratBot
3b623b8b67 [MIRROR] [READY]Directional lighting component + light system (#1474)
* Directional lighting component + light system (#54520)

Adds in a new type for the lighting system, the directional one. It piggybacks on the overlay lighting to create a directional effect + adds a nice visual cone mask to make the effect feel really directional.
Also: made the static light system respect the light_on variable.

It feels really nice to shine AT things you're looking at with flashlights and the such, it makes maintenance scouring much more immersive too.
Adds more paranoia as you dont see light behind yourself when you've got a flashlight. Plus makes ambushes more fun

* [READY]Directional lighting component + light system

Co-authored-by: Azarak <azarak10@gmail.com>
2020-10-26 09:13:47 +01:00