Commit Graph

50 Commits

Author SHA1 Message Date
SkyratBot
4f53ec2660 [MIRROR] Fixes complex lights not handling moving well, renames lighting defines (#26484)
* Fixes complex lights not handling moving well, renames lighting defines (#81423)

## About The Pull Request

[Fixes static lights not
moving](ffef43c05a)

Worked fine when the owner moved, but if the owner was inside something
else, it would try and trigger an update on the PARENT's lights, which
are obviously not us.

[Renames MOVABLE_LIGHT and STATIC_LIGHT to better describe what they
do](de73a63bd4)

People keep trying to change the lighting system of lamps and it makes
me mad.
I choose OVERLAY_LIGHT and COMPLEX_LIGHT here, I couldn't figure out a
better name for turf matrix lighting. Suggestions welcome

## Why It's Good For The Game

Closes #80005
Hopefully improves understanding of lighting at a glance
## Changelog
🆑
fix: Fixes fancy lights not updating their source location when picked
up and moved
/🆑

* Oh well

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Useroth <37159550+Useroth@users.noreply.github.com>
2024-02-12 22:25:22 +00:00
SkyratBot
a175ae7794 [MIRROR] Adds lighting height control (space color consistency) [MDB IGNORE] (#24501)
* Adds lighting height control (space color consistency) (#79046)

## About The Pull Request

Adds support for modifying a light's "height"
You can think of this as the distance it is from the ground below it
(Really it's the distance to the corners around it + 0.5 but yaknow) We
use it to keep wall lights from looking weird, but well, not everything
is a wall light

Floors tend to not be, and space in particular does not want to be
treated as such.
In fact, it wants a NEGATIVE height, so it acts as if it in on top of
all of its corners. This allows us to ensure that the starlight from
space and the starlight from starlight overlays always have the same
intensity and color, preventing weird lines from where the two
intersect, or starlight feeling not very present in cases with only one
turf

I've also bumped starlight's intensity form 0.75 to 1, this should help
with the lines thing discussed above.

## Why It's Good For The Game

![image](https://github.com/tgstation/tgstation/assets/58055496/240d1b3f-52c8-4569-8e74-0d801cbdb84d)

## Changelog
🆑
add: Starlight should be a bit more intense, and flow better onto non
space tiles
/🆑

---------

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

* Adds lighting height control (space color consistency)

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Zephyr <12817816+ZephyrTFA@ users.noreply.github.com>
Co-authored-by: san7890 <the@ san7890.com>
2023-10-21 18:21:55 -04:00
SkyratBot
17a7b8f2fb [MIRROR] Starlight Control (Aurora works now, space gas doesn't touch starlight, narsie ending effects) [MDB IGNORE] (#24406)
* Starlight Control (Aurora works now, space gas doesn't touch starlight, narsie ending effects) (#78877)

## About The Pull Request

[Implements a setter for starlight
variables](af34f06b41)

I want to start to modify starlight more, and that means I need a way to
hook into everything that uses it and update it, so we can modify it on
the fly.

This does that, alongside removing space overlays from nearspace (too
many false positives) and making the aurora modify all turfs projecting
starlight, rather then all turfs in an area.

Do still need to figure out handling for the starlight color usage in
turf underlays tho (I gave up, we just keep it static. I'll fix it
someday but the render_relay strategy just doesn't work with its masking
setup)

[Reworks how starlight overlays
work](9da4bc38e2)

Instead of setting color on the overlays directly, we instead store an
object with our current settings in every mob's screen, and
render_target it down onto our overlays.

This lets us update overlay colors VERY trivially. Just need to set
color on the overlay var. Makes modifying starlight a lot cheaper.

It doesn't work on area overlays, because suffering, and it MIGHT induce
extra cost on clients. if it does we can do something about that, we'll
play it by ear

[Removes parallax starlight
coloring.](5f701a1b13)

I'm sorta iffy on the color, the effect can be real oppressive in some
cases, and I'd like to use starlight color for more events in world, and
having it vary can make that looking nice hard.

[Adds some visual effects to narsie being
summoned](a423cfcb2b)

As the rune drawing progresses space (starlight and parallax) go from
normal to greyscale. Then, right about when narsie shows up, starlight
becomes vibrant red.

It's a nice effect. I wanna do more shit like this, I think it'll
improve vibes significantly.
## Why It's Good For The Game

Can't embed it because of github's upload limit, can show a
[link](https://cdn.discordapp.com/attachments/458452245256601615/1160821856358645860/2023-10-08_22-31-22.mp4?ex=65360e99&is=65239999&hm=680e33e4e0026b89e132afc50c04a648a24f869eb662f274a381a5de5c5a36f2&)
for the narsie stuff

Here's
[one](https://cdn.discordapp.com/attachments/326831214667235328/1160813747196141568/2023-10-08_22-34-10.mp4?ex=6536070c&is=6523920c&hm=f8d571d1013da89887f49f3fec99f632251eeeac83085aa7dde97009aee3922f&)
for the aurora too.

This gives us more pretty starlight shit, and the ABILITY to do more
pretty starlight shit. I'm pretty jazzed, and I hope people use this
proc more (keeping in mind that it's pretty hard on the lighting system,
and needs significant delay between changes)
## Changelog

🆑
add: Narsie summoning has had some effects added to space and starlight
del: Removes the link between spacegas color and starlight. It was a
slight bit too vibrant and I think impacted the vibe too wildly to be
incidental.
fix: The aurora event actually... works now. Space lights up and all
that
/🆑

* Starlight Control (Aurora works now, space gas doesn't touch starlight, narsie ending effects)

* Update space.dm

* Update shuttles.dm

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
2023-10-18 01:23:18 -04:00
SkyratBot
08c90f2116 [MIRROR] [MDB IGNORE] Angled Lights & Lighting Prototyping Tool [MDB IGNORE] (#22582)
* [MDB IGNORE] Angled Lights & Lighting Prototyping Tool  (#74365)

## About The Pull Request

Hello friends, I've been on a bit of a lighting kick recently, and I
decided I clearly do not have enough things to work on as it is.
This pr adds angle support to static lights, and a concepting/debug tool
for playing with lights on a map.

Let's start from first principles yeah?

### Why Angled Lights?

Mappers, since they can't actually see a light's effect in editor, tend
to go off gut.
That gut is based more off what "makes sense" then how things actually
work
This means they'll overplace light sources, and also they tend to treat
lights, particularly light "bars" (the bigger ones) as directional.
So you'll have two lights on either sides of a pillar, lights inside a
room with lights outside pointing out, etc.

![image](https://user-images.githubusercontent.com/58055496/228785032-63b86120-ea4c-4e52-b4e8-40a4b61e5bbc.png)

This has annoying side effects. A lot of our map is overlit, to the
point that knocking out a light does.... pretty much nothing.
I find this sad, and would like to work to prevent it. I think dark and
dim, while it does not suit the normal game, is amazing for vibes, and I
want it to be easier to see that.

Angled lights bring how lights work more in line with how mappers expect
lights work, and avoids bleedover into rooms that shouldn't be bled
into, working towards that goal of mine.

### How Angled Lights?

This is more complex then you'd first think so we'll go step by step

![image](https://user-images.githubusercontent.com/58055496/228786117-d937b408-9bc2-4066-9aee-aae21b047151.png)

Oh before we start, some catchup from the last time I touched lighting
code.
Instead of doing a lighting falloff calculation for each lighting corner
(a block that represents the resolution of our lights) in view we
instead generate cached lightsheets. These precalculate and store all
possible falloffs for x and y distances from a source.

This is very useful for angle work, since it makes it almost totally
free.

Atoms get 2 new values. light_angle and light_dir
Light angle is the angle the light uses, and light_dir is a cardinal
direction it displays in

We take these values, and inside sheetbuilding do some optional angle
work. getting the center angle, the angle of a pair of coords, and then
the delta between them.
This is then multiplied against the standard falloff formula, and job
done.

We do need some extra fenangling to make this all work nicely tho.

We currently use a pixel turf var stored on the light source to do
distance calculations.
This is the turf we pretend the light source is on for visuals, most
often used to make wall lights work nice.
The trouble is it's not very granular, and doesn't always have the
effect you might want.

So, instead of generating and storing a pixel turf to do our distance
calculations against, we store x and y offset variables.
We use them to expand our working range and sheet size to ensure things
visually make sense, and then offset any positions by them.

I've added a way for sources to have opinions on their offsets too, and
am using them for wall lights.
This ensures the angle calculations don't make the wall behind a light
fulldark, which would be silly.

### Debug Tool?

In the interest of helping with that core problem, lights being complex
to display, I've added a prototyping tool to the game.
It's locked behind mapping verbs, and works about like this.

Once the verb is activated, it iterates over all the sources in the
world (except turfs because those are kinda silly), outlining and
"freezing" them, preventing any future changes.
Then, it adds 3 buttons to the owners of a light source.

![image](https://user-images.githubusercontent.com/58055496/228776539-4b1d82af-1244-4ed6-8754-7f07e3e47cda.png)
The first button toggles the light on and off, as desired.
The third allows you to move the source around, with a little targeting
icon replacing your mouse
The second tho, that's more interesting.

The second button opens a debug menu for that light

![image](https://user-images.githubusercontent.com/58055496/228777811-ae620588-f08a-4b50-93a0-beea593aea77.png)
There's a lot here, let's go through it.

Bit on the left is a list of templates, which allow you to sample
existing light types (No I have no idea why the background is fullwhite,
need to work on that pre merge)
You can choose one by clicking it, and hitting the upload button.

This replaces your existing lighting values with the template's,
alongside replacing its icon and icon state so it looks right.
There are three types as of now, mostly for categorization. Bar, which
are the larger typically stronger lights, Bulb, which are well, bulbs,
and Misc which could be expanded, but currently just contains floor
lights.

Alongside that you can manually edit the power, range, color and angle
of the focused light.
I also have support for changing the direction of the light source,
since anything that uses directional lighting would also tie light dir
to it.
This isn't *always* done tho, so I should maybe find a way to edit light
dir too.

My hope is this tool will allow for better concepting of a room's
lights, and easier changing of individual object's light values to suit
the right visuals.

### Lemon No Why What

Ok so I applied angle lights to bars and bulbs, which means I am
changing the lighting of pretty much every map in the codebase.
I'm gonna uh, go check my work.

Alongside this I intend to give lighting some depth. So if there's room
to make a space warmer, or highlight light colors from other sources, I
will do that.

(Images as examples)

![image](https://user-images.githubusercontent.com/58055496/228786801-111b6493-c040-4199-ab99-ac1c914d034c.png)

I also want to work on that other goal of mine, making breaking lights
matter. So I'll be doing what I can to ensure you only need to break one
light to make a meaningful change in the scene.

This is semi complicated by one light source not ever actually reaching
fullbright on its own, but we do what we must because we can.

![image](https://user-images.githubusercontent.com/58055496/228786483-b7ad6ecd-874f-4d90-b5ca-6ef78cb70d2b.png)

I'm as I hope you know biased towards darker spaces, I think contrast
has vibes.
In particular I do not think strong lights really suit maintenance.

Most of what is used there are bulbs, so I'm planning on replacing most
uses with low power bulbs, to keep light impacts to rooms, alongside
reducing the amount of lights placed in the main tunnels

![image](https://user-images.githubusercontent.com/58055496/228786594-c6d7610c-611e-478b-bcba-173ebf4c4b12.png)

**If you take issue with this methodology please do so NOW**, I don't
want to have to do another pass over things.
Oh also I'm saving station maps for last since ruins are less likely to
get touched in mapping march and all.

### Misc + Finishing Thoughts

Light templates support mirroring vars off typepaths using a subtype,
which means all the templates added here do not require updating if the
source type changes somehow. I'd like to expand the template list at
some point, perhaps in future.

I've opened this as a draft to make my intentions to make my changes to
lights known, and to serve as motivation for all the map changes I need
to do.

### Farish Future

I'm unhappy with how we currently configure lights. I would like a
system that more directly matches the idea of drawing falloff curves,
along with allowing for different falloffs for different colors,
alongside extending the idea to angle falloff.
This would make out of engine lighting easier, allow for nicer looking
lights (red to pink, blue to purple, etc), and improve accessibility by
artists.

This is slightly far off, because I have other obligations and it's
kinda complicated, but I'd like to mention it cause it's one of my many
pipedreams.

## Changelog
🆑
add: Added angle lighting, applies it to most wall lights!
add: Adds a lighting prototyping tool, mappers go try it out (it's
locked behind the mapping verb)
/🆑

---------

Co-authored-by: MMMiracles <lolaccount1@ hotmail.com>

* [MDB IGNORE] Angled Lights & Lighting Prototyping Tool

* Update north_star.dmm

* Revert "Update north_star.dmm"

This reverts commit bb5b8b5a549f7edc3e23a369a147ed96bab41991.

* Updatepaths

* Update nukie_base.dmm

* Newer version of northstar with the penguins

* Update northstar_cryo.dmm

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: MMMiracles <lolaccount1@ hotmail.com>
Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
2023-07-21 00:43:21 -04:00
Bloop
b674e72ef1 [MISSED MIRROR] Macros multi-z code, removes the false premise of manual offsets (#76248) (#22531)
* Macros multi-z code, removes the false premise of manual offsets (#76248)

## About The Pull Request

[Removes the pretense of relative multiz
levels](0293fdc2bd)

Our multiz system does not support having a z level that is only
connected one way, or which goes down backwards or anything like that.

That's a fiction of the trait system, the actual backend has never
really supported this.

This pr removes the assumptions we were making backend around this, and
uses that to save cpu time.

I am also converting multiz_levels from an assoc list to a pure one,
which saves significantly on access times and cleans up the code
somewhat.

Also I'm making the get_below/get_above procs into macros, for the sake
of cpu time.

[Converts the starlight disease to use BYOND's directional defines
instead of our
own](7d698f02d9)

To some extent spurred on by
https://github.com/DaedalusDock/daedalusdock/pull/298, tho it was known
before

## Why It's Good For The Game

Faster multiz code, faster init, etc etc etc

* modular files how very dare you

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2023-07-18 02:28:15 +00:00
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
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
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
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
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
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
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
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
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
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
72c69368b6 [MIRROR] Opacity refactor (#405)
* Opacity refactor (#52881)

    Moves all opacity var manipulation to a proc which sends a signal.
    light_blocker element for movable opaque atoms made, which tracks its movement and updates the affected turfs for proper lighting updates.
    has_opaque_atom boolean replaced by the opacity_sources lazylist to keep track of the sources, and a directional_opacity which serves a similar function but also allows for future expansion with on-border opaque objects (not yet implemented).
    Some opacity-related sight procs optimized as a result of this.
    Some variables moved to the object's definition.
    A define or two added into the mix for clarity.
    Some code cleaning, like turning booleans into their defines.
    One file renamed for clarity.

Changelog

cl
balance: Mechs no longer block sight. It's a non-trivial cost for the lighting system with little to no gain.
/cl

* Opacity refactor

Co-authored-by: Rohesie <rohesie@gmail.com>
2020-08-19 04:48:14 +02:00
SkyratBot
ee324ab3c2 [MIRROR] Cleanup up all instances of using var/ definitions in proc parameters. (#240)
* Cleanup up all instances of using var/ definitions in proc parameters. (#52728)

* var/list cleanup

* The rest of the owl

* plushvar bad

* Can't follow my own advice.

* Cleanup up all instances of using var/ definitions in proc parameters.

Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
2020-08-07 18:26:21 +01:00
AnturK
304bd061b8 Fixes lighting updates from opaque objects changing state (ie doors) 2020-06-30 22:31:42 +02:00
vuonojenmustaturska
6455fb3be5 Speeds up /datum/light_source/proc/update_corners() by 16% or so (#51004)
About The Pull Request

Just moving /turf/proc/get_corners() into its only caller, slightly shuffled.

Also #defining /proc/GetRedPart() etc, which should flatten down to a copytext+text2num operation with #51005. Also defining parse_light_color() since it has two callers and does something trivial (splits #ff0000 into three luminance vars).

cl Naksu
code: Lighting corner updates are ever so slightly faster.
/cl
2020-05-11 11:33:28 +12:00
nemvar
c38a7a3bb5 Removes a bunch of var/ in procs (#46946)
* Removes a bunch of /var in procs

* reset this

* Why wasn't this already?
2019-10-10 04:20:27 -07:00
vuonojenmustaturska
01aef8ee82 small cleanup 2019-05-05 05:37:21 +03:00
vuonojenmustaturska
e7974dba72 this is approaching nano-optimization 2018-06-19 15:32:05 +03:00
Emmett Gaines
25080ff2c4 defines math (#33498) 2017-12-17 11:02:11 -05:00
Emmett Gaines
7c69cdcb8a Revert math (#33059)
* Revert "all this wrapping and it's not even christmas (#33035)"

This reverts commit faaf151580.

* Revert "fuck me for forgetting to graph this one"

This reverts commit 45d7acea2f.

* Revert "defines math"

This reverts commit 2817a1737b.
2017-11-23 20:59:52 -05:00
ninjanomnom
2817a1737b defines math 2017-11-22 17:36:58 -05:00
ShizCalev
8eafaccc88 Cleans up unused code 2017-11-20 00:03:33 -05:00
Kyle Spier-Swenson
12a82618da Remove some unneeded null checks in lighting
These weren't needed, and ran thousands of times per second during high lighting activity, and were pretty high up in the line by line profile of lighting for what was basically a noop.
2017-10-26 15:21:00 -07:00
Kyle Spier-Swenson
7cda369642 Fixes light source qdel issues. 2017-10-25 23:33:52 -05:00
Jordan Brown
0c22596eca Fix some things assuming lighting corners existed (#28511) 2017-06-17 12:03:10 -03:00
MrStonedOne
52b98599de Fixes nested lights not working properly 2017-05-08 14:16:46 -07:00
MrStonedOne
ac3cfcb4b1 >forgetting that REMOVE_EFFECT needs effect_str 2017-05-08 10:54:32 -07:00
MrStonedOne
9cc6a335e3 last one I swear mom! 2017-05-07 13:52:36 -07:00
MrStonedOne
8762d79fbe Clearly the coffee hasn't kicked in yet 2017-05-07 13:15:48 -07:00
MrStonedOne
ce7878d7b9 Fixes a bug in processing lights of deleted atoms. 2017-05-07 12:40:52 -07:00
MrStonedOne
bd720fff96 Fixes light/lum counts getting fucked up when turfs changed 2017-05-07 12:38:42 -07:00
MrStonedOne
72652a536c Copy/paste fail 2017-05-06 21:31:44 -07:00
MrStonedOne
b0c4bf7ec1 Some more improvments, removed dview.
This *seems* to be a decent speed up just in the appearent time it takes break all lights to process, and dview wasn't really needed here.

Minor oddies can occur on bigger lights near their edges, but not enough to justify the extra cost.
2017-05-06 17:46:20 -07:00
MrStonedOne
2ed266d506 More /vg/lighting tweaks
Rather then remove the light from all tiles, then re-add the light to all tiles, we just go thru each tile and diff the light level from the last value we added to it. (since this is tracked)
This cut the proc calls for updating lights in half.

Lighting objects now default to full brite rather then full dark so shuttles aren't as immersion breaking when they transit.

Made lighting more agressive about clearing empty lists.
2017-05-06 01:50:19 -07:00
Leo
c91ff0e35a Merge pull request #26284 from AnturK/ilookedatstacktraceabyssanditlookedback
Fixes DVIEW runtimes in preferences.
2017-04-20 08:02:37 -03:00
Cyberboss
72d0271f94 Normalizes how some lighting things GC 2017-04-17 13:15:39 -04:00
AnturK
b814e36883 Fixes DVIEW runtimes in preferences. 2017-04-17 00:10:01 +02:00
Cyberboss
9e1ef0ffe2 Global variable wrappers (#25325)
* Add the system for managed global variables

* Travis ban old globals

* So you CAN inline proccall, that's neat

* Fix that

* master.dm

* Remove the hack procs

* Move InitGlobals to the proper spot

* configuration.dm

* Fix the missing pre-slash

* clockcult.dm

* This is probably for the best

* Doy

* Fix shit

* Rest of the DEFINES tree

* Fix

* Use global. for access

* Update find_references_in_globals

Always hated that proc

Whoever made it must've bee a r e a l idiot...

* __HELPERS tree

* Move global initialization to master.

Fix the declaration

* database.dm

* Dat newline

* I said DECLARATIVE order!

* Here's something you can chew on @Iamgoofball

* game_modes.dm

* Fix this

* genetics.dm

* flavor_misc.dm

* More stuff

* Do it mso's way. Keep the controllers as global

* Make master actually see it

* Fix

* Finish _globalvars/lists

* Finish the rest of the _globalvars tree

* This is weird

* Migrate the controllers

* SLOTH -> GLOB

* Lighting globals

* round_start_time -> ticker

* PAI card list -> pai SS

* record_id_num -> static

* Diseases list -> SSdisease

* More disease globals to the SS

* More disease stuff

* Emote list

* Better and better

* Bluh

* So much stuff

* Ahh

* Wires

* dview

* station_areas

* Teleportlocs

* blood_splatter_icons

* Stuff and such

* More stuff

* RAD IO

* More stuff and such

* Blob shit

* Changeling stuff

* Add "Balance" to changelogs

* Balance for changelog compiler + Auto Tagging

* Update the PR template

* hivemind_bank

* Bip

* sacrificed

* Good shit

* Better define

* More cult shit

* Devil shit

* Gang shit

* > borers

Fix shit

* Rename the define

* Nuke

* Objectives

* Sandbox

* Multiverse sword

* Announce systems

* Stuff and such

* TC con

* Airlock

* doppllllerrrrrr

* holopads

* Shut up byond you inconsistent fuck

* Sneaky fuck

* Burp

* Bip

* Fixnshit

* Port without regard

* askdlfjs;

* asdfjasoidojfi

* Protected globals and more

* SO MANY

* ajsimkvahsaoisd

* akfdsiaopwimfeoiwafaw

* gsdfigjosidjfgiosdg

* AHHHHHHHHHHHHHHHHHHHHHHH!!!!!

* facerolll

* ASDFASDFASDF

* Removes the unused parts of dmm_suite

* WIP

* Fix quote

* asdfjauwfnkjs

* afwlunhskjfda

* asfjlaiwuefhaf

* SO CLOSE

* wwwweeeeeewwwww

* agdgmoewranwg

* HOLY MOTHER OF FUCK AND THATS JUST HALF THE JOB?!?

* Fix syntax errors

* 100 errors

* Another 100

* So many...

* Ugh

* More shit

* kilme

* Stuuuuuufffff

* ajrgmrlshio;djfa;sdkl

* jkbhkhjbmjvjmh

* soi soi soi

* butt

* TODAY WE LEARNED THAT GLOBAL AND STATIC ARE THE EXACT SAME FUCKING THING

* lllllllllllllllllllllllllllllllllllllllllll

* afsdijfiawhnflnjhnwsdfs

* yugykihlugk,kj

* time to go

* STUFFF!!!

* AAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!

* ngoaijdjlfkamsdlkf

* Break time

* aufjsdklfalsjfi

* CONTROL KAY AND PRAY

* IT COMPILEELEELELAKLJFKLDAFJLKFDJLADKJHFLJKAJGAHIEJALDFJ!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

* Goteem

* Fix testing mode

* This does not belong in this PR

* Convert it to a controller

* Eh, fuck this option

* Revert controllerization Ill do it some other time

* Fix

* Working controllerization

* FOR THE LOVE OF CHRIST PROTECT THE LOGS

* Protect admins and deadmins

* Use the inbuilt proc
2017-04-06 23:26:13 -06:00
Kyle Spier-Swenson
99002e25a3 Fixes lighting of pixel shifted objects and reverts the hacky memleak fix + other lighting fixes (#24963)
* Revert "Lighting micro optimizations and fixes (#24939)"

This reverts commit 78bbbfe20a.

* vg refactor stage 1

* Fix runtime in get_turf_pixel

* fix lighting on turfs

* Fix certain things reading light levels wrong.

* Made SS faster/better by making it split its tick allotment up between it's 3 tasks

* istypeless loops @pjb3005

/proc/typed_loop    6.826        6.830        6.858       190761
/proc/typeless_loop 5.582        5.586        5.620       190435

* lazy init lists
2017-03-14 19:27:23 +01:00
PJB3005
25b5b49394 SHIP IT 2017-02-12 18:37:09 +01:00
Pieter-Jan Briers
aeb057579e Hey it almost works 2017-02-04 01:00:12 +01:00
PJB3005
7356e80484 hey that should be everything except making it compile. 2017-01-17 22:08:27 +01:00