Commit Graph

17 Commits

Author SHA1 Message Date
SmArtKar
79fae4eda2 Fixes weird pipe/vent/cable rendering under glass and catwalk floors (#91454)
## About The Pull Request

Changes some logic in underfloor object and atmos component rendering to
make them look nicer when visible, but not accessible under floors. Also
changes how catwalks get rendered to improve their visuals when opened.

Before:


![image](https://github.com/user-attachments/assets/217070c6-3df7-4a25-8e83-557601f87d36)

After:


![image](https://github.com/user-attachments/assets/e568176f-c116-4a30-8212-6c6b879ed847)

## Why It's Good For The Game

Makes pipes look less shit. The rendering curse reigns eternal.

## Changelog
🆑
fix: Fixed vents and pipes partially poking out from under glass and
catwalk floors
/🆑
2025-06-08 16:03:18 +00:00
SmArtKar
0ac282f03f Fixes spiderwebs, alien weeds, kudzu, and other stuff layering below catwalks and glass floors (#89893)
## About The Pull Request

Vents/scrubbers look a bit weird as their pipes still go above
catwalks/glass floors but I need my stuff from #89702 and it should be
atomized from this PR.

Closes #87022
Closes #88823

## Changelog
🆑
fix: Fixed spiderwebs, alien weeds, kudzu, and other stuff layering
below catwalks and glass floors
/🆑
2025-03-12 01:55:47 -07:00
fleur
4bfe9a71b6 Adds flatboxes, boxes that fit beneath tiles (#87229)
## About The Pull Request

This box type has a maximum of 3 slots, and can be hidden beneath
floortiles. It can be crafted by *jump emoting ontop of a regular, empty
box.


https://github.com/user-attachments/assets/d7ab52ec-2b47-4ab4-b2af-05ce00b0ae4b



https://github.com/user-attachments/assets/30dd5de3-1f4d-4cb4-8d9c-8625379e76bf

## Why It's Good For The Game
Hiding beneath tiles is a fun, yet not broken method of stowing
contraband. The toiletbasin or moisturizer trap remains a better option,
so I want to open up the space between the floorboards as quick
alternative for stowing or making cache drop-offs.

Smuggle satchels have a lot more going for them than their ability to be
hidden beneath tiles, so I don't feel like this is intruding on their
turf.
2024-11-03 23:47:37 -06:00
_0Steven
2ce8063930 Fixes catwalk rendering layering and catwalk pipe cap issues (#85236)
## About The Pull Request

Sooooooo this one's a mess.
First off, layering issues. Pipes, cables, and disposals currently
render over catwalks!

![image](https://github.com/user-attachments/assets/bfb6fc15-878c-4686-aace-57f0b9c6923a)
That's not great.

Looking into it, it seems we've moved the `CATWALK_LAYER` below the
`ABOVE_OPEN_TURF_LAYER`, where the catwalk layer is used for closed
catwalks.

33e983ced1/code/__DEFINES/layers.dm (L148-L150)
Which, well, we've *also* made it so all `undertile` stuff gets rendered
at `ABOVE_OPEN_TURF_LAYER` when below a tile.
So! Naively! We swap those around! Easy peasy lemon squeezy.
```dm
 #define ABOVE_OPEN_TURF_LAYER (12 + TOPDOWN_LAYER) 
 #define CATWALK_LAYER (13 + TOPDOWN_LAYER) 
```
And hey! Well!

![image](https://github.com/user-attachments/assets/42d7a8f3-5c17-4039-a76b-dbd789432156)
It's progress!
But as we can see in the bottom right catwalk tile, something's not
rendering right when they're below the tile...

Well, time to take a closer look at our `undertile` element... aaaaaand
would you look at that:

74f9a43141/code/datums/elements/undertile.dm (L45-L48)
We're setting EVERYTHING to the `FLOOR_PLANE` at
`ABOVE_OPEN_TURF_LAYER`, even the stuff that was already on
`FLOOR_PLANE` with its own layer like disposals or cables.
Meaning, layering fuckery ensues, we can't see shit.

So? We just make it only do that when we're not already on the floor
plane.
```dm
	if(PLANE_TO_TRUE(source.plane) != FLOOR_PLANE)
		SET_PLANE_IMPLICIT(source, FLOOR_PLANE)
		source.layer = ABOVE_OPEN_TURF_LAYER
```
This solves it!

![image](https://github.com/user-attachments/assets/f930bd66-87eb-433e-8bf5-09706316ace4)
Progress!

![image](https://github.com/user-attachments/assets/f2f246a2-8524-4186-9ac3-07ac7dcf4288)
...Kind of.
The _layering_ is solved, but unscrewing and rescrewing them seems to
cause pipe caps to manifest out of nowhere!
This _sucks_ for debugging, y'know?
Anyhow, this is based on two different things: an order of operations
issue and catwalks just not being accounted for.

First off! Order of operations.
On `Initialize(...)`, the base `/obj/machinery/atmospherics` registers a
proc that updates pipe caps on `COMSIG_OBJ_HIDE`:

33e983ced1/code/modules/atmospherics/machinery/atmosmachinery.dm (L114-L115)
Meanwhile, `/obj/machinery/atmospherics/pipe`, adds the `undertile`
element on its `Initialize(...)`... AFTER calling the parent.

33e983ced1/code/modules/atmospherics/machinery/pipes/pipes.dm (L31-L35)
...Which then registers its own proc on `COMSIG_OBJ_HIDE`...

74f9a43141/code/datums/elements/undertile.dm (L26)
This meant that, well, the proc that generates the caps was being called
*before* undertile had a chance to chance to remove the
`TRAIT_UNDERFLOOR` trait... which pipe caps use to work out when to
generate.

33e983ced1/code/modules/atmospherics/machinery/atmosmachinery.dm (L650-L652)
So, we swap this around by moving both to a `setup_hiding()` proc which
allows the pipe to register its behaviours before calling the parent and
it register its, without needing to register it before calling the
parent `Initialize(...)`. Cause that's ugly.
Now we're generating pipe caps on catwalks!

But! That brings us perfectly to the next bit. Cause those pipe caps,
even if shown when the tile is open, look *ugly*.
Why, when we open a catwalk, are we having our pipes suddenly extend
onto the neighbouring tiles and catwalks and going down into them from
the top? Arguably, these should behave like they're below tiles, because
they logically are even if not technically so.
Well, actually, we already have a similar situation with bare plating.
It's not applying `TRAIT_UNDERFLOOR`, but also the pipe caps shouldn't
be behaving like they're above a tile, because that'd be ugly- and
that's what it does!

33e983ced1/code/modules/atmospherics/machinery/atmosmachinery.dm (L654-L655)
So, we just apply a second check there, `iscatwalkturf(...)`
```dm
	var/turf/node_turf = get_turf(node)
	if(isplatingturf(node_turf) || iscatwalkturf(node_turf))
		continue
```

And? Well!

![image](https://github.com/user-attachments/assets/f297136e-f62e-452b-b711-2f3b69462859)

![image](https://github.com/user-attachments/assets/a3f2df8b-3e22-4474-af32-7e858382f63f)

![image](https://github.com/user-attachments/assets/347a2c3b-8302-47b8-a376-41228fbe537a)
There we go! There's no weird layering, there's no pipe caps where there
shouldn't be, pipes behave like those on catwalks are actually under a
tile.
It looks _clean_.
...

Well, for however clean we can get it to be without making sprites for
the opened catwalks but without the integrated plating so we can make an
overlay and have the pipes/cables/disposals not spontaneously go over
the edges of the catwalk when opened. Or making the under sprites only
have the attachment points in the corners, so it looks like the
pipes/cables/disposals are going over plating instead of what looks like
a raised edge.
## Why It's Good For The Game

Fixes #84789.
Fixes #82622.
Screwing open a catwalk suddenly generating pipecaps on neighbouring
closed catwalks and tiles with pipes under them looks weird.
## Changelog
🆑
fix: Fixed pipes/cables/disposals rendering above closed catwalks.
fix: Fixed catwalks covering pipes generating illogical pipe caps when
screwed.
fix: Opened catwalks are no longer assumed to be above-floor for the
sake of generating pipe caps.
/🆑
2024-08-14 13:06:22 +02:00
LemonInTheDark
e90a9b4b68 Flattens The Floor Plane (Camera Update Too) (#84350)
## About The Pull Request

Ok so like, side map right? It makes things higher up in the world
render above things lower down in the world.

Most of the time this is what we want, but it is NOT what we want for
floors.
Floors are allowed to be larger then 32x32, and if they are we want them
to render based off JUST their layer.
If we don't allow this grass turfs and others get cut off on their
bottom edge, which looks WEIRD.

In order to make this happen, we can add TOPDOWN_LAYER to every layer on
the floor plane and disable sidemap.

I've added documentation for this to VISUALS.md, and have also
implemented unit test errors to prevent mixing TOPDOWN layers with non
topdown planes (or vis versa).
This new test adds ~1 second to tests, which is I think a perfectly
scrumpulent number.

EDIT:

I nerd sniped myself and implemented sidemap layering and lighting for
cameras (also larger then 32x32 icon support for getflat)
The lighting isn't perfect, we don't handle things displaying in the
void all that well (I am convinced getflat blending is broken but I have
no debugger so I can't fix it properly), but it'll do.

This came up cause I had to fix another layering issue in cameras and
thought I might as well go all in.

![image](https://github.com/tgstation/tgstation/assets/58055496/601b422c-f6aa-42ba-bcd9-b1faebe236e3)


## Why It's Good For The Game

Old:

![image](https://github.com/tgstation/tgstation/assets/58055496/d4102386-420d-4346-b05c-b819e62d98d0)

New:

![image](https://github.com/tgstation/tgstation/assets/58055496/1f5e303e-adee-427d-8fe3-76c8f2dbe098)


## Changelog
🆑
fix: Grass turfs will render properly now. Reworked how floors render,
please report any bugs!
fix: Cameras now properly capture lighting
fix: The layering seen in photos should better match the actual game
/🆑
2024-07-04 12:10:41 -07:00
Emmett Gaines
96d7e9c690 Invisibility refactor (#78908)
This adds a tracker for sources of invisibility and a priority system. I
needed this for another thing so I'm doing this first since it touches a
lot of code. As for the bugs fixed in the changelog, it's only what I
noticed while going through everything and there's likely a few more
things fixed with this. This should be testmerged for a while, I'll
bring this out of draft when it feels safe.

🆑
admin: Invisimin can now be used on mobs that are already invisible,
whether through temporary or permanent effects.
fix: Monkeyize/Humanize mob transformations no longer permanently reveal
invisible mobs if they had effects making them invisible otherwise.
fix: Objects with the undertile element that have been made invisible
through other means are no longer revealed by being uncovered.
/🆑
2023-10-17 13:07:31 -06:00
LemonInTheDark
daf55e611c Cleans up/renames as private some internal var definitions, removes some fucked uses of internal list vars (#75769)
## About The Pull Request

[Improves the documentation of DCS lists, removes old list of callback
docs that no longer
apply](c3821d9f5f)

[Adds a second signal register to decal rotating, adds a trait to
objects under a tile. STOP DIRECTLY READING HIDDEN LISTS I SWEAR TO
GOD](6b3f97a76a)

[Removes direct reads of the timer list, they were redundant
mostly](14fcd9f8a6)

[Please stop directly reading/modifying the traits list to ensure your
dna rot follows the
brain](ec0e5237ec)

[Marks internal datum lists as well internal with
_](57c6577ff6)

[57c6577](57c6577ff6)

Does the same to _clear_signal_refs() in hopes of keeping people from
touching it

## Why It's Good For The Game

They pissed me off.

Users should not be touching these lists, especially in ways that make
assumptions about their structure and are thus prone to breaking if that
ever changes.
Most of these are close to zero cost changes, using a wrapper to solve
the problem, or just yeeting it

Two aren't, Decals with a direction have gained a second signal register
on init, and things that sit underfloor (cables/pipes) now get a trait
when inserted there.

This should have a minimal impact on memory/init time, bugging
@Mothblocks about it just in case
2023-06-05 22:25:09 -06:00
GoldenAlpharex
5db421281c Undertile Element Logic Refactor, or Catwalks Aren't Affected by Ambient Occlusion Anymore (#71555)
## About The Pull Request
It was bugging me how catwalks would just be stuck rendering on the game
plane in order to be above the pipes and all the other underfloor
objects, because it meant that they stood out due to being affected by
ambient occlusion.

So I decided to change that, and the best change I could come up with,
was to refactor the logic of `/datum/element/undertile` in order to
actually allow us to do exactly what we wanted by having three different
states of underfloor visibility, which in turn allowed me to slap
everything that wasn't accessible on the floor plane rather than
whatever plane they were on, effectively making it so catwalk tiles
wouldn't need to be on the game plane anymore. :)

Also fixes https://github.com/tgstation/tgstation/issues/63590 while I'm
at it :)

## Why It's Good For The Game
Seeing ambient occlusion on catwalks make them stand out in a jarring
way, now that won't be the case anymore!

Now, instead, you get something like this, which _absolutely_ looks like
it fits in!

![image](https://user-images.githubusercontent.com/58045821/204106823-95b77a6b-b9c1-4494-b2f8-3b586c42428c.png)


## Changelog

🆑 GoldenAlpharex
refactor: Refactored the way the undertile component works, to allow it
to have a bit more granularity as to when it's meant to be covered, but
still visible, like for catwalks!
fix: Catwalks no longer are affected by ambient occlusion, and now
properly feel like actual floor tiles.
/🆑
2022-11-30 14:02:54 -08:00
oranges
74e43bc556 Improve the naming of the element argument hash index selector (#71319)
So confusing name
2022-11-19 17:04:28 -08: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
Tim
14deaa41ed Remove code/__DEFINES/misc.dm (#63879)
This removes code/__DEFINES/misc.dm and moves all the defines to either:

another existing define file
new define file
local .dm file if the define was only used in one file
I also deleted defines that were not being used and added documentation to all of the ones that were moved out of misc.dm

Why was this needed? People were basically using the misc.dm file as a dumpster to toss all their defines into that was creating one giant mess. The defines have been organized into their proper groups and files now.
2022-01-23 14:30:27 -08:00
John Willard
96a3d410a2 Traits given by Elements now have element trait as their source. (#62134)
Hopefully the code is more organized and consistent this way.
2021-10-28 18:39:21 -03:00
Mothblocks
0f435d5dff Remove hideous inline tab indentation, and bans it in contributing guidelines (#56912)
Done using this command sed -Ei 's/(\s*\S+)\s*\t+/\1 /g' code/**/*.dm

We have countless examples in the codebase with this style gone wrong, and defines and such being on hideously different levels of indentation. Fixing this to keep the alignment involves tainting the blames of code your PR doesn't need to be touching at all. And ultimately, it's hideous.

There are some files that this sed makes uglier. I can fix these when they are pointed out, but I believe this is ultimately for the greater good of readability. I'm more concerned with if any strings relied on this.

Hi codeowners!

Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
2021-02-14 16:53:29 -08:00
Jared-Fogle
45c14f6330 Adds SIGNAL_HANDLER and SIGNAL_HANDLER_DOES_SLEEP to prevent signal callbacks from blocking (#52761)
Adds SIGNAL_HANDLER, a macro that sets SHOULD_NOT_SLEEP(TRUE). This should ideally be required on all new signal callbacks.

Adds BLOCKING_SIGNAL_HANDLER, a macro that does nothing except symbolize "this is an older signal that didn't necessitate a code rewrite". It should not be allowed for new work.

This comes from discussion around #52735, which yields by calling input, and (though it sets the return type beforehand) will not properly return the flag to prevent attack from slapping.

To fix 60% of the yielding cases, WrapAdminProcCall no longer waits for another admin's proc call to finish. I'm not an admin, so I don't know how many behinds this has saved, but if this is problematic for admins I can just make it so that it lets you do it anyway. I'm not sure what the point of this babysitting was anyway.

Requested by @optimumtact.
Changelog

cl
admin: Calling a proc while another admin is calling one will no longer wait for the first to finish. You will simply just have to call it again.
/cl
2020-08-20 09:11:28 +12:00
ShizCalev
4b6500fb67 Makes all anchored changes use setAnchored(), COMSIG_MOVABLE_SETANCHORED now only sent if an AM's anchored var has changed for more reliable usage. (#52254)
* Converts everything to use setAnchored() + other fixes

* Fixed singulo debug

* singulo again

* forgot to move the vv_edit proc

* caught that this time :)

* changes

* Update code/game/atoms_movable.dm

Co-authored-by: Rohesie <rohesie@gmail.com>

Co-authored-by: Rohesie <rohesie@gmail.com>
2020-07-21 02:20:26 -03:00
spessman-007
ab84042f94 [READY] Improve spelling (#51134)
* Improve spelling

* Spell isn't, ain't, shouldn't, hasn't, wasn't correctly

Co-authored-by: NewSta <spessman-007@users.noreply.github.com>
2020-05-25 02:13:37 +08:00
Time-Green
c04abab2bf [READY] Makes plumbing mappable and reworks hiding (#49644)
🆑
tweak: Ducts can now be hidden under tiles
code: tile hiding is now an element and way cooler and sexier
/🆑

Ducts can now be hidden under tiles
Plumbing machinery connects can now be hidden aswell
Plumbing can now also be properly mapped in without breaking anything
Plumbing component now uses the normal overlay systeem instead of being a weird exception

You can now add the /datum/element/undertile element to instantly make something hidable under tiles when appropriate.
2020-03-16 20:37:59 +13:00