Commit Graph

211 Commits

Author SHA1 Message Date
Waterpig
d3d3a12540 The big fix for pixel_x and pixel_y use cases. (#90124)
## About The Pull Request

516 requires float layered overlays to be using pixel_w and pixel_z
instead of pixel_x and pixel_y respectively, unless we want
visual/layering errors. This makes sense, as w,z are for visual effects
only. Sadly seems we were not entirely consistent in this, and many
things seem to have been using x,y incorrectly.

This hopefully fixes that, and thus also fixes layering issues. Complete
1:1 compatibility not guaranteed.

I did the lazy way suggested to me by SmArtKar to speed it up (Runtiming
inside apply_overlays), and this is still included in the PR to flash
out possible issues in a TM (Plus I will need someone to grep the
runtimes for me after the TM period to make sure nothing was missed).
After this is done I'll remove all these extra checks.

Lints will probably be failing for a bit, got to wait for [this
update](4b77cd487d)
to them to make it into release. Or just unlint the lines, though that's
probably gonna produce code debt

## Why It's Good For The Game

Fixes this massive 516 mess, hopefully.

closes #90281

## Changelog
🆑
refactor: Changed many of our use cases for pixel_x and pixel_y
correctly into pixel_w and pixel_z, fixing layering issues in the
process.
/🆑

---------

Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com>
Co-authored-by: SmArtKar <master.of.bagets@gmail.com>
2025-03-28 14:18:45 +00:00
LemonInTheDark
77823ad210 Pathfinding Visualization, JPS fixes, Misc Improvement (#90233)
## About The Pull Request

[cleans up poor namespacing on light debugging
tools](93cc9070d5)

[Implements a pathfinding visualization
tool](ed91f69ac4)

It holds a set of inputs from the client, and uses them to generate and
display paths from source/target. Left click sets the source, right
click sets the target.

Pathmap support too, if no target is set we display the paths from every
turf in the map to the source, if one is set we build a path TO it from
the source.

I had to add COMSIG_MOB_CLICKON to observers to make this work (tho idk
why it didn't exist already), I also removed the everpresent colorblind
datum from admin datums, only needs to exist if they're using it.

[Adds a mutable_appearance helper that dirlocks them, wallening port
which I thought might be useful here, and will likely be useful
elsewhere in
future](87f752e7c3)

[Fixes an infinite loop in pathmaps if we tried to pull a cached path to
an unreachable target, && not ||
4head](10086a655d)

[Fixes JPS not dealing with border objects properly. They violate some
of the assumptions JPS makes, so we need to backfill them with checks.
These basically read as (if the thing that should normally take this
path can't reach this turf, can
we?)](f56cc4dd43)

## Why It's Good For The Game

Maybe deals with #80619?

Adds more robust testing tools for pathfinding, should allow people to
better understand/debug these systems. I added this with the idea of
adding multiz support but I don't have the time for that rn.

JPS will work around thindows better, that's nice.

https://file.house/IrBiR0bGxoKw1jJJoxgMRQ==.mp4

## Changelog
🆑
fix: Fixed our pathfinding logic getting deeply confused by border
objects
admin: Added clientside displayed pathfinding debug tools, give em a go
/🆑
2025-03-28 01:51:57 +02:00
Bloop
241514f520 Fixes improper static list declarations + adds grep for it (#87207)
## About The Pull Request

I randomly came across a `var/list/static` in the code, which does not
actually do what was intended, and thought it was silly. A ctrl+f
revealed that this was a fairly common mistake, so I went and fixed all
the instances of it I could find.

~~Including one in lighting code, which it looked like they were trying
to create a global list to cache generated lighting sheet values for
speed, but it was just a normal list that got created each time
pointlessly. Now those values are actually being cached (using a global
var, because a `static` list was not the right thing to use there in the
first place).~~

Nevermind, it seems that this was in fact being cached even if it
shouldn't have been, because byond. Just rearranged it there seeing as
it works either way.


## Why It's Good For The Game

Code that does what it's supposed to

## Changelog

🆑
fix: fixes a bunch of improper static list declarations
/🆑
2024-10-14 22:36:41 -06:00
tonty
3f0b4abb8d Replaces world.icon_size (and some magic numbers) with defines (#86819)
## About The Pull Request

All usages of world.icon_size in code have been replaced with new
`ICONSIZE_X`, `ICONSIZE_Y` and `ICONSIZE_ALL` defines depending on
context

Replaces some "32" magic numbers with the defines

A few bits of code have been modified to split up x/y math as well

## Why It's Good For The Game

Magic number bad, code more readable, code more flexible and I'm told
there's an access cost to doing world.icon_size so minor performance
gains

## Changelog

🆑 tonty
code: made some code relating to the world's icon size more readable
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2024-09-29 13:28:32 +00:00
tgstation-ci[bot]
9a9b428b61 Wallening Revert [MDB Ignore][IDB Ignore] (#86161)
This PR is reverting the wallening by reverting everything up to
8868a5d1fe and replaying the PRs skipping
#85491.

The following 239 (39 + Wallening Main PR excluded) PRs need to be
replayed (DO NOT EDIT THIS LIST MANUALLY, IT IS USED BY THE BOT TO TRACK
PROGRESS):

  - [x] #85777 - Reverted in 3
  - [x] #85767 - Reverted in 2
  - [x] #85763 - Reverted in c
  - [x] #85762 - Reverted in 2
  - [x] #85760 - Reverted in dbc19df13b033ac8bb5a83fa38c5cf140cf31836
  - [x] #85733 - Reverted in 22f17d057eac71661b86c3f2186489568c130043
  - [x] #85721 - Reverted in 6d90643dbbc90f3d21f2d25dc85dc4d4f706d6a3
  - [x] #85719 - Reverted in c52954648309ad4786238f409cd33142d486190f
  - [x] #85705 - Reverted in 3b5ddabfd5ab2cfec226a643be6e8a8fd656c831
  - [x] #85684 - Reverted in cbc1839625f44ba67bcd5489c3629ef98e31b2d4
  - [x] #85662 - Reverted in 69cac24e236604c262093abea7b9566ecbd092c4
  - [x] #85663 - Reverted in f394c3b1430d346b0598abf19fe511b30c3f4676
  - [x] #85673 - Reverted in 8a9ae0411488c9c779a54c5c41076238c230a304
  - [x] #85718 - Reverted in f8f18d8b626e963b06555f76850702740d5de0c3
  - [x] #85667 - Reverted in a1365766d178b727b6c6b503ad410e9d88d57ddd
  - [x] #85683 - Reverted in 3bdb0207d883de8db6f726d976025517cc6d3cba
  - [x] #85676 - Reverted in 0a5d667b2c8a9a2519af2a4fda8cd39f568e5049
  - [x] #85661 - Reverted in 49fc6bc1815133644d7173aa7914ede6c900218a
  - [x] #85682 - Reverted in b41efe96fd72228b079319ac07c660f4cd974af6
  - [x] #85695 - Reverted in 89a173b136cb0297070cef39c5bc9783b6323f02
  - [x] #85654 - Reverted in 1e4836b5173a40fbeb8755e0fb76ebc8d39fe1e0
  - [x] #85655 - Reverted in b4dde41eebd0422e1ec440b4d8d54229fc9617f4
  - [x] #85634 - Reverted in 0c352fc785762da025a68873438593b508f757d9
  - [x] #85700 - Reverted in 1327cf7fe48d7f4fd227120508f77c831aefa4ca
  - [x] #85633 - Reverted in c71c8c9d43112a1f4c6331bbba546881dcffd59d
  - [x] #85649 - Reverted in 73484337077f616878e63208d9bf2309f0d2e579
  - [x] #85475 - Reverted in 839f700001a57646109e75332d5311fe27bbc957
  - [x] #85467 - Reverted in 6f08421f64d01b13775d146cf7a451f9f38e195a
  - [x] #85472 - Reverted in 63c6a9b04e72e8130df5eeb2861c75f80a97e3de
  - [x] #85300 - Reverted in 7c776034f34ee6a76810c1a3779f169f2430c418
  - [x] #85249 - Reverted in 257d02273751fc1f939f76756f70b614a6e06789
  - [x] #85236 - Reverted in f9f4c444c8fc027dea87d4dbe0ebb8dd6bc67154
  - [x] #85299 - Reverted in f24ddff51dc3fec7145a2e97f057f1b286921db3
  - [x] #85228 - Reverted in cb8c318f7e2183d9f941c582f79e4c8b2503d95c
  - [x] #84910 - Reverted in 2a562ca26d9d13f335c276487f66edaa0d21b3bd
  - [x] #84889 - Reverted in 679da6885b034bcd8843f7f4c855388bce263733
  - [x] #84766 - Reverted in 4035dd7adee74af0fed82c14a8749585b2ab1c96
  - [x] #85607 - Reverted in dc9a0462b4c287cee2d541925f8a9988d18d9d85
  - [x] #85618 - Reverted in 2a06f57c89939dc31e9273ef250bd050cff17ff1
  - [x] #85619 - Reverted in b98661affc90e44c68a58c05e57cdf1dfd094c93
  - [x] #85608 - Reverted in 57a935126233f90255aef0a55dab16524be1faac
  - [x] #85648 - Reverted in ab82c66a95d4fbff86040b421a86cc82dca73009
  - [x] #85692 - Reverted in f04fac92bd3594f12f244bae9ea0c5c300c737fb
  - [x] #85544 - Reverted in 7b1198eb5c700e85ec163e60828c01fac55a9909
  - [x] #85631 - Reverted in 81c04ceb553f9887d59f8edf8b2526ff3807264b
  - [x] #85529 - Reverted in 2a7e2c8e3856d67cdefda0d25803393070a6e996
  - [x] #85525 - Reverted in 6ed2d9f28a9333c705eafd21acf54771b8e4db36
  - [x] #85514 - Reverted in a4fa2aa79d93b69d15e0fb9cb1fb7a5bc288bb34
  - [x] #85520 - Reverted in 6e1bd4b11cd55e36cab332c5a0c90c76a2e43703
  - [x] #85521 - Reverted in 79afdac194da5f42b38fb0fdfc394f2b8d485266
  - [x] #85519 - Reverted in a967cae1fb3feea23fdf196595e496431740f52d
  - [x] #85513 - Reverted in e3934edf8794f93a37dc7f63c60aa64ed7b60736
  - [x] #85498 - Reverted in cf1fadbc54a1365362aaeb142cbbd4e2c3be6f15
  - [x] #85485 - Reverted in 2a650ef9c0454bd650d6a13d10c0cb71bb134b2b
  - [x] #85494 - Reverted in bbb97958010dc0f74cee279fd304a7fcaccb625e
  - [x] #85552 - Reverted in f1780715bd054300e50e9102ad150c76690d4ca1
  - [x] #85724 - Reverted in 6933699cef8b01f9aef989f36ca079680a2777ff
  - [x] #85735 - Reverted in a6564f19226ef3969bec0573b49fa772d6e6df31
  - [x] #85729 - Reverted in f728d121a2f27a3cc7973fc2041df9b7193b796d
  - [x] #85704 - Reverted in 38f5b034a3370eda4657a2a5a6adcf3df6ec280c
  - [x] #85660 - Reverted in 7db39869d37ff5b39574d88ffc872449ab5b457c
  - [x] #85752 - Reverted in 1f2988028b7cccad121fc658d6547d89453703b7
  - [x] #85592 - Reverted in 263cbcfcb54746a9361369d86b44cc3e2d375199
  - [x] #85580 - Reverted in a92d53624198dce844c108b5dbea09cf2a16cd10
  - [x] #85573 - Reverted in a7d51042355798038ced44f64e987261b85e93bc
  - [x] #85534 - Reverted in 31787e7d1ce4fec2ce20776672099bf35486a296
  - [x] #85511 - Reverted in 2567a2eb56cdb7058f89ea298e53197147198d82
  - [x] #85508 - Reverted in 69de2ac16c20d968adcd19f0732fd2f84a4ae90e
  - [x] #85680 - Reverted in 44437ac406c708b9a3ab3b47f4e3c10e77a0b91b
  - [x] #85551 - Reverted in 7f17d428fd2787a6982534bfc9ac9188fd4b8675
  - [x] #85478 - Reverted in bd9e575dafc62dc7e1259e8c19199ba15d82be4f
  - [x] #85476 - Reverted in 4ce8052076de0bb52f1ed87663920e98482ade62
  - [x] #85593 - Reverted in 9ff5924d3d56fcba3f180fc4b539568fb2013323
  - [x] #85441 - Reverted in db96015adaec01f3fbcb978796a0d7abd5668932
  - [x] #85567 - Reverted in 62696ad04fb34fd946708309bd3e439db9b3f488
  - [x] #85337 - Reverted in 1267e9f002d03c33187afd2e734e95a78a5ca6ac
  - [x] #85348 - Reverted in 4fcc3c659ee2a38d978e137252309644d5adde8f
  - [x] #85350 - Reverted in e691c833dd5aca2e7808591516e8443e8ccf1b27
  - [x] #85744 - Reverted in 251578d2868a691981b824a268c540b9c15a424e
  - [x] #85772 - Reverted in bc6804a04aa9368074bcc853e689c8fe6de2cb3a
  - [x] #85797 - Reverted in a05e36ec4a0129ff6901ea07488120b54a8ee124
  - [x] #85787 - Reverted in a5393f94b9e71d9ea0625e5fcfb5baaf16af38d3
  - [x] #85742 - Reverted in cd99a2aeaa1347b790c9bfdae35e41900e2ada9a
  - [x] #85440 - Reverted in 8b5ead7c7f0d8087b41256a296e730443752f17d
  - [x] #85739 - Reverted in 3511aae5a4798104220b79ad0e5b2b357dc1e83b
  - [x] #85293 - Reverted in fc687ca36ef476ab9080f0c62b427ab0af533d68
  - [x] #85716 - Reverted in 130b32a222a7585cfdde71aa561fb8b2c7d8083b
- ~~[ ] #85848 - Reverted in f6c46ca2f5cb2d039e4b26731570ca801741cc5d~~
(SKIPPED)
  - [x] #85795 - Reverted in 4684c3325a9135b6bf10eb43026f373993bf605d
  - [x] #85859 - Reverted in 0e0838fe11b7d9af4f62af4f7388ed8fb57bf49c
  - [x] #84873 - Reverted in 34407b79a45718a305f3bfe3fac7f129b4f1c51f
  - [x] #85864 - Reverted in 4b25a209c5019bb65922cd793aff339f20c3d026
- ~~[ ] #85845 - Reverted in a326246e81b7b9242bbf45e7ab3b31caf9ce8147~~
(SKIPPED)
  - [x] #85844 - Reverted in bdf1e6c1e3469884550d3211e51ec9303a022482
- ~~[ ] #85843 - Reverted in 41a8acb196af0988372b06ade7131d07d03daab3~~
(NOT BEING INCLUDED)
- ~~[ ] #85840 - Reverted in 4807bacea8418000f84d62ca0fb122846cab4929~~
(NOT BEING INCLUDED)
- ~~[ ] #85837 - Reverted in bc9edfa8666de14ca4e57e466146d753182a3a71~~
(NOT BEING INCLUDED)
  - [x] #85865 - Reverted in 14c958b465af40f0ff28b100047c4c572919ae19
- ~~[ ] #85818 - Reverted in a77256f74e2d330f5f76141eb9c994a8e5e45810~~
(NOT BEING INCLUDED)
  - [x] #85822 - Reverted in caba685be95fd336f0b09e88bccfb8856d5ad9b4
  - [x] #85794 - Reverted in 0d4de984eb8513d065e8ac724e8cde11f01d4ef7
  - [x] #85756 - Reverted in 9c5a7e1a5f895851493e149ccb5cd50e35cd6101
  - [x] #85852 - Reverted in 74303e5bbae8426a073d068ef4342d8acc420a09
- ~~[ ] #85841 - Reverted in e5831ce3cc87765cb13e6d342417bc1730780392~~
(NOT BEING INCLUDED)
- ~~[ ] #85834 - Reverted in 1be665204da791ec7520d0799c015157fc625953~~
(NOT BEING INCLUDED)
  - [x] #85792 - Reverted in 33b4e48175040f9f76ef83d3154f10c69589b6ad
  - [x] #85646 - Reverted in fd23a0d6c4c96470b688dc0a35370c61c7e32f61
- ~~[ ] #85799 - Reverted in 4a7a6d812f2f301c1e749c92f324223f9bde8a39~~
(NOT BEING INCLUDED)
  - [x] #85819 - Reverted in 8bf001b7889d3a4282947cd332833c473b98eac1
  - [x] #85479 - Reverted in 6aeb5ef4582c03febe0c914185d29f75df4d5d94
- ~~[ ] #85824 - Reverted in 9ca3edfaa17d97306ac73207ef32fd1272061f6b~~
(SKIPPED)
  - [x] #85406 - Reverted in 702280ff48c8aef44f4da9a85eb33a7bc5faa013
  - [x] #85778 - Reverted in ce0ec5c685aadb02ae049d6714f1d2fd6dae1f26
- ~~[ ] #85851 - Reverted in 610c68b275cf3c54181d36ce48bd97b0cce0665c~~
(NOT BEING INCLUDED)
  - [x] #85754 - Reverted in 5cbdda00c5335db79ea50aedba097de1d06bf91b
  - [x] #85266 - Reverted in abdfec798e5223dfa9d67e1967d7618454dbec28
- ~~[ ] #85823 - Reverted in 86b766abd3d77af8ad835a3464fc5ff95cc11079~~
(NOT BEING INCLUDED)
- ~~[ ] #85842 - Reverted in 7ddd47e26ef1bc336e92a6675a33ec3191039c16~~
(NOT BEING INCLUDED)
  - [x] #85857 - Reverted in e32312ee20e9fdccb6dd7c4dc2d185540bd2276b
  - [x] #85856 - Reverted in 7d5d74c2b55a08ef5553568e996053157359dbe2
  - [x] #85276 - Reverted in 1d6fa881e4aef1e6b368d5b6809bccb021fbbd2a
  - [x] #85886 - Reverted in f27d6cabdf8f06f29926616345fa82c4e1e48708
- ~~[ ] #85771 - Reverted in 019d898b601c9ef4d45b7ee0f2144518ee127ca9~~
(SKIPPED)
  - [x] #85464 - Reverted in adc00417795deb85f8aa6170b0f0a07c40c8798c
- ~~[ ] #85870 - Reverted in d69b998420bfb39693bb59b9b9a20611880fdafa~~
(NOT BEING INCLUDED)
- ~~[ ] #85869 - Reverted in 0063c69f111bb67144f9b379476250ce86c99eee~~
(NOT BEING INCLUDED)
  - [x] #85530 - Reverted in b40c93399411d277b3899e149196f3eb974f841f
- ~~[ ] #85871 - Reverted in 63908bbd0a71d0a2bd0a4691816c17cc9eb5310c~~
(NOT BEING INCLUDED)
- ~~[ ] #85832 - Reverted in b29dab083f091198d65a9b0754536f13a935dc2c~~
(SKIPPED)
- ~~[ ] #85825 - Reverted in d072b294ca3bc526df5128df45653db97ba38fe1~~
(NOT BEING INCLUDED)
  - [x] #85632 - Reverted in 290092c7d826aa5b100a38cd4bacc5330b39a934
  - [x] #85902 - Reverted in 76118d620e71f1819a9385863b689d9a8d4ea810
  - [x] #85906 - Reverted in 82623c2cc0fd9aee3e79c95fe5558146c59bc941
  - [x] #85907 - Reverted in 68b7305f21240ca28c33afc904ee532966b7c4bd
  - [x] #85449 - Reverted in ab86a79339ef7b01ceb08dc7279c698927ebcbfa
- ~~[ ] #85875 - Reverted in 0a1fcda90e638e66d574c247e93f0669d0c27b0e~~
(NOT BEING INCLUDED)
- ~~[ ] #85861 - Reverted in 6dad5111aa144860371c93a2d78094fe3d39a7e1~~
(NOT BEING INCLUDED)
  - [x] #85264 - Reverted in dc1d2dcc995f33fc5773e037f5171e9516897281
  - [x] #85726 - Reverted in dbd9ec81586c87c1ab2afc43d43c4f020907dc1b
  - [x] #85730 - Reverted in 7de2c2a1d012ccb03f82c6beabd71a66aa0f910a
  - [x] #85880 - Reverted in 02169d2f28611765997fa332dda69c8031436fd1
  - [x] #85176 - Reverted in e3c85aae1cf665c9892bf7280b7b48ea42323198
- ~~[ ] #85887 - Reverted in 56b35f294b303fd30fbd7685011d37b456d584c7~~
(NOT BEING INCLUDED)
  - [x] #85883 - Reverted in 53be06a505ebd8581114bba8590e378d387b6c1a
- ~~[ ] #85882 - Reverted in a8877ff0083ca5753e3d3b1b9c9edc3613fa6570~~
(NOT BEING INCLUDED)
  - [x] #85895 - Reverted in 741235d41b3a19a40434653f1c14fc0999fac9c3
- ~~[ ] #85746 - Reverted in b7aebb6e5788f6c484173f0a5e29f042ea0c8560~~
(NOT BEING INCLUDED)
- ~~[ ] #85889 - Reverted in d677231d8c55efcd2cf427d510d961cd00f186c7~~
(NOT BEING INCLUDED)
- ~~[ ] #85888 - Reverted in 693f79abae54980ee098d602ed79926d51d5094b~~
(NOT BEING INCLUDED)
  - [x] #85898 - Reverted in 4f41fda23e6b9711aef5d00836591c1ac230612e
- ~~[ ] #85821 - Reverted in 738c9a75f65c4a376da36ad208e1fd8fdeac1ff0~~
(NOT BEING INCLUDED)
  - [x] #85694 - Reverted in f7ea4d19cdaa2067c87c43362b514c684b56b1f3
  - [x] #85308 - Reverted in 4a89b62774da5e9ec9ea241c60ec2a99f51f9bed
  - [x] #85904 - Reverted in 999dbe1773cc7488c629bb8d0d21be5454dbef60
- ~~[ ] #85901 - Reverted in bbf832da9e0c61ad25221530df3b1e93cace25dd~~
(NOT BEING INCLUDED)
- ~~[ ] #85896 - Reverted in 542fe408728faaef8a16869e13c4661018a8a07c~~
(NOT BEING INCLUDED)
  - [x] #85927 - Reverted in 7dc87df28e79ef3e9f3fad83cc0907d2dc867c47
  - [x] #85908 - Reverted in bcca80f073a486ca7908e9636d0e8b275c2085bf
  - [x] #85929 - Reverted in 094bf3610a73961f6433a52ada1a52f25d853738
  - [x] #85877 - Reverted in 5874cafd0dab8d3bd61cf1f662793c2708f42dcc
  - [x] #85903 - Reverted in b3ba8fffc5548e0f2ae6bada3baf10bad3c75e54
- ~~[ ] #85913 - Reverted in 67f7ec48d20f9a64ce4664fa2c452a25b60db59e~~
(SKIPPED)
  - [x] #85914 - Reverted in 7efcd3a5f7fef33c2a1625386bfead80a6ed5309
  - [x] #85917 - Reverted in fc50a5ff998d0e7269131a029e533e90e9dc3c54
- ~~[ ] #85949 - Reverted in 10a8e0f5c69e3ca1eb6e26f00945bfe226598bc2~~
(NOT BEING INCLUDED)
- ~~[ ] #85338 - Reverted in 847549ab938f77464829b1392a1b6f2b2f4b9e8f~~
(SKIPPED)
- ~~[ ] #85922 - Reverted in 3d9388249b8c322aac5dd4980d4ab4673ca01006~~
(SKIPPED)
  - [x] #85923 - Reverted in 2c6ffa4decf40eb52a92353aeb98aee8cbc7b4a2
- ~~[ ] #85920 - Reverted in 1de5b03981d9fcf9c2e6823bffa515fb939aa541~~
(NOT BEING INCLUDED)
  - [x] #85919 - Reverted in 1773e9baccdc941285f56ccb416f5c7125b031ef
  - [x] #85271 - Reverted in aecf8002cf2807a76b6b295867e50392b4bc4534
  - [x] #85918 - Reverted in 023ec3a4d1b1b2fc8f596fea65a77ddc9a06689f
  - [x] #85924 - Reverted in e4886079ad90f33628ac59e0793dfbbc8b8b9420
  - [x] #85928 - Reverted in 7470b7d5ac40be21c345e8825f4c4efc4738e29f
  - [x] #85926 - Reverted in 7761c9e3a1f442f37d4db4b27e5d78fae95edf00
  - [x] #85900 - Reverted in 633736cb0655dc464e9794666c63ae6ec7689826
  - [x] #85909 - Reverted in a47c7ec8a77bd02f8b7bb1ce3c621efbe57077c3
- ~~[ ] #85931 - Reverted in 9bc7a412982da6fbdb9cd24570d98877b76a45c3~~
(NOT BEING INCLUDED)
- ~~[ ] #85894 - Reverted in c15e1711656929aeb59f482145ecf029b40d58b8~~
(SKIPPED)
- ~~[ ] #85759 - Reverted in f45d70be0ffb9bf007bfa18a1bd1b5ce23d6dcfc~~
(SKIPPED)
- ~~[ ] #85892 - Reverted in fc08dc1a7160f584c94e368962eb56c18dccc86a~~
(SKIPPED)
- ~~[ ] #85915 - Reverted in 428f475c26f383998a689560a16de86da3f17557~~
(NOT BEING INCLUDED)
  - [x] #85222 - Reverted in 66e7ac2f00735c90acdb69a50c9e485a0f4e1552
  - [x] #85150 - Reverted in 3079387f926e41febb576105ec0b3acec2f7beba
  - [x] #85935 - Reverted in ce6114f644593ead295763362a61d19077f22acf
- ~~[ ] #85936 - Reverted in f601fa796bce7e70645a84fff91391cbb6ed8e37~~
(NOT BEING INCLUDED)
  - [x] #85937 - Reverted in 64242f589df3d9118fd5c09d19574758260c76a1
- ~~[ ] #85940 - Reverted in a979c6c24705a8729efab5eca40840f1c8070f1d~~
(NOT BEING INCLUDED)
- ~~[ ] #85942 - Reverted in 9562c14083212fc962b8687663ba5fac2ebfdd1a~~
(NOT BEING INCLUDED)
  - [x] #85944 - Reverted in adf8e1927e4b9886c9042d6a0eaaef74e4e0e102
  - [x] #85605 - Reverted in 88dbfb4f859f12549e8cf8ed5204ee8d7183d40f
  - [x] #85945 - Reverted in dea9e79a9c298eae05b8d173d8df4a37218e2d9c
  - [x] #84964 - Reverted in 234481fb1d92a266768fcbca49245151236803ed
  - [x] #85952 - Reverted in c62d87ab54d687db64b1551b319195527ca92924
  - [x] #85953 - Reverted in bd0e46245ccb597081b8baa4f81ff85949f672be
- ~~[ ] #85943 - Reverted in 697b6841391354885ef2d314d9185b8eee7a5cb0~~
(NOT BEING INCLUDED)
  - [x] #85946 - Reverted in f4afd4d330b6fc28397f7707bca8773d44cb15ed
  - [x] #85950 - Reverted in 394fffcb836f32f4e1b1fd91a621249e0e5d7d67
  - [x] #85955 - Reverted in 2230a5bc141cd11fc79ccf6b4b653257508a7e65
  - [x] #85319 - Reverted in fdaddd9cd6ed0bdd1cd78ba3c9729035936abcbd
- ~~[ ] #85934 - Reverted in 41bb6122b6d6e3c38c500d5ddf63808836ab090e~~
(NOT BEING INCLUDED)
- ~~[ ] #85255 - Reverted in 3e213b8554b40e53f6429969d6e9dbaa357fb09e~~
(SKIPPED)
- ~~[ ] #85961 - Reverted in 6f3d000b3601dc7f75f7edd221fab3edc3bbbd8c~~
(NOT BEING INCLUDED)
  - [x] #85956 - Reverted in a5bf22a93ca1a149ca839e6c874d088b32c7c25f
  - [x] #85958 - Reverted in c964a46741bd26a600bb75bc6463c629c11c914f
- ~~[ ] #85969 - Reverted in b599cd4bd3ae223210eb0d3b47c3bd814e1cb08c~~
(NOT BEING INCLUDED)
  - [x] #85252 - Reverted in 5a0e2f31a6e1093ab47970056f5bb3af54172e12
  - [x] #85984 - Reverted in b000da82f62bb48b059a881d596f3a2e7d985d21
  - [x] #85137 - Reverted in 1f31b558e41fc66d5da9db30a83d89cbb9949eae
  - [x] #85881 - Reverted in f3913f94c4557c4fc9d5605cd8e875accabebda6
  - [x] #85972 - Reverted in d3afed87a3a8eed7e0016512d2186b6aded0fca9
  - [x] #85998 - Reverted in 3d286b763cf2f7fe11b6f0ccb2456130570726c2
  - [x] #85358 - Reverted in 75f84bda1b3c80d54ae94a567bf96016aaae45b2
- ~~[ ] #85964 - Reverted in be1aeb010afa20c1b6949218d8911ee9e900b3d7~~
(SKIPPED)
  - [x] #85960 - Reverted in 69cbfce1529377ce7cd998ab474add0d61650d7f
  - [x] #85992 - Reverted in 89e4a7bb0b793461338ba1b0a3d332bf78ef140c
  - [x] #85967 - Reverted in d398e418eb340f309be523514ae0befdf1869560
  - [x] #84888 - Reverted in bb98eb09f06a1fdc0bbb733d6a42d711e6d477bc
- ~~[ ] #85983 - Reverted in 81152a9cd347eb7b4073758e2e96490e6e729ca9~~
(NOT BEING INCLUDED)
  - [x] #85976 - Reverted in 93c091347ca8f04763b91fd4c39ccdff848a0d50
- ~~[ ] #85962 - Reverted in de32ea25b534c725e3d55418ef0363145f0ed2b0~~
(NOT BEING INCLUDED)
  - [x] #85977 - Reverted in 393652a1ef065014748ae6977a9f36b32c99dc7c
  - [x] #85959 - Reverted in 52e6e07eb98bcb74a423934b14d5850dbf2c6647
- ~~[ ] #85988 - Reverted in a5853ccde46b5fee2d9eb31755384de15e7a5a87~~
(SKIPPED)
- ~~[ ] #85974 - Reverted in eab20ba04e6b06f862a0fb35cedb6374af7b93c0~~
(SKIPPED)
  - [x] #85939 - Reverted in ca85b05692f55f6b3e4bd0b3f30c63f89531c33f
  - [x] #85878 - Reverted in 3b3d3dbff9148e46b01f3af28f17f66bef4dfd16
  - [x] #85858 - Reverted in 08d6082e62d07117170ff5ffd065daad1278e853
  - [x] #85651 - Reverted in b76ab4a2114dd0eb78336878b2825d9919c210cc
  - [x] #85505 - Reverted in 0958eaa7b6f4d48400bea4e215e11edaa933ba8a
- ~~[ ] #85352 - Reverted in 620cec18618e514bbe4d3eb0a0d0db1528b9d312~~
(SKIPPED)
  - [x] #85279 - Reverted in ba0fd529ef94ba793fe2eee40975533fe8f475e3
  - [x] #85954 - Reverted in d7fe0336f2a968b93fd02361814930236e3b8ddf
- ~~[ ] #85996 - Reverted in 5fbd62139e0c1b668aaaf35d249d527cdc276b93~~
(SKIPPED)
  - [x] #85994 - Reverted in c99a03c6833ac58e0288111953573f697488234f
  - [x] #85470 - Reverted in fbd5ac46d84d27455cbcf5f998741124ed6de625
- ~~[ ] #85981 - Reverted in dc74c75011ddfb1b16d644fd2ca5607599532d6f~~
(NOT BEING INCLUDED)
  - [x] #86011 - Reverted in b14b42e70e2bd21f19d443065b2342e4591c5e05
  - [x] #85820 - Reverted in 26248546b9f7d0fedec52e7b2f7def40d457e29f
  - [x] #86013 - Reverted in e17ac14f53d08be988f0516e7c39d31496a35184
  - [x] #85986 - Reverted in 4021ffea0b1bbb1f6c5b26a296abd5a8bda1d5b3
  - [x] #86019 - Reverted in c0801b3aa5dbdd33ca7c6c81e80c9fa573ada9e1
  - [x] #86010 - Reverted in 10dff005729305b75deaf1c5755a94125fa5141d
  - [x] #86029 - Reverted in 664619213db52930fa22007561dad01fe8bb3de4
  - [x] #86024 - Reverted in e74ea4368cbd2cd085aa6e8bbe83db07800b0bd4
  - [x] #86022 - Reverted in 0b2fc6a1f478c48546b161fd3ddd571f7ed6000f
  - [x] #86015 - Reverted in b99d93592dbf8840a035f22f26b64bcf27c817cb
  - [x] #85415 - Reverted in d6102c7339838675c03eb771d7a3b5a9bea4035d
- ~~[ ] #85703 - Reverted in 339b7edf3c0318f9f02922018d6918211660234f~~
(SKIPPED)
  - [x] #85890 - Reverted in 4e54f376e07071f84ed283e7468e334aaf6e4e02
  - [x] #86046 - Reverted in 0bbe2c9a048c229d151682e08aca1fa176c3ad91
  - [x] #86008 - Reverted in a0a0635cd6618618c49fda7cf150231d62a14236
  - [x] #86042 - Reverted in fa376315a064b945ed9846225c7f48e38e9b55ed
  - [x] #85891 - Reverted in 603dcd691e9eaad0a610c60c94fee522391bd2b3
  - [x] #86040 - Reverted in e42fc7618194b4b01cb68ca0c61385e465d0cb05
  - [x] #86025 - Reverted in 536bb25fe91845fe05bb7d512d8e73cc193b67ff
  - [x] #86012 - Reverted in 5cb4ec5bdf87653a5bb651c536f21423db30887e
  - [x] #86004 - Reverted in e9536143e78e3b0614d3ce6ee2c9a40005ba9b91
  - [x] #85989 - Reverted in 88a92322c2f028d2e3a2be18951d35d1135a6268
  - [x] #86044 - Reverted in d0a5fb5956be23144e325d3d51f53cb103dd5bbe
  - [x] #86001 - Reverted in 195c3597044315c9b10d002e6196911ac0622c45
  - [x] #86030 - Reverted in 5265796286b481d34fc91a1f8c58b6373d23415e
  - [x] #86055 - Reverted in e82138798cda028b673fe7ac83890e5a6b9e16d2
  - [x] #86057 - Reverted in c921900e6151552aa0768b4c9d7cc58c58dfbcc0
  - [x] #86014 - Reverted in c004d4e989a2faa672793f58fd98bd6fded8194e
  - [x] #85304 - Reverted in 611510bd7f65ee06738b7344326d72f57a131f8a
  - [x] #86061 - Reverted in f14b0a245dcf164bb99f7696e180847bb5be9b11
  - [x] #86075 - Reverted in 5339fe6c098d48769eda3f9935aa3488faa73097
  - [x] #86089 - Reverted in 10b5398e6b55f4799ca7d6740ac50c031e157c43
  - [x] #86081 - Reverted in ba86f43383cd2e8417c0a465c23fe3227fcd5520
  - [x] #85609 - Reverted in 9e5208feaca3163b7f4237c316d880161933777f
  - [x] #86114 - Reverted in cf410a97b8348381f96cc784a6489d7c1dea49ba
  - [x] #86023 - Reverted in a7a2e95c0c1b0598f15019934c80ccc80a9f89af
  - [x] #86027 - Reverted in 9cf71611befac64d26d326c060ef082262aeca70
  - [x] #86016 - Reverted in b67fa06e1559c8de87899bd06d09891b4c7ae947
  - [x] #86095 - Reverted in dc5abd827bb56e1609afe5a9d2bdd957d40cc75c
  - [x] #86105 - Reverted in f5b8e7ecbe99cb38e829a98a4f6eb2c200af8b91
  - [x] #86070 - Reverted in 6c460bbc22827bdbc566b524b8e6a959cbb61c37

After that some startup commits on this branch need to be reverted then
it can be merged.

---------

Co-authored-by: tgstation-ci <179393467+tgstation-ci[bot]@users.noreply.github.com>
Co-authored-by: Jordan Dominion <Cyberboss@users.noreply.github.com>
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: MrMelbert <kmelbert4@gmail.com>
2024-09-03 10:41:51 +02:00
LemonInTheDark
4b4e9dff1d Wallening [IDB IGNORE] [MDB IGNORE] (#85491)
## What's going on here

Kept you waitin huh!

This pr resprites most all walls, windows and other "wall adjacent"
things to a 3/4th perspective, technical term is "tall" walls (we are
very smart).

If you're trying to understand the technical details here, much of the
"rendering tech" is built off the idea of split-vis. Basically, split a
sprite up and render it on adjacent turfs, to prevent seeing "through"
walls/doors, and to support seeing "edges" without actually seeing the
atom itself.

Most of the rest of it is pipelining done to accommodate how icons are
cut.

## Path To Merge

Almost* all sprites and code is done at this point. 
There are some things missing both on and off the bounty list, but that
will be the case forever unless we force upstream (you guys) to stop
adding new shit that doesn't fit the style.
I plan on accepting and integrating prs to the current working repo
<https://github.com/wall-nerds/wallening> up until a merge, to make
contribution simpler and allow things like bounties to close out more
easily

This pr is quite bulky, even stripping away map changes it's maybe 7000
LOC (We have a few maps that were modified with UpdatePaths, I am also
tentatively pring our test map, for future use.)
This may inhibit proper review, although that is part of why I am
willing to make it despite my perfectionism. Apologies in advance.

Due to the perspective shift, a lot of mapping work is going to need to
be done at some point. This comes in varying levels of priority. Many
wallmounts are offset by hand, some are stuck in the wall/basically
cannot be placed on the east/west/north edges of walls (posters), some
just don't look great good in their current position.

Tests are currently a minor bit yorked, I thought it was more important
to get this up then to clean them fully.

## What does it look like?


![dreamseeker_hBsU6wCu91](https://github.com/user-attachments/assets/5392fa3b-60f6-40ea-876f-e686f25f996a)

![dreamseeker_CTiK0Je5iR](https://github.com/user-attachments/assets/1aee23bd-a5ec-4679-b094-d044401b7222)

![dreamseeker_HYkS1Q9GRq](https://github.com/user-attachments/assets/bad8844b-3179-4856-8684-f912e14e844a)

![dreamseeker_Pa18tgyKYp](https://github.com/user-attachments/assets/c2e1d222-9e5c-4500-8829-dd065428644a)

![dreamseeker_BfOBwS2mjH](https://github.com/user-attachments/assets/7dc51153-111d-4b17-93c3-8389daa6b60b)

![dreamseeker_iJazOumiMQ](https://github.com/user-attachments/assets/5837e203-3865-4f60-854e-62b4875c6b99)

## Credits

<details>
<summary>Historical Mumbojumbo</summary>

I am gonna do my best to document how this project came to be. I am
operating off third party info and half remembered details, so if I'm
wrong please yell at me.

This project started sometime in late 2020, as a product of Rohesie
trying to integrate and make easier work from Mojave Sun (A recently
defunct fallout server) with /tg/.

Mojave Sun (Apparently this was LITERALLY JUST infrared baron, that man
is insane) was working with tall walls, IE walls that are 48px tall
instead of the normal 32. This was I THINK done based off a technical
prototype from aao7 proving A it was possible and B it didn't look like
dogwater.

This alongside oranges begging the art team for 3/4th walls (he meant
TGMC style) lead to Rohesie bringing on contributors from general /tg/,
including actionninja who would eventually take over as technical lead
and Kryson, who would define /tg/'s version of the artstyle. Much of the
formative aspects of this project are their work.

The project was coming along pretty well for a few months, but ran into
serious technical issues with `SIDE_MAP`, a byond map_format that allows
for simpler 3/4th rendering.
Due to BULLSHIT I will not detail here, the map format caused issues
both at random with flickering and heavily with multiz.

Concurrent with this, action stepped down after hacking out the
rendering tech and starting work on an icon cutter that would allow for
simpler icon generation, leaving ninjanomnom to manage the project.

Some time passed, and the project stalled out due to the technical
issues. Eventually I built a test case for the issues we had with
`SIDE_MAP` and convinced lummox jr (byond's developer) to explain how
the fuckin thing actually worked. This understanding made the project
theoretically possible, but did not resolve the problems with multi-z.
Resolving those required a full rework of how rendering like, worked. I
(alongside tattle) took over project development from ninjanomnom at
this time, and started work on Plane Cube (#69115), which when finished
would finally make the project technically feasible.

The time between then and now has been slow, progressive work. Many many
artists and technical folks have dumped their time into this (as you can
see from the credits). I will get into this more below but I would like
to explicitly thank (in no particular order) tattle, draco, arcanemusic,
actionninja, imaginos, viro and kylerace for keeping the project alive
in this time period. I would have curled up into a ball and died if I
had to do this all myself, your help has been indispensable.

</details>

<details>
<summary>Detailed Credits</summary>

Deep apologies if I have forgotten someone (I am sure I have, if someone
is you please contact me). I've done my best to collate from the git
log/my memory.

Thanks to (In no particular order):
Raccoff: Being funny to bully, creating threshold decals for airlocks
aa07: (I think) inspiring the project
ActionNinja: Laying the technical rock we build off, supporting me
despite byond trying to kill him, building the icon cutter that makes
this possible
ArcaneMusic: Artistic and technical work spanning from the project's
start to literally today, being a constant of motivation and positivity.
I can't list all the stuff he's done
Armhulen: Key rendering work (he's the reason thindows render right), an
upbeat personality and a kick in the ass. Love you arm
Azlan: Damn cool sprites, consistently
Ben10Omintrix: You know ben showed up just to make basic mobs work, he's
just fuckin like that man
BigBimmer: A large amount of bounty work, alongside just like, throwing
shit around. An absolute joy to work with
Capsandi: Plaques, blastdoors, artistic work early on
CapybaraExtravagante: Rendering work on wall frames
Draco: SO MUCH STUFF. Much of the spritework done over the past two
years is his, constantly engaged and will take on anything. I would have
given up if not for you
Floyd: Early rendering work, so early I don't even know the details.
Enjoy freedom brother
Imaginos16: A guiding hand through the middle years, handled much of the
sprite review and contribution for a good bit there
Iamgoofball: A dedication to detail and aesthetic goals, spends a lot of
effort dissecting feedback with a focus on making things as good as they
can be at the jump
Infrared: Part of the impetus for the project, made all the xenomorph
stuff in the MS style
Jacquerel: A bunch of little upkeep/technical things, has done so much
sprite gruntwork (WHY ARE THERE SO MANY PAINTING TYPES)
Justice12354: Solved a bunch of error sprites (and worked out how to
actually make prs to the project) Thanks bro!
Kryson: Built the artstyle of the project, carrying on for years even
when it was technically dying, only stopping to casually beat cancer. So
much of our style and art is Kryson
KylerAce: Handled annoying technical stuff for me, built window frame
logic and fully got rid of grilles.
LemonInTheDark: Rendering dirtywork, project management and just so much
fucking time in dreammaker editing sprites
Meyhazah: Table buttons, brass windows and alll the old style doors
Mothblocks: Has provided constant support, gave me a deadline and
motivation, erased worries about "it not being done", gave just SO much
money to fill in the critical holes in sprites. Thanks moth
MTandi: Contributed art despite his own blackjack and hookers club
opening right down the road, I'm sorry I rolled over some of your
sprites man I wish we had finished earlier
Ninjanomnomnom: Consulted on gags issues, kept things alive through some
truly shit times
oranges: This is his fault
Rohesie: Organized the effort, did much of the initial like, proof of
concept stuff. I hope you're doin well whatever you're up to.
san7890: Consulting on mapper UX/design problems, being my pet mapper
Senefi: Offsetting items with a focus on detail/the more unused
canidates
SimplyLogan: Detailed map work and mapper feedback, personally very kind
even if we end up talking past each other sometimes. Thank you!
SpaceSmithers: Just like, random mapping support out of nowhere, and
bein a straight up cool dude
Tattle: A bunch of misc project management stuff, organizing the
discord, managing the test server, dealing with all the mapping bullshit
for me, being my backup in case of bus. I know you think you didn't do
much but your presence and work have been a great help
Thunder12345: Came out of nowhere and just so much of the random
bounties, I'm kind of upset about how much we paid him
Time-Green: I hooked him in by fucking with stuff he made and now he's
just doin shit, thanks for helping out man!
Twaticus: Provided artistic feedback and authority for my poor feeble
coder brain, believed in the project for YEARS, was a constant source of
❤️ and affirmation
unit0016: I have no god damn idea who she is, popped out of nowhere on
the github one day and dealt with a bunch of annoying
rendering/refactoring. Godspeed random furry thank you for all your
effort and issue reports
Viro: A bunch of detailed spriting moving towards 3/4ths, both on and
off the wallening fork. If anyone believed this project would be done,
it was viro
Wallem: Artistic review and consultation, was my go-to guy for a long
time when the other two spritetainers were inactive
Waltermeldon: Cracked out a bunch of rendering work, he's the reason
windows look like not dogwater. Alongside floyd and action spent a TON
of time speaking to lummox/unearthing how byond rendering worked trying
to make this thing happen
ZephyrTFA: Added directional airlock helpers, dealt with a big fuckin
bugaboo that was living in my brain like it was nothing. Love you
brother

And finally:
The Mojave Sun development team. They provided a testbed for the idea,
committed hundreds and hundreds of hours to the artstyle, and were a
large reason we caught issues early enough to meaningfully deal with
them. Your work is a testament to what longterm effort and deep detailed
care produce. I hope you're doing well whatever you're up to. Go out
with a bang!
</details>

## Changelog
🆑 Raccoff, aa07, ActionNinja, ArcaneMusic, Armhulen, Azlan,
Ben10Omintrix, BigBimmer, Capsandi, CapybaraExtravagante, Draco, Floyd,
Iamgoofball, Imaginos16, Infrared, Jacquerel, Justice12354, Kryson,
KylerAce, LemonInTheDark, Meyhazah, Mothblocks, MTandi, Ninjanomnom,
oranges, Rohesie, Runi-c, san7890, Senefi, SimplyLogan, SomeAngryMiner,
SpaceSmithers, Tattle, Thunder12345, Time-Green, Twaticus, unit0016,
Viro, Waltermeldon, ZephyrTFA with thanks to the Mojave Sun team!
add: Resprites or offsets almost all "tall" objects in the game to match
a 3/4ths perspective
add: Bunch of rendering mumbo jumbo to make said 3/4ths perspective work
/🆑

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: = <stewartareid@outlook.com>
Co-authored-by: Capsandi <dansullycc@gmail.com>
Co-authored-by: ArcaneMusic <hero12290@aol.com>
Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com>
Co-authored-by: SomeAngryMiner <53237389+SomeAngryMiner@users.noreply.github.com>
Co-authored-by: KylerAce <kylerlumpkin1@gmail.com>
Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com>
Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
Co-authored-by: Runi-c <5150427+Runi-c@users.noreply.github.com>
Co-authored-by: Roryl-c <5150427+Roryl-c@users.noreply.github.com>
Co-authored-by: tattle <article.disaster@gmail.com>
Co-authored-by: Senefi <20830349+Peliex@users.noreply.github.com>
Co-authored-by: Justice <42555530+Justice12354@users.noreply.github.com>
Co-authored-by: BluBerry016 <50649185+unit0016@users.noreply.github.com>
Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: SimplyLogan <47579821+loganuk@users.noreply.github.com>
Co-authored-by: Emmett Gaines <ninjanomnom@gmail.com>
Co-authored-by: Rob Bailey <github@criticalaction.net>
Co-authored-by: MMMiracles <lolaccount1@hotmail.com>
2024-08-14 09:07:45 +00:00
Jackriip
4d36dfc2ff localizes create_all_lighting_objects (#85135)
## About The Pull Request

Moves create_all_lighting_objects to the only thing that uses it - the
lighting subsystem

I saw zero difference in lighting system init time

## Why It's Good For The Game

Reduces global proc pollution and keeps everything in the same place,
improving code readability

## Changelog
🆑
refactor: moves the create_all_lighting_objects proc to the lighting
subsystem
/🆑
2024-07-29 15:42:14 +01:00
Kocma-san
d1799dc6b5 Fixed lights stopping emitting light in some situations (#84299)
## About The Pull Request

closes #77789
edt: also closes #82600

Light sources stop emitting light if the tile in which the light source
itself is located and all 4 adjacent tile block the light. This usually
happens when a smoke grenade is thrown, or something went wrong in the
chemistry again

<details>
<summary>Videos</summary>

As it was before


https://github.com/tgstation/tgstation/assets/112967882/44ff556b-d09f-4024-945e-c2c105f511a9

Now


https://github.com/tgstation/tgstation/assets/112967882/9f9f8f43-47a9-47be-8499-99bab39fc166


</details>

## Why It's Good For The Game

You wont need to switch the lights twice to make them work after someone
threw smoke grenades into the hallways anymore

## Changelog
🆑
fix: Fixed lights stopping emitting light in some situations
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2024-07-09 21:32:03 +02:00
wixoa
1a10197544 Remove 2 instances of duplicate argument names (#81757)
## About The Pull Request

I fixed 2 instances of procs having multiple arguments with the same
name. BYOND does not error on these, instead ignoring all but the last.
It's best to remove these for clarity.

## Why It's Good For The Game

N/A

---------

Co-authored-by: san7890 <the@san7890.com>
2024-03-01 13:52:49 -07:00
LemonInTheDark
70651816c2 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
/🆑
2024-02-12 20:50:20 +01:00
Kyle Spier-Swenson
8703eac50d split area.contained_turfs up by zlevel, make init 10 seconds faster (#80941)
## About The Pull Request

Situation: areas have a list of all turfs in their area.

Problem: `/area/space` is an area and has a 6 to 7 digit count of turfs
that has to be traversed for every turf we need to remove from it. This
can take multiple byond ticks just to preform this action for a single
space rune

Solution: split the list by zlevel, and only search the right zlevel
list when removing turfs from areas.

replaces `area.get_contained_turfs()` with a few new procs:

* `get_highest_zlevel()` - returns the highest zlevel the area contains
turfs in. useful for use with `get_turfs_by_zlevel`
* `get_turfs_by_zlevel(zlevel)` - returns a list of turfs in the area in
a given zlevel. Useful for code that only cares about a specific zlevel
or changes behavior based on zlevel like lighting init.
* `get_turfs_from_all_zlevels()` - the replacement for
`get_contained_turfs()`, renamed as such so anybody copying/cargo
culting code gets a hint that a zlevel specific version might exist.
Still used in for loops that type checked so byond would do that all at
once
* `get_zlevel_turf_lists()` - returns the area's zlevel lists of lists
but only for non-empty zlevels. very useful for for loops.

The area contents unit test has been rewritten to ensure any improper
data triggers failures or runtimes by not having it use the helpers
above (some of which ensure a list is always returned) and access the
lists directly.
2024-01-18 12:16:12 -05:00
LemonInTheDark
a823708054 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>
2023-10-21 20:44:18 +01:00
LemonInTheDark
b77fa8c2a2 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
/🆑
2023-10-17 13:19:12 -06:00
Time-Green
42543ac141 NEW STATION TRAIT: Radioactive Nebula (#76825)
## About The Pull Request

Adds a new station trait: Radioactive Nebula!

The station is located inside a radioactive nebula. Space background and
lighting is different shades of green. Objects in space will also glow
green. (This is kinda lying, since the glowing stuff isn't radioactive,
you just get an element that slowly irradiates you, though people and
certain objects that get the 'IRRADIATED' status may still double-whammy
you)

Do not go into space without rad-protected gear, or you will get very
sick very fast. RAD-protection MODsuit modules spawn in robotics and are
also immediately researched.

The nebula does protect against external threats, like pirates, ninja's
and nukies. They can still get to the station pretty well, but they
can't stay in space for extended periods of time

To make it more livable, public rad protection gear will spawn in
lockers around the station. Everyone will also spawn with potassium
iodide pills in their emergency box. Dynamics threat is also reduced by
30, so there's a proclivity towards more lower threat rounds when the
radioactive nebula is present. Radioactive resonance virus cannot be
generated though, since it kinda obliterates any and all challenge and
threat


![image](https://github.com/tgstation/tgstation/assets/7501474/8eedcb85-1bb8-4e87-a794-d6781fee680d)

**Shielding**


![image](https://github.com/tgstation/tgstation/assets/7501474/ae1b25d7-6fbd-4a86-8c95-5947b1122632)

In order to protect the station from radiation, nebula shielding units
need to be constructed. Five spawn ready-to-built in engineering, and
more can be bought pretty cheap from cargo. (Normal radstorms are
disabled)

The gravity generator has 20 minutes of innate shielding, where every
nebula shielding unit adds another 20 minutes. 5 are needed to
completely block all radiation even when the gravity gen is down, but
constructing more is recommended in-case of sabotage/destructions/power
outtages.

Active nebula shielding will passively generate tritium. You can either
vent/ignore this, or use it for something. I'm not an atmos tech but I'm
sure you can do something with it

_What happens when no shielding units are constructed/they all fail?_
The station will suffer a 5 minute long radiation storm, with only
shuttles being excempt. The storm is nerfed strongly, and you can tank
the 5 minutes, but you'll be pretty sick. After the 5 minutes are over,
central command will send an emergency shielding unit which will block
the radiation for 10 minutes and warn the station to set up nebula
shielding.


## Why It's Good For The Game
The station being inside a radioactive nebula shakes up a pretty major
aspect of the game (that being the 'space' in space station 13). Hallway
decals are colored green, display screens will display radiation
markings, carps blend with the nebula, etc. Putting the station inside a
radioactive nebula shakes up the rules of the game and what people can
expect. Suddenly, you can no longer just go outside without taking meds
or getting proper radiation protection, encouraging people to stay cozy
and inside.


![image](https://github.com/tgstation/tgstation/assets/7501474/40112936-8514-47f7-b3e0-b1c782b6a0a6)

Inside, the crew gets the goal to set-up radiation shielding to defend
themselves against the nebula, rewarding a creative engineering
department with passive resource income and protecting the station
against massive radiation storms. I think it's nice to give engineering
something to set up. Even if they don't care, they can just plop it down
somewhere in a closed room and be done with it.

The radiation storm is pretty aggressive, but very survivable if you use
your potassium iodide pills, the extra radiation suits or whatever
chemistry has whipped up.

Most importantly, it gives the entire station a common enemy: the
nebula. Everyone is encouraged to prepare against the mechanics.
Chemistry can make meds, viro can make protective virusses, robotics
gets encouraged to make radprotected MODsuits, engineering gets to
set-up radiation shielding, assistants can look at space or whatever
assistants do.


<details>
  <summary>Cool images</summary>


![image](https://github.com/tgstation/tgstation/assets/7501474/387f2d75-8ba6-425b-8f0f-9423cf7aab19)


![image](https://github.com/tgstation/tgstation/assets/7501474/eb65de97-13ce-4ce9-8902-4144994d217f)


![image](https://github.com/tgstation/tgstation/assets/7501474/60b915a5-8549-4a3b-afe6-f0e823207883)


![image](https://github.com/tgstation/tgstation/assets/7501474/239ae614-8d26-4b77-936f-1d2baa38d32c)

  
</details>

## Changelog

🆑
add: Adds a new rare radioactive nebula station trait! Get ready and
PREPARE, before it gets in...
tweak: Nearstation space area lighting may look slightly different
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: Jacquerel <hnevard@gmail.com>
2023-07-21 16:51:15 +01:00
LemonInTheDark
41f20bc3ce [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>
2023-07-19 04:39:55 +00:00
LemonInTheDark
4d1e34322f 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
2023-07-05 18:31:27 -06:00
ChungusGamer666
b9b19bd6e1 Lighting object oddities (#76009)
## About The Pull Request

Fire stacks status effect no longer uses a weakref for the mob light, I
am pretty sure there was no real reason to use a weakref there.
Deleted weird luminescent glow dummy, now it just uses the standard
moblight obj.
Put all /obj/effect/dummy/lighting_obj together in a single file and
added a comment explaining why they exist.

(I severely dislike the /obj/effect/dummy typepath, but I am very much
unsure if just replacing all of them with /obj/effect/abstract would
break shit)

## Why It's Good For The Game

Code organization good
2023-06-20 06:08:29 +00:00
SyncIt21
cd4ed228f2 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>
2023-05-24 11:29:56 -07:00
SyncIt21
42d8836d95 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>
2023-04-24 11:37:36 -06:00
san7890
ccef887efe Lints Against Unmanaged Local Defines (#74333)
# MAINTAINER - USE THE BUTTON THAT SAYS "MERGE MASTER" THEN SET THE PR
TO AUTO-MERGE! IT'S MUCH EASIER FOR ME TO FIX THINGS BEFORE THEY SKEW
RATHER THAN AFTER THE FACT.

## About The Pull Request

Hey there,

This took a while to do, but here's the gist:

Python file now regexes every file in `/code` except for those that have
some valid reason to be tacking on more global defines. Some of those
reasons are simply just that I don't have the time right now (doing what
you see in this PR took a few hours) to refactor and parse what should
belong and what should be thrown out. For the time being though, this PR
will at least _halt_ people making the mistake of not `#undef`ing any
files they `#define` "locally", or within the scope of a file.

Most people forget to do this and this leads to a lot of mess later on
due to how many variables can be unmanaged on the global level. I've
made this mistake, you've made this mistake, it's a common thing. Let's
automatically check for it so it can be fixed no-stress.

Scenarios this PR corrects:

* Forgetting to undef a define but undeffing others.
* Not undeffing any defines in your file.
* Earmarking a define as a "file local" define, but not defining it.
* Having a define be a "file local" define, but having it be used
elsewhere.
* Having a "local" define not even be in the file that it only shows up
in.
* Having a completely unused define*

(* I kept some of these because they seemed important... Others were
junked.)
## Why It's Good For The Game

If you wanna use it across multiple files, no reason to not make it a
global define (maybe there's a few reasons but let's assume that this is
the 95% case).

Let me know if you don't like how I re-arranged some of the defines and
how you'd rather see it be implemented, and I'd be happy to do that.
This was mostly just "eh does it need it or not" sorta stuff.

I used a pretty cool way to detect if we should use the standardized
GitHub "error" output, you can see the results of that here
https://github.com/san7890/bruhstation/actions/runs/4549766579/jobs/8022186846#step:7:792
## Changelog
Nothing that really concerns players.

(I fixed up all this stuff using vscode, no regexes beyond what you see
in the python script. sorry downstreams)
2023-03-29 10:17:03 -07:00
LemonInTheDark
8982828d05 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
/🆑
2023-03-27 22:34:13 -07:00
LemonInTheDark
069bd12e26 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
/🆑
2023-02-23 23:51:29 -07:00
LemonInTheDark
a2295b2b04 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
2023-02-15 18:36:53 -07:00
LemonInTheDark
f88edef0fb Space/Changeturf fixes and optimizations (#73261)
## About The Pull Request

We've got a few space related things that are busted, and shuttle
movement is slow.
I'd like to try to improve these things, if just a bit.

Long list of only tenuously related topics. Sorry for the shotgun blast

#### [Fixes lazyloaded stuff having bad
space](d4de176a63)

We need to handle area transferring in maploading code under niche
cases, and we also need to actually init reservation spaces we create.

It's also redundant and potentially dupe creating to do area lighting
handling in changeturf, because it gets touched in turf init anyway. Old
me is stupid.

#### [Adds some doc comments, yeets
ssmappping/transit](269717145d)

We had a reserved space for just shuttles to use, except it wasn't for
just shuttles.
So in theory if the space got clogged with other shit, the shuttles
could have nowhere to actually use.

It's better to just have the two groups share real estate. More sane

### The "Starlight is Slow" Block

#### [Starlight optimization part one (don't check config for each
individual turf you check for
activity)](7312a314be)

#### [Starlight optimization part two (infer
context)](be94c422ed)

Starlight was causing each space turf to cause itself and its neighbor
to constantly recheck if they had starlight off changeturf.

The exact same effect can be had by taking advantage of some
pre-existing information, namely if the space turf is gaining or losing
a source of starlight.
Essentially, instead of telling a turf to check all adjacent turfs to
see if it's got starlight, we tell the turf if WE are a source of
starlight, or if we might be taking something away from it.

There's a bit of wasted cpu here but not much, if it's worth doing a
register signal pattern for clearing depends on the case we're working
with.

Being intelligent about this makes things much faster, something in the
neighborhood of 4 to 3 fold.
I've also made openspace's starlight work better, cause the old pattern
was a bit silly.

### Changeturf is Annoying (Microops)

#### [Micro ops changeturf and turf deletion a
bit](386b3ab7fc)

Don't do work if the thing you're working on doesn't exist, don't check
every adjacent turf for firelocks on turf change (just have thefirelocks
manage that), don't check all atoms on the turf for decals on turf
change, similar.
Also moves visibility changes from camera code into changeturf, to avoid
unneeded work.

Needs some extra work to optimize the guts for this path but I can do
that!

#### [Micros camera vis
changes](ebab69e9ea)

We should only update vis when our opacity changes. 
In addition, we don't need all the camera handling fluff if we only want
to update our turf's static groups.

Also micros a camera net helper to be less crap for non multiz maps

#### [Micros some open space atmos cases, alongside avoiding a for(null)
in opacity
handling](72ae07ba1d)

#### [Ensures space_lit tiles never accidentially inherit lighting
objects](a99ff2265a)

S dumb, and leads to space turfs having two sources of lighting, which
looks wrong.
This was invisible when their lighting was fullbright, but it sucks now.


### Misc Stuff

#### [Cleans up stat tracking a bit to avoid
collisions](40fb8f21e2)

#### [Cleans up a turf helper to not be
stupid](bf4ee67100)

WHY ARE YOU USING THE RANGED TURF HELPER IF YOU GO ONE TILE

#### [Moves transit turf signal cleanup to destroy, I named this proc
wrong](c85c2cfc86)

I'm sorry @Time-Green 

#### [Adds better transit caching to
shuttles](35e85334c4)

Adds a max reserved transit size to the shuttle subsystem, to keep
things in bounds.
In addition, adds a soft cap under which existing transit space will get
hold onto, to make repeated non escape/arrive shuttle movements faster

Hopefully this makes common shuttle moves less bad.
## Why It's Good For The Game

Speed
2023-02-06 23:04:50 -05:00
LemonInTheDark
e9c87c0acb 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>
2023-01-31 09:52:27 +00:00
ChungusGamer666
a2479cb48e Static light sources will attempt to follow the top atom (#72148)
## About The Pull Request

Fixes https://github.com/tgstation/tgstation/issues/71826
Probably fixes some other issue related to lighting but i didn't find
any

## Why It's Good For The Game

Look, i know it's called STATIC lighting for a reason, and movement on
it should be kept to a minimum, but this at least ensure that static
lighting being carried around, if that happens for some reason, updates
properly.

## Changelog

🆑
fix: Static light sources update properly now when carried by a mob.
/🆑
2022-12-31 01:57:30 -08:00
LemonInTheDark
9e69e5d6ac 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
2022-12-19 11:34:03 +01:00
AnturK
84f69359a0 More horrible 515 proc compatibility. (#71333)
So i left over some basic `/whatever/proc/format` uses in the original
PR this fixes it.

Notable exceptions to the rule:
- Paths in add_verb/remove_verb, we need full path instead of a name
there to access verb metadata so we can't use proc ref macros there.
- regex.Replace, found out that it does not accept call by name. Instead
i added new REGEX_REPLACE_HANDLER so we can at least try to mark these.

There's still leftover global procs that do not use GLOBAL_PROC_REF but
they functionally equivalent so that's for later.

I don't see any reasonable way to grep for this. But if you got any
ideas please share.
2022-11-22 07:55:43 +00:00
AnturK
4d6a8bc537 515 Compatibility (#71161)
Makes the code compatible with 515.1594+

Few simple changes and one very painful one.
Let's start with the easy:
* puts call behind `LIBCALL` define, so call_ext is properly used in 515
* Adds `NAMEOF_STATIC(_,X)` macro for nameof in static definitions since
src is now invalid there.
* Fixes tgui and devserver. From 515 onward the tmp3333{procid} cache
directory is not appened to base path in browser controls so we don't
check for it in base js and put the dev server dummy window file in
actual directory not the byond root.
* Renames the few things that had /final/ in typepath to ultimate since
final is a new keyword

And the very painful change:
`.proc/whatever` format is no longer valid, so we're replacing it with
new nameof() function. All this wrapped in three new macros.
`PROC_REF(X)`,`TYPE_PROC_REF(TYPE,X)`,`GLOBAL_PROC_REF(X)`. Global is
not actually necessary but if we get nameof that does not allow globals
it would be nice validation.
This is pretty unwieldy but there's no real alternative.
If you notice anything weird in the commits let me know because majority
was done with regex replace.

@tgstation/commit-access Since the .proc/stuff is pretty big change.

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-11-15 03:50:11 +00:00
LemonInTheDark
5b4ba051a0 Builds logic that manages turfs contained inside an area (#70966)
## About The Pull Request

Area contents isn't a real list, instead it involves filtering
everything in world
This is slow, and something we should have better support for.

So instead, lets manage a list of turfs inside our area. This is simple,
since we already move turfs by area contents anyway

This should speed up the uses I've found, and opens us up to using this
pattern more often, which should make dev work easier.

By nature this is a tad fragile, so I've added a unit test to double
check my work

Rather then instantly removing turfs from the contained_turfs list, we
enter them into a list of turfs to pull out, later.
Then we just use a getter for contained_turfs rather then a var read

This means we don't need to generate a lot of usage off removing turf by
turf from space, and can instead do it only when we need to

I've added a subsystem to manage this process as well, to ensure we
don't get any out of memory errors. It goes entry by entry, ensuring we
get no overtime.
This allows me to keep things like space clean, while keeping high
amounts of usage on a sepearate subsystem when convienient

As a part of this goal of keeping space's churn as low as possible, I've
setup code to ensure we do not add turfs to areas during a z level
increment adjacent mapload. this saves a LOT of time, but is a tad
messy

I've expanded where we use contained_turfs, including into some cases
that filter for objects in areas. need to see if this is sane or not.

Builds sortedAreas on demand, caching until we mark the cache as
violated

It's faster, and it also has the same behavior

I'm not posting speed changes cause frankly they're gonna be a bit
scattered and I'm scared to.
@Mothblocks if you'd like I can look into it. I think it'll pay for
itself just off `reg_in_areas_in_z` (I looked into it. it's really hard
to tell, sometimes it's a bit slower (0.7), sometimes it's 2 seconds
(0.5 if you use the old master figure) faster. life is pain.)

## Why It's Good For The Game

Less stupid, more flexible, more speed

Co-authored-by: san7890 <the@san7890.com>
2022-11-04 20:13:54 -07:00
GoblinBackwards
2c544a1959 Fixes compile error in lighting code when testing mode is enabled (#70550)
* Fixes compile error in lighting code when compiling with testing mode enabled, because it was using a var that wasn't yet defined.
2022-10-16 21:46:38 -04:00
LemonInTheDark
23bfdec8f4 Multiz Rework: Human Suffering Edition (Contains PLANE CUBE) (#69115)
About The Pull Request

I've reworked multiz. This was done because our current implementation of multiz flattens planes down into just the openspace plane. This breaks any effects we attach to plane masters (including lighting), but it also totally kills the SIDE_MAP map format, which we NEED for wallening (A major 3/4ths resprite of all wall and wall adjacent things, making them more then one tile high. Without sidemap we would be unable to display things both in from of and behind objects on map. Stupid.)

This required MASSIVE changes. Both to all uses of the plane var for reasons I'll discuss later, and to a ton of different systems that interact with rendering.

I'll do my best to keep this compact, but there's only so much I can do. Sorry brother.
Core idea

OK: first thing.
vis_contents as it works now squishes the planes of everything inside it down into the plane of the vis_loc.
This is bad. But how to do better?

It's trivially easy to make copies of our existing plane masters but offset, and relay them to the bottom of the plane above. Not a problem. The issue is how to get the actual atoms on the map to "land" on them properly.

We could use FLOAT_PLANE to offset planes based off how they're being seen, in theory this would allow us to create lens for how objects are viewed.
But that's not a stable thing to do, because properly "landing" a plane on a desired plane master would require taking into account every bit of how it's being seen, would inherently break this effect.

Ok so we need to manually edit planes based off "z layer" (IE: what layer of a z stack are you on).

That's the key conceit of this pr. Implementing the plane cube, and ensuring planes are always offset properly.
Everything else is just gravy.
About the Plane Cube

Each plane master (except ones that opt out) is copied down by some constant value equal to the max absolute change between the first and the last plane.
We do this based off the max z stack size detected by SSmapping. This is also where updates come from, and where all our updating logic will live.

As mentioned, plane masters can choose to opt out of being mirrored down. In this case, anything that interacts with them assuming that they'll be offset will instead just get back the valid plane value. This works for render targets too, since I had to work them into the system as well.

Plane masters can also be temporarily hidden from the client's screen. This is done as an attempt at optimization, and applies to anything used in niche cases, or planes only used if there's a z layer below you.
About Plane Master Groups

BYOND supports having different "maps" on screen at once (IE: groups of items/turfs/etc)
Plane masters cannot cover 2 maps at once, since their location is determined by their screen_loc.
So we need to maintain a mirror of each plane for every map we have open.

This was quite messy, so I've refactored it (and maps too) to be a bit more modular.

Rather then storing a list of plane masters, we store a list of plane master group datums.
Each datum is in charge of the plane masters for its particular map, both creating them, and managing them.

Like I mentioned, I also refactored map views. Adding a new mapview is now as simple as newing a /atom/movable/screen/map_view, calling generate_view with the appropriate map id, setting things you want to display in its vis_contents, and then calling display_to on it, passing in the mob to show ourselves to.

Much better then the hardcoded pattern we used to use. So much duplicated code man.

Oh and plane master controllers, that system we have that allows for applying filters to sets of plane masters? I've made it use lookups on plane master groups now, rather then hanging references to all impacted planes. This makes logic easier, and prevents the need to manage references and update the controllers.

image

In addition, I've added a debug ui for plane masters.
It allows you to view all of your own plane masters and short descriptions of what they do, alongside tools for editing them and their relays.

It ALSO supports editing someone elses plane masters, AND it supports (in a very fragile and incomplete manner) viewing literally through someone else's eyes, including their plane masters. This is very useful, because it means you can debug "hey my X is yorked" issues yourself, on live.

In order to accomplish this I have needed to add setters for an ungodly amount of visual impacting vars. Sight flags, eye, see_invis, see_in_dark, etc.

It also comes with an info dump about the ui, and plane masters/relays in general.

Sort of on that note. I've documented everything I know that's niche/useful about our visual effects and rendering system. My hope is this will serve to bring people up to speed on what can be done more quickly, alongside making my sin here less horrible.
See https://github.com/LemonInTheDark/tgstation/blob/multiz-hell/.github/guides/VISUALS.md.
"Landing" planes

Ok so I've explained the backend, but how do we actually land planes properly?
Most of the time this is really simple. When a plane var is set, we need to provide some spokesperson for the appearance's z level. We can use this to derive their z layer, and thus what offset to use.

This is just a lot of gruntwork, but it's occasionally more complex.
Sometimes we need to cache a list of z layer -> effect, and then use that.
Also a LOT of updating on z move. So much z move shit.

Oh. and in order to make byond darkness work properly, I needed to add SEE_BLACKNESS to all sight flags.
This draws darkness to plane 0, which means I'm able to relay it around and draw it on different z layers as is possible. fun darkness ripple effects incoming someday

I also need to update mob overlays on move.
I do this by realiizing their appearances, mutating their plane, and then readding the overlay in the correct order.

The cost of this is currently 3N. I'm convinced this could be improved, but I've not got to it yet.
It can also occasionally cause overlays to corrupt. This is fixed by laying a protective ward of overlays.Copy in the sand, but that spell makes the compiler confused, so I'll have to bully lummy about fixing it at some point.
Behavior changes

We've had to give up on the already broken gateway "see through" effect. Won't work without managing gateway plane masters or something stupid. Not worth it.
So instead we display the other side as a ui element. It's worse, but not that bad.

Because vis_contents no longer flattens planes (most of the time), some uses of it now have interesting behavior.
The main thing that comes to mind is alert popups that display mobs. They can impact the lighting plane.
I don't really care, but it should be fixable, I think, given elbow grease.

Ah and I've cleaned up layers and plane defines to make them a bit easier to read/reason about, at least I think.
Why It's Good For The Game
<visual candy>

Fixes #65800
Fixes #68461
Changelog

cl
refactor: Refactored... well a lot really. Map views, anything to do with planes, multiz, a shit ton of rendering stuff. Basically if you see anything off visually report it
admin: VV a mob, and hit View/Edit Planes in the dropdown to steal their view, and modify it as you like. You can do the same to yourself using the Edit/Debug Planes verb
/cl
2022-09-27 20:11:04 +13:00
LemonInTheDark
e5a2b0f16e Micros the lighting subsystem (Saves a second of init) (#69838)
About The Pull Request

Micros lighting objects, and their creation

We save a good bit of time by not walking space turfs adjacent to new objects.
We also save some time with micros in the actual underlay update logic.

I swear dude we spend like 0.8 seconds of init applying the underlay. I want threaded maptick already

Micros lighting sources, and corner creation

A: Corners were being passed just A turf, and then expected to generatecorners based on that. This is pointless.
It is better to instead pass in the coords of the bottom left turf, and then build in a circle. This saves like 0.3 seconds

B: We use so many damn datum vars in corner application that we just do not need to.
This resolves that, since it pissed me off. It's pointless. Lets cache em instead

There's some misc datum var caching going on here too. Lemme see...
Oh and a bit of shortcutting for a for loop, since it was a tad expensive on its own.

Also I removed the turfs list, because it does fucking nothing. Why is this still here.

All my little optimizations save about 1 second of init I think
Not great, but not bad, and plus actual lighting work is faster now too
Why It's Good For The Game

Speed
2022-09-27 09:56:35 +13:00
LemonInTheDark
b01356b80d 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
2022-08-30 01:28:44 -07:00
Kylerace
fe7513d282 addresses reviews on the tram pr made after merge, fixes diagonal movement bugs (#68033) 2022-07-16 21:44:41 -07:00
Kylerace
8f0df7816b (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 (#66657)
ever see the tram take 10 milliseconds per movement to move 2100 objects? now you have
https://user-images.githubusercontent.com/15794172/166198184-8bab93bd-f584-4269-9ed1-6aee746f8f3c.mp4
About The Pull Request

fixes #66887

done for the code bounty posted by @MMMiracles to optimize the tram so that it can be sped up. the tram is now twice as fast, firing every tick instead of every 2 ticks. and is now around 10x cheaper to move. also adds support for multiz trams, as in trams that span multiple z levels.

the tram on master takes around 10-15 milliseconds per movement with nothing on it other than its starting contents. why is this? because the tram is the canary in the coal mines when it comes to movement code, which is normally expensive as fuck. the tram does way more work than it needs to, and even finds new ways to slow the game down. I'll walk you through a few of the dumber things the tram currently does and how i fixed them.

    the tram, at absolute minimum, has to move 55 separate industrial_lift platforms once per movement. this means that the tram has to unregister its entered/exited signals 55 times when "the tram" as a singular object is only entering 5 new turfs and exiting 5 old turfs every movement, this means that each of the 55 platforms calculates their own destination turfs and checks their contents every movement. The biggest single optimization in this pr was that I made the tram into a single 5x11 multitile object and made it only do entering/exiting checks on the 5 new and 5 old turfs in each movement.
    way too many of the default tram contents are expensive to move for something that has to move a lot. fun fact, did you know that the walls on the tram have opacity? do you know what opacity does for movables? it makes them recalculate static lighting every time they move. did you know that the tram, this entire time, was taking JUST as much time spamming SSlighting updates as it was spending time in SStramprocess? well it is! now it doesnt do that, the walls are transparent. also, every window and every grille on the tram had the atmos_sensitive element applied to them which then added connect_loc to them, causing them to update signals every movement. that is also dumb and i got rid of that with snowflake overrides. Now we must take care to not add things that sneakily register to Moved() or the moved signal to the roundstart tram, because that is dumb, and the relative utility of simulating objects that should normally shatter due to heat and conduct heat from the atmosphere is far less than the cost of moving them, for this one object.
    all tram contents physically Entered() and Exited() their destination and old turfs every movement, even though because they are on a tram they literally do not interact with the turf, the tram does. also, any objects that use connect_loc or connect_loc behalf that are on the same point on the tram also interact with each other because of this. now all contents of the tram act as if theyre being abstract_move()'d to their destination so that (almost) nothing thats in the destination turf or the exit turf can react to the event of "something laying on the tram is moving over you". the rare things that DO need to know what is physically entering or exiting their turf regardless of whether theyre interacting with the ground can register to the abstract entered and exited signals which are now always sent.
    many of the things hooked into Moved(), whether it be overrides of Moved() itself, or handlers for the moved signal, add up to a LOT of processing time. especially for humans. now ive gotten rid of a lot of it, mostly for the tram but also for normal movement. i made footsteps (a significant portion of human movement cost) not do any work if the human themselves didnt do the movement. i optimized has_gravity() a fair amount, and then realized that since everything on the tram isnt changing momentum, i didnt actually need to check gravity for the purposes of drifting (newtonian_move() was taking a significant portion of the cost of movement at some points along the development process). so now it simply doesnt call newtonian_move() for movements that dont represent a change in momentum (by default all movements do).

also i put effort into 1. better organizing tram/lift code so that most of it is inside of a dedicated modules folder instead of scattered around 5 generic folders and 2. moved a lot of behavior from lift platforms themselves into their lift_master_datum since ideally the platforms would just handle moving themselves, while any behavior involving the entire lift such as "move to destination" and "blow up" would be handled by the lift_master_datum.

also
https://user-images.githubusercontent.com/15794172/166220129-ff2ea344-442f-4e3e-94f0-ec58ab438563.mp4
multiz tram (this just adds the capability to map it like this, no tram does this)
Actual Performance Differences

to benchmark this, i added a world.Profile(PROFILER_START) and world.Profile(PROFILER_START) to the tram moving, so that it generates a profiler output of all tram movement without any unrelated procs being recorded (except for world.Profile() overhead). this made it a lot easier to quantify what was slowing down both the tram and movement in general. and i did 3 types of tests on both master and my branch.

also i should note that i sped up the "master" tram test to move once per tick as well, simply because the normal movement speed seems unbearably slow now. so all recorded videos are done at twice the speed of the real tram on master. this doesnt affect the main thing i was trying to measure: cost for each movement.

the first test was the base tram, containing only my player mob and the movables starting on the tram roundstart. on master, this takes around 13 milliseconds or so on my computer (which is pretty close to what it takes on the servers), on this branch, it takes between 0.9-1.3 milliseconds.

ALSO in these benchmarks youll see that tram/proc/travel() will vary significantly between the master and optimized branches. this is 100% because there are 55 times more platforms moving on master compared to the master branch, and thus 55x more calls to this proc. every test was recorded with the exact same amount of distance moved

here are the master and optimized benchmark text files:
master
master base tram.txt
https://user-images.githubusercontent.com/15794172/166210149-f118683d-6f6d-4dfb-b9e4-14f17b26aad8.mp4
also this shows the increased SSlighting usage resulting from the tram on master spamming updates, which doesnt happen on the optimized branch

optimized
optimization base tram.txt
https://user-images.githubusercontent.com/15794172/166206280-cd849aaa-ed3b-4e2f-b741-b8a5726091a9.mp4

the second test is meant to benchmark the best case scaling cost of moving objects, where nothing extra is registered to movement besides the bare minimum stuff on the /atom/movable level. Each of the open tiles of the tram had 1 bluespace rped filled with parts dumped onto it, to the point that the tram in total was moving 2100 objects. the vast majority of these objects did nothing special in movement so they serve as a good base case. only slightly off due to the rped's registering to movement.

on master, this test takes over 100 milliseconds per movement
master 2000 obj's.txt
https://user-images.githubusercontent.com/15794172/166210560-f4de620d-7dc6-4dbd-8b61-4a48149af707.mp4

when optimized, about 10 milliseconds per movement
https://user-images.githubusercontent.com/15794172/166208654-bc10086b-bbfc-49fa-9987-d7558109cc1d.mp4
optimization 2000 obj's.txt

the third test is 300 humans spawned onto the tram, meant to test all the shit added on to movement cost for humans/carbons. in retrospect this test is actually way too biased in favor of my optimizations since the humans are all in only 3 tiles, so all 100 humans on a tile are reacting to the other 99 humans movements, which wouldnt be as bad if they were distributed across 20 tiles like in the second test. so dont read into this one too hard.

on master, this test takes 200 milliseconds
master 300 catgirls.txt

when optimized, this takes about 13-14 milliseconds.
optimization 300 catgirls on ram ranch.txt
Why It's Good For The Game

the tram is literally 10x cheaper to move. and the code is better organized.
currently on master the tram is as fast as running speed, meaning it has no real relative utility compared to just running the tracks (except for the added safety of not having to risk being ran over by the tram). now the tram of which we have an entire map based around can be used to its full potential.

also, has some fixes to things on the tram reacting to movement. for example on master if you are standing on a tram tile that contains a banana and the TRAM moves, you will slip if the banana was in that spot before you (not if you were there first however). this is because the banana has no concept of relative movement, you and it are in the same reference frame but the banana, which failed highschool physics, believes you to have moved onto it and thus subjected you to the humiliation of an unjust slipping. now since tram contents that dont register to abstract entered/exited cannot know about other tram contents on the same tile during a movement, this cannot happen.

also, you no longer make footstep sounds when the tram moves you over a floor
TODO

mainly opened it now so i can create a stopping point and attend to my other now staling prs, we're at a state of functionality far enough to start testmerging it anyways.

add a better way for admins to be notified of the tram overloading the server if someone purposefully stuffs it with as much shit as they can, and for admins to clear said shit.
automatically slow down the tram if SStramprocess takes over like, 10 milliseconds complete. the tram still cant really check tick and yield without introducing logic holes, so making sure it doesnt take half of the tick every tick is important
go over my code to catch dumb shit i forgot about, there always is for these kinds of refactors because im very messy
remove the area based forced_gravity optimization its not worth figuring out why it doesnt work
fix the inevitable merge conflict with master lol
create an icon for the tram_tunnel area type i made so that objects on the tram dont have to enter and exit areas twice in a cross-station traversal

    add an easy way to vv tram lethality for mobs/things being hit by it. its an easy target in another thing i already wanted to do: a reinforced concept of shared variables from any particular tram platform and the entire tram itself. admins should be able to slow down the tram by vv'ing one platform and have it apply to the entire tram for example.

Changelog

cl
balance: the tram is now twice as fast, pray it doesnt get any faster (it cant without raising world fps)
performance: the tram is now about 10 times cheaper to move for the server
add: mappers can now create trams with multiple z levels
code: industrial_lift's now have more of their behavior pertaining to "the entire lift" being handled by their lift_master_datum as opposed to belonging to a random platform on the lift.
/cl
2022-06-24 13:42:09 +12:00
LemonInTheDark
a6d4e180ad 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
2022-06-18 19:50:18 -05:00
ShizCalev
a85d7c6974 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.
2022-03-30 13:25:05 +01:00
Seth Scherer
868b4cb316 Renames the change_area proc to be more accurate (#65758) 2022-03-29 15:03:37 -07:00
AffectedArc07
0d9a49503a Fixes bugged lighting overlays on dark tiles (#63171) 2021-12-02 13:48:17 -08:00
John Willard
88d7dbfc10 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.
2021-10-28 19:25:50 -03:00
Wayland-Smithy
56529dea50 Fix base lighting appearance inheritance (#62042) 2021-10-12 00:02:45 -07:00
TiviPlus
e060c7eedc fix lighting (#61530) 2021-09-19 03:21:19 -07:00
TiviPlus
519a15032e Default Baselighting to white (#61544) 2021-09-19 03:18:24 -07:00
Timberpoes
cbc6f35f54 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.
2021-09-18 17:29:55 +01:00
TiviPlus
7dff58205c var/static_lighting proper varedit support (#61164)
per title it creates/destroys the lighting objects now
2021-09-08 21:03:43 +01:00
TemporalOroboros
a71327e028 Reduces copypasta in emissive code (#61249)
Implements a helper proc for generating emissive blockers.
Makes everything that generates an emissive blocker overlay use the new helper.
Grants all emissive blockers and emissive overlays KEEP_APART, RESET_COLOR, and RESET_TRANSFORM.
Also fixes the jack-o-lantern worn overlays so that they actually glow while they are active.
2021-09-07 16:15:02 +01:00
TiviPlus
e629c36feb Refactor area and turf lighting (#60954) 2021-08-25 15:07:38 -07:00
TiviPlus
efb04ce04e Only blend areas when it's actually needed (#60237)
* Only blend areas when it's actually needed

* Respect varedits
2021-07-16 20:09:43 -07:00
Kylerace
d3a1bea859 Turns lighting objects into a datum, makes all lighting be performed with an underlay. big maptick fix very good! (#58991)
credit to zewaka for the idea of using underlays

turns the lighting object movables that were unnecessary and increased maptick into a datum which then applies and removes an underlay in update(). also applies a lot of general lighting clean ups (mostly using as anything in loops and fixing single letter var names).

multiz is a little different by necessity, now only the bottom turf's lighting matters in the brightness of the top turf unlike master where the bottom turf's lighting object is hidden from the vis_contents of the top turf. there are still some kinks to iron out here though, since currently objects suspended in openspace (like tram platforms) look bad and glass floors look bad too

only thing i have left to do is make multiz work (well)

UPDATE: multiz now appears the same as far as i can tell, its possible there are other situations in which its different but datum mats work and it automatically updates if the turf below changes. now i just need to make the system less finnicky if at all possible (and possibly merge managed_turf_vis_content with managed_overlays maybe?)

new update: its basically equivalent to normal multiz as far as i can tell (visually at least, in the circumstances ive tested so far)

NEW NEW UPDATE: turfs no longer have the VIS_HIDE vis_flag and multiz works without stacking the lighting from the floor below! so this shouldnt have any overt drawbacks to master anymore

1 needless movable per tile is terrible for maptick. this is probably a larger improvement than my emissive blocker change in terms of maptick. im guessing we'd get around 0.6 average maptick per player after this where currently we get 0.85 or so

Edit: according to lemon, sybil reached 0.71 maptick per person when tm'd with this

if this is a big enough improvement i might finally be able to get rid of the Gone discord avatar
2021-06-12 21:37:29 -07:00