Skip to content

Gas overlay varied sprites - #38855

Merged
Kurfursten merged 22 commits into
vgstation-coders:Bleeding-Edgefrom
SECBATON-GRIFFON:gas-overlay-varied-sprites
Feb 1, 2026
Merged

Gas overlay varied sprites#38855
Kurfursten merged 22 commits into
vgstation-coders:Bleeding-Edgefrom
SECBATON-GRIFFON:gas-overlay-varied-sprites

Conversation

@SECBATON-GRIFFON

@SECBATON-GRIFFON SECBATON-GRIFFON commented Jan 5, 2026

Copy link
Copy Markdown
Contributor

[sprites]

2026-01-05.23-27-52.mp4

What this does

Allows gas overlays to pick from a set of overlays instead of just use one. Currently only used with frame offsets. (would be nice to be able to manipulate this directly on the icon but BYOND won't let me)

Why it's good

Less of each tile's gas overlay looking the exact same.

How it was tested

Opening a plasma, cryotheum and N2O canister in test_very_tiny while separating the room into two halves by windows, then breaking the windows, adding new tiles outside the room with manual building and buildmode, letting the gas drain.

Changelog

🆑

  • imageadd: Gas overlays no longer look the same on every turf, now being varied a bit for plasma, cryotheum and N2O.

@D3athrow-Issues D3athrow-Issues added the Sprites Pretty colors. label Jan 5, 2026
@gurfan

gurfan commented Jan 5, 2026

Copy link
Copy Markdown
Collaborator

How it was tested

Can you test scrubbing out the gases to see if the overlays are cleared properly?

@SonixApache

Copy link
Copy Markdown
Contributor

image example...?

@SECBATON-GRIFFON
SECBATON-GRIFFON marked this pull request as draft January 5, 2026 23:36
@CrazyAmphibian

Copy link
Copy Markdown
Contributor

why not apply this to cryotheum, too?

@SECBATON-GRIFFON

SECBATON-GRIFFON commented Jan 6, 2026

Copy link
Copy Markdown
Contributor Author

why not apply this to cryotheum, too?

i was thinking it wouldn't be as common in rounds, and it would've meant making 6 different icon states as a workaround for not being able to frame offset them, but if you insist

@SECBATON-GRIFFON
SECBATON-GRIFFON marked this pull request as ready for review January 6, 2026 23:19
@west3436

Copy link
Copy Markdown
Collaborator

This is adding multiple overlays to each turf which is going to add up when we get a plasmaflood. Instead, why not look at how snow overlays work and use that approach? You can create 3 plasma vis masters in nullspace then just add them to the vis_contents of each turf

@SECBATON-GRIFFON

SECBATON-GRIFFON commented Jan 15, 2026

Copy link
Copy Markdown
Contributor Author

This is adding multiple overlays to each turf which is going to add up when we get a plasmaflood. Instead, why not look at how snow overlays work and use that approach? You can create 3 plasma vis masters in nullspace then just add them to the vis_contents of each turf

it's using |= for the text stuff, which only adds unique values, plus i very specifically checked this so it wouldn't add multiple vis_contents. (NOT overlays) if it did, the results would be very obvious since the varied sprites are taken from pick() and would stack on each other fast, as it did earlier in testing before i fixed it.
proof, after a few update cycles:
image
image

@ghost

ghost commented Jan 15, 2026

Copy link
Copy Markdown

gas doesnt have enough motion to account for the busy overlay image, this would look a lot better with a couple new sprites

@Eneocho

Eneocho commented Jan 24, 2026

Copy link
Copy Markdown
Collaborator

You could also gain a lot of extra mileage by offsetting the "starting" time for the overlay, so they're unsync'd.

@SECBATON-GRIFFON

Copy link
Copy Markdown
Contributor Author

You could also gain a lot of extra mileage by offsetting the "starting" time for the overlay, so they're unsync'd.

it felt bad enough to do it with sprite states already, i wish BYOND just had a way to offset them

@CrazyAmphibian

Copy link
Copy Markdown
Contributor

according to @DeityLink, what you can do is give the gas overlay sprites directions, and have each direction be its own offset, then spawn the overlay with a random direction

@SECBATON-GRIFFON

SECBATON-GRIFFON commented Jan 25, 2026

Copy link
Copy Markdown
Contributor Author

according to @DeityLink, what you can do is give the gas overlay sprites directions, and have each direction be its own offset, then spawn the overlay with a random direction

actually that is pretty efficient, but the end result would still be pick() ing an overlay to vis_contents

@SonixApache

SonixApache commented Jan 25, 2026

Copy link
Copy Markdown
Contributor

Test this again but make a 500x500 map to test it on.
And then test it with and without.

And, y'know, measure FPS / pay close attention to the profiler.

@DeityLink

Copy link
Copy Markdown
Collaborator

If I can give an opinion, those overlays should be completely replaced with particles. It'd look better AND use less CPU server side.

@west3436

Copy link
Copy Markdown
Collaborator

If I can give an opinion, those overlays should be completely replaced with particles. It'd look better AND use less CPU server side.

The server cost of displaying four icon states is FAR less than the client cost of spawning multiple particle sets per turf.

@Eneocho

Eneocho commented Jan 25, 2026

Copy link
Copy Markdown
Collaborator

If I can give an opinion, those overlays should be completely replaced with particles. It'd look better AND use less CPU server side.

This would be true on any proper engine except ours, byond is a cesspool that we've gotten good at swimming through, but it's still a cesspool.

@DeityLink

DeityLink commented Jan 25, 2026

Copy link
Copy Markdown
Collaborator

The server cost of displaying four icon states is FAR less than the client cost of spawning multiple particle sets per turf.

Except only turfs that are on your screen would matter anymore. Post-NarSie has rune particles on every space turfs and it works fine. So does the "holy fire"

@Eneocho

Eneocho commented Jan 26, 2026

Copy link
Copy Markdown
Collaborator

That might be true, worth a test I guess.

@SECBATON-GRIFFON
SECBATON-GRIFFON marked this pull request as draft January 30, 2026 20:58
@SECBATON-GRIFFON

Copy link
Copy Markdown
Contributor Author

back in draft for some performance coding

@SECBATON-GRIFFON
SECBATON-GRIFFON marked this pull request as ready for review January 30, 2026 21:57
@SECBATON-GRIFFON

SECBATON-GRIFFON commented Jan 30, 2026

Copy link
Copy Markdown
Contributor Author

Test this again but make a 500x500 map to test it on. And then test it with and without.

And, y'know, measure FPS / pay close attention to the profiler.

had a look at the profiler, update_graphic() seems to only use 0.8 self cpu and then isn't called again after the gases get their sprites added. (done from adding plasma to all simturfs with SDQL, so this is an extreme case)

@Kurfursten

Copy link
Copy Markdown
Contributor

To be clear, update_graphic is only called if necessary, not every tick, right? In that case, it's hard to imagine a performance impact at a significant level, even in very large rooms like atmos

@SECBATON-GRIFFON

Copy link
Copy Markdown
Contributor Author

To be clear, update_graphic is only called if necessary, not every tick, right? In that case, it's hard to imagine a performance impact at a significant level, even in very large rooms like atmos

only when necessary it seems, as the profiler confirms (it doesn't show up at all on stop-refresh)

@Kurfursten

Copy link
Copy Markdown
Contributor

In that case I see no serious concerns in this implementation. We can keep an eye on it.

@Kurfursten
Kurfursten merged commit fc92f92 into vgstation-coders:Bleeding-Edge Feb 1, 2026
5 checks passed
@SECBATON-GRIFFON
SECBATON-GRIFFON deleted the gas-overlay-varied-sprites branch February 1, 2026 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Sprites Pretty colors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants