382 Commits

Author SHA1 Message Date
shayoki f601a6ddaf Merge remote-tracking branch 'tgstation/master' into upstream-6-2-2026 2026-06-03 01:23:54 -05:00
Alexis 21b4095dfd [MDB IGNORE] [IDB IGNORE] Upstream Sync - 04/17/2026 (#5453)
Upstream 04/17/2026

fixes https://github.com/Bubberstation/Bubberstation/issues/5549

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: tgstation-ci[bot] <179393467+tgstation-ci[bot]@users.noreply.github.com>
Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com>
Co-authored-by: rageguy505 <54517726+rageguy505@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: Aliceee2ch <160794176+Aliceee2ch@users.noreply.github.com>
Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com>
Co-authored-by: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com>
Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com>
Co-authored-by: Maxipat <108554989+Maxipat112@users.noreply.github.com>
Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com>
Co-authored-by: SimplyLogan <47579821+loganuk@users.noreply.github.com>
Co-authored-by: loganuk <fakeemail123@aol.com>
Co-authored-by: Leland Kemble <70413276+lelandkemble@users.noreply.github.com>
Co-authored-by: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com>
Co-authored-by: Roxy <75404941+TealSeer@users.noreply.github.com>
Co-authored-by: Lucy <lucy@absolucy.moe>
Co-authored-by: siliconOpossum <138069572+siliconOpossum@users.noreply.github.com>
Co-authored-by: Isratosh <Isratosh@hotmail.com>
Co-authored-by: TheRyeGuyWhoWillNowDie <70169560+TheRyeGuyWhoWillNowDie@users.noreply.github.com>
Co-authored-by: Neocloudy <88008002+Neocloudy@users.noreply.github.com>
Co-authored-by: Alexander V. <volas@ya.ru>
Co-authored-by: ElGitificador <168473461+ElGitificador@users.noreply.github.com>
Co-authored-by: Twaticus <46540570+Twaticus@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
Co-authored-by: Tim <timothymtorres@gmail.com>
Co-authored-by: Iamgoofball <iamgoofball@gmail.com>
Co-authored-by: Layzu666 <121319428+Layzu666@users.noreply.github.com>
Co-authored-by: Arturlang <24881678+Arturlang@users.noreply.github.com>
Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com>
Co-authored-by: mrmanlikesbt <99309552+mrmanlikesbt@users.noreply.github.com>
Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
Co-authored-by: John F. Kennedy <54908920+MacaroniCritter@users.noreply.github.com>
Co-authored-by: Cursor <102828457+theselfish@users.noreply.github.com>
Co-authored-by: Josh <josh.adam.powell@gmail.com>
Co-authored-by: Josh Powell <josh.powell@softwire.com>
Co-authored-by: Yobrocharlie <Charliemiller5617@gmail.com>
Co-authored-by: Hardly3D <66234359+Hardly3D@users.noreply.github.com>
Co-authored-by: shayoki <96078776+shayoki@users.noreply.github.com>
Co-authored-by: LT3 <83487515+lessthnthree@users.noreply.github.com>
2026-05-16 00:56:00 +02:00
CabinetOnFire af8f69da13 Adds "Event Logging", or EVLogging, A new debug system that allows us to track individual datums and log events on a timeline (#96035)
## About The Pull Request

This Pull Request adds a new logging system that uses a timeline to
track and visualize important events for specific datums.

This is done via a new window in which you can select a datum for
tracking, which adds it to the timeline. If this datum implements the
EVLOGGING macros, it can track important events onto this timeline. As
an example, we can log whenever an AI is deciding to make a new path, if
it decides to generate a new decisionmaking plan, it finishes an action,
or it decides to target someone/something.

We can select these events to see more information, and optionally get a
snapshot of important variables at the time this event was logged (like
the blackboard and current plan for AI controllers).

You can also filter out specific events / track info, which is done via
categories. Each event / piece of track info is given a category and if
you disable a category all events / track info in that category is
hidden. This lets you filter out things you might not care about.

<img width="2346" height="1209" alt="image"
src="https://github.com/user-attachments/assets/0763077c-e349-4c7c-b017-23d29e1d089b"
/>

_whoever thinks we didnt need advanced cleanbot logging is a noob_


In the video below I showcase how this works;
https://file.house/7nsOiqdvmSTxlsk3fs-e8g==.mp4
A cleanbot is roaming the halls, I turn on the event logger, click the
"pick target" button and click on the datum I'd like to track (the
cleanbot). This results in the cleanbot now tracking its events. I spawn
some dirt and the cleanbot decides to clean it, and I go through the
events; You can see theres different events being listed, such as when
the cleanbot starts targetting the dirt, when it cleans plan, when it
makes it JPS path and every time it moves over it.


The macros I've currently implemented are as follows:

**EVLOG_TEXT(DATUM, CATEGORY, INFO)**
Only adds text to the event logger window, no world-visuals

EVLOG_LOCATION(DATUM, CATEGORY, INFO, TURF) 
Adds text to the event logger and adds an image to where that turf is.

EVLOG_TURFS(DATUM, CATEGORY, INFO, TURFS)
Adds text to the event logger and adds an image to each turf in the
TURFS list

EVLOG_LINES(DATUM, CATEGORY, INFO, TURF_A, TURF_B)
Adds text to the event logger and adds a line from turf_a to turf_B

EVLOG_PATH(DATUM, CATEGORY, INFO, TURFS)
Adds text to the event logger and visualizes a path from A to B (same
way as the pathfinding debugger, of which I moved the visualization
before to SSPathfinder)

In terms of performance, the logger is a singleton, and events are ONLY
logged if
1. The logger is running
2. The datum has the DF_EVLOGGING flag.

This means most of the time, logging an event is a single var lookup
(Since the runner is off by default). The DF_EVLOGGING flag is off by
default as well and has to be enabled by the event logger, or set
temporarily by a dev in code.

This system can easily be extended with more event types / visualization
types as well. (I'm thinking of datumizing the ones I have now)

The TGUI is still a bit of a mess, I would love some pointers because
I'm not really good at react so I just kind of hit it with a hammer
until it did what I wanted 😎

Also, all of this is based on VisLogging from Unreal Engine, so it will
have some likeness https://unreal-garden.com/tutorials/visual-logger/

## Why It's Good For The Game

This system allows us to debug more complex systems (like basic AI) in
an understandable and clear way. While the implementation cases are not
super common right now, extending this system could make debugging these
systems much more comprehensible, and hopefully lets more developers
help us with improving these systems. (plus, we LOVE timelines)

## Changelog

🆑 CabinetOnFire
refactor: Implements "Event Logging" an improved way for programmers to
debug specific datums.
/🆑

---------

Co-authored-by: Lucy <lucy@absolucy.moe>
2026-05-13 12:37:56 +00:00
mrmanlikesbt 928df286a6 Kills /datum/asset/var/_abstract, uses abstract_type instead (#95756)
## About The Pull Request

It's all in the title

## Why It's Good For The Game

Forgotten in #92909

## Changelog

no player facing changes
2026-04-13 17:20:12 -04:00
Tim 14c77736e7 Slot Machine DLC - Diversified Debt for Every Department (#95513)
## About The Pull Request
This PR takes the improvements from:
- #95313

And builds on it quite a bit. Slots now have:
- New symbol icons based on SS13 objects instead of Font Awesome icons
- Several new slot machine subtypes for every department
- New slot machine random spawner that is used to replace all slot
machines on all maps
- ~~Greyscaled the slot machine sprite and replaced it with GAGs (to
color them by department)~~
- New rare trap/hazard abilities depending on symbols (syndiebomb =
flashbang, handcuffs = cuff, singulo = shock, etc.)
- Syndie slot machine that comes preinstalled in all syndie
outposts/nuke bases
- Slot machines circuits can be configured with a screwdriver to change
the type and emagging results in the syndicate version
- Tweaked the pixel offset for the jackpot flashing icon so it is in the
correct position
- Improved the name generator with more adjectives and nouns for all
subtypes (ex. clown slot machine = "Lucky Giggles")
- IDs and Department budget cards can be linked as the owner of the slot
machine, however NT takes a 40% cut off the profits since jackpots/bonus
spins are paid out by NT

##### And yes... there is a clown and mime subtype... honk

## Why It's Good For The Game

<img width="1503" height="791" alt="dreamseeker_t8lLODECva"
src="https://github.com/user-attachments/assets/597355be-aee0-483a-82a4-7f8d6fa9ae90"
/>

Better slot machine icons and code.

## Changelog
🆑
add: To help cover budget expenses, NT has redesigned and installed new
slot machines that are themed by department. Slot machines can also be
linked to bank accounts via ID cards or department budget cards. NT
takes a 40% cut of profit to payout major jackpots and bonus spins.
Please gamble responsibly.
map: Replaced all slot machines with slot machine random spawners. Added
syndicate slot machines to Syndicate bases and nuke outposts.
/🆑

---------

Co-authored-by: Lucy <lucy@absolucy.moe>
2026-04-03 15:25:31 +01:00
itsmeow 57144e0243 IconForge: Antag and species icons, greyscale previews optimization (#94954)
## About The Pull Request

Converts species and antagonist icon generation to the batched
spritesheet system using IconForge, thanks to the new
`get_flat_uni_icon` implementation. Unfortunately the cost of *building*
the sprite is still expensive (GFI is always expensive, even a fancy
list-based one), but the generation is SIGNIFICANTLY faster. We will see
evidence of parity in the screenshot tests. but here:

<img width="892" height="634" alt="image"
src="https://github.com/user-attachments/assets/2a17f2e3-c024-41f6-9d1e-c2cb70642a81"
/>

The main advantage is that species and antag icons can now take
advantage of the development-time smart cache which invalidates
automatically. On the server this PR does very little except make antag
icon generation a little bit more likely to find and announce errors
(BYOND has a habit of silently eating weird icon proc calls).

Also optimizes the greyscale preview generator from #90940 (~2x speedup)
using `rustg_iconforge_generate_headless` instead of `Insert()` to build
the resulting sheets. This can be further optimized in the future by
implementing a smart cache, like batched spritesheets, and storing it in
the repo, but for now it's not important/slow enough to be worth the
effort. Also fixes a silent compilation error that would always happen
outside unit tests, but for some reason doesn't appear on local? Notice
how `map_icon_key` is not a defined variable anywhere. That's because
`USE_RUSTG_ICONFORGE_GAGS` is *never* defined at this point, so it was
always using the 'slow' generation.

I also took the liberty of cleaning up the cultist and heretic icon
generation randomly initializing a blade object when it could just use a
static access.

## Why It's Good For The Game

The subsystem timing may not be much faster, but the interactivity
benefits during spritesheet realization are undeniable. Opening the
preferences menu during init on local is orders of magnitude faster.

**Old**
Early Assets: 5.02 seconds
Greyscale Previews: 1.38 seconds

**Fresh (No Cache)**
Early Assets: 4.21 seconds
Greyscale Previews: 0.5 seconds

**Cache Invalidated**
Early Assets: 4.27 seconds

**Cache Hit**
Early Assets: 4.05~4.2 seconds

**Preferences lag:**
~6 sec to open to ~2 sec to open due to caching in dev

## Changelog

🆑
code: Optimized species and antagonist icon loading in the preferences
menu on local, speeding up time to open in development.
fix: GAGS map preview generation no longer silently errors outside of
unit tests due to a compilation error.
/🆑
2026-03-02 17:25:16 -05:00
MrMelbert e9d964789b Swags out the roundstart report (#95149)
## About The Pull Request

The roundstart report has been dripped out with a logo and some
additional flavor

<img width="585" height="916" alt="image"
src="https://github.com/user-attachments/assets/d0dab027-24e4-4d4a-a5ad-59616b3bf33d"
/>

The flavor messages are just some randomly selected lore tidbits or
filler text

Other changes:

- Paper now updates to your writing implement immediately, rather than
on process ticks.
- Adds a config to hide the dynamic report for cutting down the length
of the roundstart report. Disabled by default
- Footnotes now requires `R_FUN` rather than `R_ADMIN`

## Why It's Good For The Game

Makes the command report look a ton more official while introducing some
fun worldbuilding.

## Changelog

🆑 Melbert
qol: Paper UI now updates immediately when you pick up or drop a writing
tool.
qol: The roundstart command report has had its style updated, and now
contains some bonus lore.
admin: Changes the perms needed to add command report footnotes to "Fun"
rather than "Admin"
admin: Adds a verb for changing the command report main contents
(Requiring "Fun")
config: Adds a config for hiding the dynamic report, disabled by default
(disabled meaning you still get the report)
/🆑
2026-02-20 20:54:36 -05:00
SyncIt21 e90018a3eb Stops unessassary reactions from occurring in plumbing machines (#95125)
## About The Pull Request
This PR stops reactions from occurring in plumbing machines except for 2
- Reaction chamber
- Acclimator

This means you can now have a tank containing welding fuel, carbon &
hydrogen and not worry about them reacting to create oil

## Why its good for the game
- Makes the game run faster. Calling `handle_reactions()` is an
expensive operation and should not be done needlessly
- Makes life for players easier. We don't want chemicals reacting before
they reach the reaction chamber & acclimator and making them obsolete.
It now allows them to do their job properly

**Dependencies**
- #95077
- #95084

After they are merged. Part of their code needs to be rewritten here.

This also deletes the redundant splitter sprite

## Changelog
🆑
qol: except for plumbing reaction chamber & acclimator, no reactions
will occur inside plumbing machines
/🆑
2026-02-20 07:53:31 +01:00
SyncIt21 ca436ad925 General maintenance for plumbing filter & splitter (#95084)
## About The Pull Request
- Both UI's now don't auto update so it saves some bandwidth on the
client side
- Removed English version list on the chemical splitter list to save
memory. It now auto computes it
- Plumbing splitter now sends reagents even if the requested amount is
larger than the amount set
- Removed unused & redundant vars from both. Code is more compat
- Plumbing splitter is a 3 way component allowing you to split reagents
in 3 directions

## Changelog
🆑
refactor: code for plumbing splitter & filter have been improved.
plumbing splitter is now a 3 way component. Report bugs on github
/🆑

---------

Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
2026-02-13 14:41:23 +01:00
nevimer 00ccf0c6b5 Merge remote-tracking branch 'tgstation/master' into upstream-feb12-2026
# Conflicts:
#	.github/CODEOWNERS
#	.github/workflows/compile_changelogs.yml
#	.github/workflows/stale.yml
#	SQL/database_changelog.md
#	_maps/map_files/CatwalkStation/CatwalkStation_2023.dmm
#	code/__DEFINES/atom_hud.dm
#	code/__DEFINES/inventory.dm
#	code/__DEFINES/mobs.dm
#	code/__DEFINES/species_clothing_paths.dm
#	code/__DEFINES/subsystems.dm
#	code/__DEFINES/surgery.dm
#	code/__HELPERS/global_lists.dm
#	code/_globalvars/lists/maintenance_loot.dm
#	code/_globalvars/traits/_traits.dm
#	code/controllers/subsystem/minor_mapping.dm
#	code/controllers/subsystem/processing/quirks.dm
#	code/controllers/subsystem/shuttle.dm
#	code/datums/components/palette.dm
#	code/datums/components/surgery_initiator.dm
#	code/datums/diseases/advance/advance.dm
#	code/datums/hud.dm
#	code/datums/mood.dm
#	code/datums/mutations/chameleon.dm
#	code/datums/quirks/negative_quirks/nyctophobia.dm
#	code/datums/status_effects/debuffs/debuffs.dm
#	code/datums/status_effects/debuffs/drunk.dm
#	code/datums/status_effects/debuffs/slime/slime_leech.dm
#	code/datums/weather/weather.dm
#	code/game/data_huds.dm
#	code/game/objects/items.dm
#	code/game/objects/items/devices/scanners/health_analyzer.dm
#	code/game/objects/items/frog_statue.dm
#	code/game/objects/items/rcd/RLD.dm
#	code/game/objects/items/robot/items/hypo.dm
#	code/game/objects/items/stacks/medical.dm
#	code/game/objects/items/stacks/wrap.dm
#	code/game/objects/items/storage/garment.dm
#	code/game/objects/items/tools/medical/defib.dm
#	code/game/objects/items/weaponry.dm
#	code/game/objects/items/weaponry/melee/misc.dm
#	code/game/objects/structures/crates_lockers/closets/secure/security.dm
#	code/game/objects/structures/curtains.dm
#	code/game/objects/structures/dresser.dm
#	code/game/objects/structures/girders.dm
#	code/game/objects/structures/maintenance.dm
#	code/game/objects/structures/mirror.dm
#	code/modules/admin/greyscale_modify_menu.dm
#	code/modules/admin/verbs/light_debug.dm
#	code/modules/antagonists/ashwalker/ashwalker.dm
#	code/modules/antagonists/heretic/knowledge/starting_lore.dm
#	code/modules/antagonists/ninja/ninjaDrainAct.dm
#	code/modules/art/paintings.dm
#	code/modules/client/preferences.dm
#	code/modules/client/verbs/ooc.dm
#	code/modules/clothing/head/wig.dm
#	code/modules/events/disease_outbreak.dm
#	code/modules/holodeck/holo_effect.dm
#	code/modules/jobs/job_types/head_of_security.dm
#	code/modules/jobs/job_types/security_officer.dm
#	code/modules/library/skill_learning/generic_skillchips/point.dm
#	code/modules/mining/lavaland/ash_flora.dm
#	code/modules/mining/lavaland/mining_loot/megafauna/ash_drake.dm
#	code/modules/mob/dead/new_player/new_player.dm
#	code/modules/mob/living/basic/guardian/guardian.dm
#	code/modules/mob/living/basic/space_fauna/space_dragon/space_dragon.dm
#	code/modules/mob/living/carbon/carbon.dm
#	code/modules/mob/living/carbon/human/human.dm
#	code/modules/mob/living/carbon/human/human_defines.dm
#	code/modules/mob/living/carbon/life.dm
#	code/modules/mob/living/living.dm
#	code/modules/mob/living/living_defines.dm
#	code/modules/mob/mob.dm
#	code/modules/mob_spawn/ghost_roles/mining_roles.dm
#	code/modules/mod/mod_control.dm
#	code/modules/mod/modules/modules_general.dm
#	code/modules/modular_computers/computers/item/computer_ui.dm
#	code/modules/paperwork/paper.dm
#	code/modules/paperwork/paperbin.dm
#	code/modules/power/lighting/light.dm
#	code/modules/projectiles/guns/energy/kinetic_accelerator.dm
#	code/modules/projectiles/projectile.dm
#	code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm
#	code/modules/reagents/chemistry/reagents/food_reagents.dm
#	code/modules/reagents/chemistry/reagents/other_reagents.dm
#	code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm
#	code/modules/research/xenobiology/crossbreeding/_clothing.dm
#	code/modules/research/xenobiology/crossbreeding/prismatic.dm
#	code/modules/surgery/advanced/brainwashing.dm
#	code/modules/surgery/advanced/lobotomy.dm
#	code/modules/surgery/amputation.dm
#	code/modules/surgery/blood_filter.dm
#	code/modules/surgery/bodyparts/_bodyparts.dm
#	code/modules/surgery/brain_surgery.dm
#	code/modules/surgery/cavity_implant.dm
#	code/modules/surgery/coronary_bypass.dm
#	code/modules/surgery/gastrectomy.dm
#	code/modules/surgery/healing.dm
#	code/modules/surgery/limb_augmentation.dm
#	code/modules/surgery/organ_manipulation.dm
#	code/modules/surgery/revival.dm
#	code/modules/surgery/sleeper_protocol.dm
#	code/modules/surgery/surgery_helpers.dm
#	code/modules/surgery/surgery_step.dm
#	code/modules/unit_tests/_unit_tests.dm
#	code/modules/unit_tests/designs.dm
#	code/modules/unit_tests/icon_state_worn.dm
#	code/modules/unit_tests/screenshots/screenshot_antag_icons_cultist.png
#	code/modules/unit_tests/screenshots/screenshot_antag_icons_headrevolutionary.png
#	code/modules/unit_tests/screenshots/screenshot_antag_icons_provocateur.png
#	code/modules/unit_tests/screenshots/screenshot_husk_body.png
#	code/modules/unit_tests/screenshots/screenshot_husk_body_missing_limbs.png
#	icons/map_icons/clothing/head/_head.dmi
#	icons/map_icons/clothing/shoes.dmi
#	icons/map_icons/items/_item.dmi
#	icons/mob/huds/hud.dmi
#	icons/mob/inhands/64x64_lefthand.dmi
#	icons/mob/inhands/64x64_righthand.dmi
#	icons/obj/machines/computer.dmi
#	tgui/packages/tgui/interfaces/OperatingComputer.jsx
#	tgui/packages/tgui/interfaces/PreferencesMenu/CharacterPreferences/MainPage.tsx
#	tgui/packages/tgui/interfaces/PreferencesMenu/types.ts
#	tgui/packages/tgui/interfaces/SurgeryInitiator.tsx
#	tools/icon_cutter/check.py
2026-02-12 23:50:09 -05:00
MrMelbert bfdb237612 Spooky Scary Supreme Surgery (Rework) (#93697) 2025-12-19 18:42:58 +01:00
nevimer baf3837ae8 Merge remote-tracking branch 'tgstation/master' into upstream-2025-11-29
# Conflicts:
#	_maps/RandomRuins/SpaceRuins/derelict_sulaco.dmm
#	_maps/RandomRuins/SpaceRuins/garbagetruck2.dmm
#	_maps/map_files/CatwalkStation/CatwalkStation_2023.dmm
#	_maps/map_files/tramstation/tramstation.dmm
#	code/_onclick/hud/new_player.dm
#	code/datums/components/squashable.dm
#	code/datums/diseases/advance/symptoms/heal.dm
#	code/datums/diseases/chronic_illness.dm
#	code/datums/status_effects/buffs.dm
#	code/datums/status_effects/debuffs/drunk.dm
#	code/datums/status_effects/debuffs/stamcrit.dm
#	code/game/machinery/computer/crew.dm
#	code/game/objects/items/devices/scanners/health_analyzer.dm
#	code/game/objects/items/wall_mounted.dm
#	code/game/turfs/closed/indestructible.dm
#	code/modules/admin/view_variables/filterrific.dm
#	code/modules/antagonists/heretic/influences.dm
#	code/modules/cargo/orderconsole.dm
#	code/modules/client/preferences.dm
#	code/modules/events/space_vines/vine_mutations.dm
#	code/modules/mob/dead/new_player/new_player.dm
#	code/modules/mob/living/carbon/human/death.dm
#	code/modules/mob/living/carbon/human/species_types/jellypeople.dm
#	code/modules/mob/living/damage_procs.dm
#	code/modules/mob/living/living.dm
#	code/modules/mob_spawn/ghost_roles/mining_roles.dm
#	code/modules/mob_spawn/mob_spawn.dm
#	code/modules/projectiles/ammunition/energy/laser.dm
#	code/modules/projectiles/guns/ballistic/launchers.dm
#	code/modules/projectiles/guns/energy/laser.dm
#	code/modules/reagents/chemistry/machinery/chem_dispenser.dm
#	code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm
#	code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm
#	code/modules/reagents/chemistry/reagents/medicine_reagents.dm
#	code/modules/surgery/healing.dm
#	code/modules/unit_tests/designs.dm
#	icons/mob/inhands/items_lefthand.dmi
#	icons/mob/inhands/items_righthand.dmi
#	tgui/packages/tgui/interfaces/ChemDispenser.tsx
2025-11-29 22:49:21 -05:00
FalloutFalcon c2dfa647a0 kills Debug and Debug2 all hail debugging_enabled (#94002)
## About The Pull Request
renames Debug2 and kills Debug as its last use (atleast the one
described in its comment) was removed
added it to the check to print to print stack traces to chat in the
instance your debugging without a debugger attached for some reason (if
this var is enabled on live it already causes random to_world messages,
kinda fuck it we ball at that point)
## Why It's Good For The Game
The first one was ENTIRELY unused now
this name makes more sense
## Changelog
N/A
2025-11-18 17:24:36 -07:00
xPokee b308ee9d78 Merge branch 'master' of https://github.com/tgstation/tgstation into upstream-sync 2025-09-24 10:13:01 -04:00
MrMelbert 750ca9d2ec Two as anything greps (and some other cleanup) (#92974) 2025-09-20 13:44:28 -04:00
Kashargul 722c3b7797 follow up fix for #92508 (#92571)
## About The Pull Request
This is a follow up patch for #92508, otherwise than said in coderbus,
calling the cleanup too early can lead to bad assets. We'll now keep
track of the count of assets in generation and only clean up after they
all have passed the generation.
<img width="3067" height="455" alt="grafik"
src="https://github.com/user-attachments/assets/0b65acf3-464f-436c-8a60-84c9472be6cd"
/>
## Why It's Good For The Game
## Changelog
There should be nothing player facing here as the asset job fails
straight up if the cache was cleared too early.
2025-08-19 22:41:07 -04:00
Kashargul 31dd4a7c40 fix asset loading subsystem (#92508)
## About The Pull Request
The entire asset loading had multiple issues.

Firstly, we could hit a tick check after an asset was generated and
didn't remove the index, leading to the asset being generated twice.

Secondly, we had the issue that the icon forge batching uses UNTIL to
wait until generation finishes. This led to the situation that the
entire subsystem fire proc was paused outside of the internal tick check
pause.
## Why It's Good For The Game
Especially on larger sprite sheets or when there're many to be generated
this led to the situation that we looked up a rust job multiple times:
 
`[2025-08-08T18:42:11] Runtime in
code/modules/asset_cache/iconforge/batched_spritesheet.dm,200:
Spritesheet design UNKNOWN ERROR: NO SUCH JOB`

## Changelog
No player facing changes.
2025-08-19 22:33:50 -04:00
Kashargul 0bd054538a follow up fix for #92508 (#92571)
## About The Pull Request
This is a follow up patch for #92508, otherwise than said in coderbus,
calling the cleanup too early can lead to bad assets. We'll now keep
track of the count of assets in generation and only clean up after they
all have passed the generation.
<img width="3067" height="455" alt="grafik"
src="https://github.com/user-attachments/assets/0b65acf3-464f-436c-8a60-84c9472be6cd"
/>
## Why It's Good For The Game
## Changelog
There should be nothing player facing here as the asset job fails
straight up if the cache was cleared too early.
2025-08-15 14:51:58 +02:00
Kashargul 8cd44d26c6 fix asset loading subsystem (#92508)
## About The Pull Request
The entire asset loading had multiple issues.

Firstly, we could hit a tick check after an asset was generated and
didn't remove the index, leading to the asset being generated twice.

Secondly, we had the issue that the icon forge batching uses UNTIL to
wait until generation finishes. This led to the situation that the
entire subsystem fire proc was paused outside of the internal tick check
pause.
## Why It's Good For The Game
Especially on larger sprite sheets or when there're many to be generated
this led to the situation that we looked up a rust job multiple times:
 
`[2025-08-08T18:42:11] Runtime in
code/modules/asset_cache/iconforge/batched_spritesheet.dm,200:
Spritesheet design UNKNOWN ERROR: NO SUCH JOB`

## Changelog
No player facing changes.
2025-08-11 21:15:50 +02:00
itsmeow 8a7e6d059f Bumps rust_g to 4.0.0 / IconForge Improvements (#92333) 2025-08-04 20:53:34 -04:00
itsmeow 23816b8ef2 Bumps rust_g to 4.0.0 / IconForge Improvements (#92333) 2025-07-30 22:51:23 -06:00
Roxy 4a5291125a Fix the dozen or so lingering spritesheet errors caused by GAGS map icons (#91469)
## About The Pull Request

It turns out this additional code is not only not needed but actually
breaks the spritesheet because the whole point is icon and icon_state
are set to the generated icon that you use in stuff like spritesheets.
Testing this change made all the errors go away and the proper icons
appear in the crafting menu

## Why It's Good For The Game

Bug fix

## Changelog
🆑
fix: fixed broken GAGS icons in the crafting menu
/🆑
2025-06-07 04:09:54 -04:00
Roxy 7ecbcba03d Fix the dozen or so lingering spritesheet errors caused by GAGS map icons (#91469)
## About The Pull Request

It turns out this additional code is not only not needed but actually
breaks the spritesheet because the whole point is icon and icon_state
are set to the generated icon that you use in stuff like spritesheets.
Testing this change made all the errors go away and the proper icons
appear in the crafting menu

## Why It's Good For The Game

Bug fix

## Changelog
🆑
fix: fixed broken GAGS icons in the crafting menu
/🆑
2025-06-06 20:30:33 -04:00
Bloop 9ef0768b1c Removes a couple of duplicate gag map_icons + fixes the gags_recolorable component + most lootpanel gags previews (#91341)
## About The Pull Request

Turns out there were a couple of black mask subtypes that I missed as
well as a prisoner uniform subtype.

Also fixes some bugs that are not related to the map icon pr to further
improve the situation with GAGS previews.

## Why It's Good For The Game

Smaller .dmis, working previews

## Changelog

🆑
fix: spraycan can now be used to recolor the gi, glow shoes, striped
dress, H.E.C.K. suit
fix: most GAGS items should now be showing up in the lootpanel again
/🆑
2025-06-05 20:05:18 -04:00
Jeremiah a5a4b83a25 Sets prettier to run on the repo (#91379)
Prettier (an auto formatter) is set to only run within the tgui folder
currently. This removes that limitation, allowing it to automatically
format all supported files in the repo (.js, .html, .yml
[etc](https://prettier.io/docs/))

I made a few exceptions for bundled and generated files
I'm of the opinion that code should look uniform and am lazy enough to
want CTRL-S to format files without having to think beyond that
2025-06-05 19:13:02 -04:00
Bloop 4250ecb14c Removes a couple of duplicate gag map_icons + fixes the gags_recolorable component + most lootpanel gags previews (#91341)
## About The Pull Request

Turns out there were a couple of black mask subtypes that I missed as
well as a prisoner uniform subtype.

Also fixes some bugs that are not related to the map icon pr to further
improve the situation with GAGS previews.

## Why It's Good For The Game

Smaller .dmis, working previews

## Changelog

🆑
fix: spraycan can now be used to recolor the gi, glow shoes, striped
dress, H.E.C.K. suit
fix: most GAGS items should now be showing up in the lootpanel again
/🆑
2025-06-01 19:44:15 -07:00
Jeremiah 9db2f6916b Sets prettier to run on the repo (#91379)
## About The Pull Request
Prettier (an auto formatter) is set to only run within the tgui folder
currently. This removes that limitation, allowing it to automatically
format all supported files in the repo (.js, .html, .yml
[etc](https://prettier.io/docs/))

I made a few exceptions for bundled and generated files
## Why It's Good For The Game
I'm of the opinion that code should look uniform and am lazy enough to
want CTRL-S to format files without having to think beyond that
## Changelog
2025-05-29 21:23:59 -07:00
Bloop 655b66bdd0 Adds automatic GAGS icon generation for mapping and the loadout menu (#90940)
Revival of https://github.com/tgstation/tgstation/pull/86482, which is
even more doable now that we have rustg iconforge generation.

What this PR does:

- Sets up every single GAGS icon in the game to have their own preview
icon autogenerated during compile. This is configurable to not run
during live. The icons are created in `icons/map_icons/..`
- This also has the side effect of providing accurate GAGS icons for
things like the loadout menu. No more having to create your own
previews.

![FOuGL6ofxC](https://github.com/user-attachments/assets/e5414971-7f13-4883-9f7f-a8a212b46fe8)

<details><summary>Mappers rejoice!</summary>

![StrongDMM_1oeMSoRHXT](https://github.com/user-attachments/assets/83dcfe4c-31be-4953-98f3-dff90268bbc4)

![StrongDMM_uyqu3CggPn](https://github.com/user-attachments/assets/7896f99e-2656-40e1-a9da-3a513882365a)

</details>

<details><summary>Uses iconforge so it does not take up much time during
init</summary>

![dreamdaemon_u4Md3Dqwge](https://github.com/user-attachments/assets/17baaff8-5d5e-4a4d-ba8f-9dd548024155)

</details>

---

this still applies:

Note for Spriters:

After you've assigned the correct values to vars, you must run the game
through init on your local machine and commit the changes to the map
icon dmi files. Unit tests should catch all cases of forgetting to
assign the correct vars, or not running through init.

Note for Server Operators:

In order to not generate these icons on live I've added a new config
entry which should be disabled on live called GENERATE_ASSETS_IN_INIT in
the config.txt

No more error icons in SDMM and loadout.

🆑
refactor: preview icons for greyscale items are now automatically
generated, meaning you can see GAGS as they actually appear ingame while
mapping or viewing the loadout menu.
/🆑

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2025-05-29 16:14:43 -04:00
Bloop cb51a652a9 Adds automatic GAGS icon generation for mapping and the loadout menu (#90940)
## About The Pull Request

Revival of https://github.com/tgstation/tgstation/pull/86482, which is
even more doable now that we have rustg iconforge generation.

What this PR does:

- Sets up every single GAGS icon in the game to have their own preview
icon autogenerated during compile. This is configurable to not run
during live. The icons are created in `icons/map_icons/..`
- This also has the side effect of providing accurate GAGS icons for
things like the loadout menu. No more having to create your own
previews.


![FOuGL6ofxC](https://github.com/user-attachments/assets/e5414971-7f13-4883-9f7f-a8a212b46fe8)

<details><summary>Mappers rejoice!</summary>


![StrongDMM_1oeMSoRHXT](https://github.com/user-attachments/assets/83dcfe4c-31be-4953-98f3-dff90268bbc4)


![StrongDMM_uyqu3CggPn](https://github.com/user-attachments/assets/7896f99e-2656-40e1-a9da-3a513882365a)

</details>

<details><summary>Uses iconforge so it does not take up much time during
init</summary>


![dreamdaemon_u4Md3Dqwge](https://github.com/user-attachments/assets/17baaff8-5d5e-4a4d-ba8f-9dd548024155)

</details>

---

### Copied from https://github.com/tgstation/tgstation/pull/86482 as
this still applies:

Note for Spriters:

After you've assigned the correct values to vars, you must run the game
through init on your local machine and commit the changes to the map
icon dmi files. Unit tests should catch all cases of forgetting to
assign the correct vars, or not running through init.

Note for Server Operators:

In order to not generate these icons on live I've added a new config
entry which should be disabled on live called GENERATE_ASSETS_IN_INIT in
the config.txt


## Why It's Good For The Game

No more error icons in SDMM and loadout.

## Changelog

🆑
refactor: preview icons for greyscale items are now automatically
generated, meaning you can see GAGS as they actually appear ingame while
mapping or viewing the loadout menu.
/🆑

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2025-05-24 15:21:02 -07:00
Roxy 28e4e2cd42 Refactor changelog handling to separate files (#3459)
## About The Pull Request

This rewrites how our actions handle changelogs, and rewrites a bunch of
the changelog TGUI (in a separate file cause I don't feel like
massacring the upstream one). The gist of it is that our actions will
now create autochangelog files with bubber in the name, our changelog
compile will only compile those autochangelogs (not upstream ones if
they happen to be in there), and the compile will be done into separate
bubber changelog files in `html/changelogs/bubber_archive`. In game, the
UI will pull both archive files (upstream and ours) and combine them in
the changelog list, putting the codebase logo next to each change to
distinguish which one it's from.

~~NOTE: I'm opening this as a draft because I'm going to try and reset
our tg changelogs and then reapply all our historical changelogs into
the new bubber archive files, I'm just putting this up now so the code
can be reviewed and shit~~ done

## Why It's Good For The Game

For players this makes it easier to distinguish where a change came
from, and for developers this means we don't need to worry about
breaking the changelog when we do an upstream pull, we can completely
ignore it and just pull everything, and our tg archive files will be 1:1
with upstream with no shit from us added in.

## Proof Of Testing
<details>
<summary>Screenshots/Videos</summary>


![image](https://github.com/user-attachments/assets/ac8a96f9-dcb3-43f0-8d36-faf610f3a7e0)

</details>

## Changelog

🆑 TealSeer, LT3
refactor: refactored how changelogs are generated and displayed
/🆑

---------

Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
2025-04-07 21:49:12 +00:00
shellspeed1 69a16a028e Replaces Persistence Comms with Cybersun, also bug and mapping fixes (#3086)
## About The Pull Request

Persistence is supposed to be a cybersun front but it still uses
interdyne comms. Lets fix that and add interdyne comms as an emergency
comms chip.

Additionally, this PR disables the icemoon automapper as we have been
having consistent issues with missing roofs. This is hopefully a
temporary fix until a better solution can be found.

Lastly, reworks engineering a bit to add one more construction spot and
make the utilities room a bit easier to notice so water actually gets
set up. Also expands table space in the kitchen as that was one of the
more desired features.

## Why It's Good For The Game

I love not having holes in the roof. Also flavor on the comms as we are
supposed to be a cybersun front.

## Proof Of Testing

<details><summary>Screen caps from testing</summary>

![image](https://github.com/user-attachments/assets/a110e756-5ae5-4ddf-b5b2-f2bb56af29d5)


![image](https://github.com/user-attachments/assets/50c3c968-d2c4-4c6d-867b-1db1ac80c9b6)


![image](https://github.com/user-attachments/assets/d8a851e3-80ef-422a-b836-6c75b76b19f7)


![image](https://github.com/user-attachments/assets/16b9e74b-7105-48a2-998d-bb3d349ea154)


![image](https://github.com/user-attachments/assets/e47e2794-31bf-4a80-81ad-7c03c5530891)


![image](https://github.com/user-attachments/assets/36c4e595-c182-45ad-851c-64de760e988c)
</details>

## Changelog
🆑
add: Persistence now has cybersun comms (It's literally just renamed
persistence comms)
add: Persistence can now produce interdyne comms in an emergency using
an interdyne comms chips
fix: Persistence no longer has 4 safes on one tile
fix: Persistence no longer has a turret that shoots out a window in the
prison
fix: Persistence no longer has a null telecomms server, also atmos works
fix: Renamed syndicate_exofab to syndicate exofab in the circuit printer
fix: Renamed cybersun channel no longer outputs to the uplink channel
fix: Reverts automapper placement of persistence on icemoon and returns
to
map: slightly revamped the Persistence kitchen.
map: condensed the utility area of persistence and added a cycling
airlock plus one more 3x3 construction area.
map: toned down some of the roundstart persistence equipment that can be
acquired through other relatively easy means such as cargo.
/🆑

---------

Co-authored-by: Otome <darkwolfinsanity@gmail.com>
2025-03-24 10:55:43 -06:00
itsmeow 9ebcabb077 IconForge: rust-g Spritesheet Generation (#89478)
Replaces the asset subsystem's spritesheet generator with a rust-based
implementation (https://github.com/tgstation/rust-g/pull/160).

This is a rough port of
https://github.com/BeeStation/BeeStation-Hornet/pull/10404, but it
includes fixes for some cases I didn't catch that apply on TG.

(FWIW we've been using this system on prod for over a year and
encountered no major issues.)

![image](https://github.com/user-attachments/assets/53bd2b44-9bb5-42d2-b33f-093651edebc0)

`/datum/asset/spritesheet_batched`: A version of the spritesheet system
that collects a list of `/datum/universal_icon`s and sends them off to
rustg asynchronously, and the generation also runs on another thread, so
the game doesn't block during realize_spritesheet. The rust generation
is about 10x faster when it comes to actual icon generation, but the
biggest perk of the batched spritesheets is the caching system.

This PR notably does not convert a few things to the new spritesheet
generator.

- Species and antagonist icons in the preferences view because they use
getFlatIcon ~~which can't be converted to universal icons~~.
- Yes, this is still a *massive* cost to init, unfortunately. On Bee, I
actually enabled the 'legacy' cache on prod and development, which you
can see in my PR. That's why I added the 'clear cache' verb and the
`unregister()` procs, because it can force a regeneration at runtime. I
decided not to port this, since I think it would be detrimental to the
large amount of contributors here.
- It is *technically* possible to port parts of this to the uni_icon
system by making a uni_icon version of getFlatIcon. However, some
overlays use runtime-generated icons which are ~~completely unparseable
to IconForge, since they're stored in the RSC and don't exist as files
anywhere~~. This is most noticeable with things like hair (which blend
additively with the hair mask on the server, thus making them invisible
to `get_flat_uni_icon`). It also doesn't help that species and antag
icons will still need to generate a bunch of dummies and delete them to
even verify cache validity.
- It is actually possible to write the RSC icons to the filesystem
(using fcopy) and reference them in IconForge. However, I'm going to
wait on doing this until I port my GAGS implementation because it
requires GAGS to exist on the filesystem as well.

IconForge generates a cache based on the set of icons used, all
transform operations applied, and the source DMIs of each icon used
within the spritesheet. It can compare the hashes and invalidate the
cache automatically if any of these change. This means we can enable
caching on development, and have absolutely no downsides, because if
anything changes, the cache invalidates itself.

The caching has a mean cost of ~5ms and saves a lot of time compared to
generating the spritesheet, even with rust's faster generation. The main
downside is that the cache still requires building the list of icons and
their transforms, then json encoding it to send to rustg.

Here's an abbreviated example of a cache JSON. All of these need to
match for the cache to be valid. `input_hash` contains the transform
definitions for all the sprites in the spritesheet, so if the input to
iconforge changes, that hash catches it. The `sizes` and `sprites` are
loaded into DM.

```json
{
	"input_hash": "99f1bc67d590e000",
	"dmi_hashes": {
		"icons/ui/achievements/achievements.dmi": "771200c75da11c62"
	},
	"sizes": [
		"76x76"
	],
	"sprites": {
		"achievement-rustascend": {
			"size_id": "76x76",
			"position": 1
		}
	},
	"rustg_version": "3.6.0",
	"dm_version": 1
}
```

Universal icons are just a collection of DMI, Icon State, and any icon
transformation procs you apply (blends, crops, scales). They can be
convered to DM icons via `to_icon()`. I've included an implementation of
GAGS that produces universal icons, allowing GAGS items to be converted
into them. IconForge can read universal icons and add them to
spritesheets. It's basically just a wrapper that reimplements BYOND icon
procs.

Converts some uses of md5asfile within legacy spritesheets to use
rustg_hash_file instead, improving the performance of their generation.

Fixes lizard body markings not showing in previews, and re-adds eyes to
the ethereal color preview. This is a side effect of IconForge having
*much* better error handling than DM icon procs. Invalid stuff that gets
passed around will error instead of silently doing nothing.

Changes the CSS used in legacy spritesheet generation to split
`background: url(...) no-repeat` into separate props. This is necessary
for WebView2, as IE treats these properties differently - adding
`background-color` to an icon object (as seen in the R&D console) won't
work if you don't split these out.

Deletes unused spritesheets and their associated icons (condiments
spritesheet, old PDA spritesheet)

If you press "Character Setup", the 10-13sec of lag is now approximately
0.5-2 seconds.

Tracy profile showing the time spent on get_asset_datum. I pressed the
preferences button during init on both branches. Do note that this was
ran with a smart cache HIT, so no generation occurred.

![image](https://github.com/user-attachments/assets/3efa71ab-972b-4f5a-acab-0892496ef999)

Much lower worst-case for /datum/asset/New (which includes
`create_spritesheets()` and `register()`)

![image](https://github.com/user-attachments/assets/9ad8ceee-7bd6-4c48-b5f3-006520f527ef)

Here's a look at the internal costs from rustg - as you can see
`generate_spritesheet()` is very fast:

![image](https://github.com/user-attachments/assets/e6892c28-8c31-4af5-96d4-501e966d0ce9)

**Before**

![image](https://github.com/user-attachments/assets/cbd65787-42ba-4278-a45c-bd3d538da986)

**After**

![image](https://github.com/user-attachments/assets/d750899a-bd07-4b57-80fb-420fcc0ae416)

🆑
fix: Fixed lizard body markings and ethereal feature previews in the
preference menu missing some overlays.
refactor: Optimized spritesheet asset generation greatly using rustg
IconForge, greatly reducing post-initialization lag as well as reducing
init times and saving server computation.
config: Added 'smart' asset caching, for batched rustg IconForge
spritesheets. It is persistent and suitable for use on local, with
automatic invalidation.
add: Added admin verbs - Debug -> Clear Smart/Legacy Asset Cache for
spritesheets.
fix: Fixed R&D console icons breaking on WebView2/516
/🆑
2025-03-12 17:10:20 -04:00
Jacquerel 53248581a3 Traitor Reputation does not scale with population & reintroduces population locked items (#89617)
## About The Pull Request

Closes #89617

Prior to progression traitor some items were only available with a
minimum number of (normally 25) players in the round.
These items were:
- The dual esword
- Noslip shoes
- The ebow
- Holoparasite
- Sleeping Carp
- Contractor Kit
- Maybe a couple of others that I forgot to write down

When we moved to a progression system this concept was merged with
reputation; under 20 players your reputation would advance more slowly
thus making these "dangerous" items less obtainable and also serving as
a sort of scaling factor on rewards (with fewer players the secondary
objectives are easier to complete, so the reward is commesurately
lower).

Now that we have removed secondary objectives this doesn't really make
sense any more, so now reputation simply advances at a rate of one
second per second all the time, but that leaves the old population locks
in question.

So... I just recoded items that are only available when there are enough
players

![image](https://github.com/user-attachments/assets/206577f0-dfdb-4b53-a00f-36e39b2a7f44)

![image](https://github.com/user-attachments/assets/8f840168-9550-4c77-aad0-cb87beb20499)
(This iconography simply vanishes once the pop level is reached).

Note that this is based on "players who have joined" (roundstart +
latejoin), not "players who are online" or "players who are alive".
Once an item becomes available it will never stop being available, but
it only becomes available based on people who are playing and not
watching.

Currently the only items I applied this to (with a value of 20 players)
are:
- Dual esword
- Sleeping Carp
- Spider Extract (the spider antagonist usually requires like 27
players)
- Romerol

It isn't applied to anything else.

## Why It's Good For The Game

Reputation isn't really a tool used to designate how dangerous an item
is any more (if it ever was) and resultingly it doesn't make any sense
to slow its gain based on population.
Some items though we maybe still don't want to show up in a "low pop"
round because they'll create an overall unsatisfying experience, so we
should be able to remove those items from play.

## Changelog

🆑
balance: Traitor reputation now advances at a fixed rate, not dependent
on current server population.
balance: The dual esword, sleeping carp scroll, spider extract, and
romerol vial cannot be purchased if fewer than 20 players have joined
the game.
/🆑
2025-03-12 16:45:31 -04:00
itsmeow d589388355 RTD Icon Improvements (#89491)
## About The Pull Request

RTDs try to use tile item icons instead of turf icons for code that was
clearly intended to work with turfs themselves (they support combination
dirs, but none of the items actually have these!)

They also recreate datums with static data *every single time* you
select a new tile in *each individual RTD*. They now make much smarter
use of this data and quit storing stuff inside temporary datums that get
deleted every time you select something else.

FYI this thing is still pretty busted but I don't have time to fix every
problem with it. I'm mainly doing this to get rid of the Turn() procs
and broken, nonexistent dirs being inserted into the spritesheet for
#89478.

## Why It's Good For The Game

Code improvements, better previews of the turfs you're going to get in
the RTD.


![image](https://github.com/user-attachments/assets/3732370b-36ba-4221-8571-e80a20ff21d8)

## Changelog

🆑
tweak: RTDs now show the icon of the actual turf being placed rather
than its tile item.
/🆑
2025-03-12 16:03:01 -04:00
itsmeow cc335e7e9e IconForge: rust-g Spritesheet Generation (#89478)
## About The Pull Request

Replaces the asset subsystem's spritesheet generator with a rust-based
implementation (https://github.com/tgstation/rust-g/pull/160).

This is a rough port of
https://github.com/BeeStation/BeeStation-Hornet/pull/10404, but it
includes fixes for some cases I didn't catch that apply on TG.

(FWIW we've been using this system on prod for over a year and
encountered no major issues.)

### TG MAINTAINER NOTE


![image](https://github.com/user-attachments/assets/53bd2b44-9bb5-42d2-b33f-093651edebc0)

### Batched Spritesheets

`/datum/asset/spritesheet_batched`: A version of the spritesheet system
that collects a list of `/datum/universal_icon`s and sends them off to
rustg asynchronously, and the generation also runs on another thread, so
the game doesn't block during realize_spritesheet. The rust generation
is about 10x faster when it comes to actual icon generation, but the
biggest perk of the batched spritesheets is the caching system.

This PR notably does not convert a few things to the new spritesheet
generator.

- Species and antagonist icons in the preferences view because they use
getFlatIcon ~~which can't be converted to universal icons~~.
- Yes, this is still a *massive* cost to init, unfortunately. On Bee, I
actually enabled the 'legacy' cache on prod and development, which you
can see in my PR. That's why I added the 'clear cache' verb and the
`unregister()` procs, because it can force a regeneration at runtime. I
decided not to port this, since I think it would be detrimental to the
large amount of contributors here.
- It is *technically* possible to port parts of this to the uni_icon
system by making a uni_icon version of getFlatIcon. However, some
overlays use runtime-generated icons which are ~~completely unparseable
to IconForge, since they're stored in the RSC and don't exist as files
anywhere~~. This is most noticeable with things like hair (which blend
additively with the hair mask on the server, thus making them invisible
to `get_flat_uni_icon`). It also doesn't help that species and antag
icons will still need to generate a bunch of dummies and delete them to
even verify cache validity.
- It is actually possible to write the RSC icons to the filesystem
(using fcopy) and reference them in IconForge. However, I'm going to
wait on doing this until I port my GAGS implementation because it
requires GAGS to exist on the filesystem as well.

#### Caching

IconForge generates a cache based on the set of icons used, all
transform operations applied, and the source DMIs of each icon used
within the spritesheet. It can compare the hashes and invalidate the
cache automatically if any of these change. This means we can enable
caching on development, and have absolutely no downsides, because if
anything changes, the cache invalidates itself.

The caching has a mean cost of ~5ms and saves a lot of time compared to
generating the spritesheet, even with rust's faster generation. The main
downside is that the cache still requires building the list of icons and
their transforms, then json encoding it to send to rustg.

Here's an abbreviated example of a cache JSON. All of these need to
match for the cache to be valid. `input_hash` contains the transform
definitions for all the sprites in the spritesheet, so if the input to
iconforge changes, that hash catches it. The `sizes` and `sprites` are
loaded into DM.

```json
{
	"input_hash": "99f1bc67d590e000",
	"dmi_hashes": {
		"icons/ui/achievements/achievements.dmi": "771200c75da11c62"
	},
	"sizes": [
		"76x76"
	],
	"sprites": {
		"achievement-rustascend": {
			"size_id": "76x76",
			"position": 1
		}
	},
	"rustg_version": "3.6.0",
	"dm_version": 1
}
```

### Universal Icons

Universal icons are just a collection of DMI, Icon State, and any icon
transformation procs you apply (blends, crops, scales). They can be
convered to DM icons via `to_icon()`. I've included an implementation of
GAGS that produces universal icons, allowing GAGS items to be converted
into them. IconForge can read universal icons and add them to
spritesheets. It's basically just a wrapper that reimplements BYOND icon
procs.

### Other Stuff

Converts some uses of md5asfile within legacy spritesheets to use
rustg_hash_file instead, improving the performance of their generation.

Fixes lizard body markings not showing in previews, and re-adds eyes to
the ethereal color preview. This is a side effect of IconForge having
*much* better error handling than DM icon procs. Invalid stuff that gets
passed around will error instead of silently doing nothing.

Changes the CSS used in legacy spritesheet generation to split
`background: url(...) no-repeat` into separate props. This is necessary
for WebView2, as IE treats these properties differently - adding
`background-color` to an icon object (as seen in the R&D console) won't
work if you don't split these out.

Deletes unused spritesheets and their associated icons (condiments
spritesheet, old PDA spritesheet)

## Why It's Good For The Game

If you press "Character Setup", the 10-13sec of lag is now approximately
0.5-2 seconds.

Tracy profile showing the time spent on get_asset_datum. I pressed the
preferences button during init on both branches. Do note that this was
ran with a smart cache HIT, so no generation occurred.


![image](https://github.com/user-attachments/assets/3efa71ab-972b-4f5a-acab-0892496ef999)

Much lower worst-case for /datum/asset/New (which includes
`create_spritesheets()` and `register()`)


![image](https://github.com/user-attachments/assets/9ad8ceee-7bd6-4c48-b5f3-006520f527ef)

Here's a look at the internal costs from rustg - as you can see
`generate_spritesheet()` is very fast:


![image](https://github.com/user-attachments/assets/e6892c28-8c31-4af5-96d4-501e966d0ce9)

### Comparison for a single spritesheet - chat spritesheet:

**Before**


![image](https://github.com/user-attachments/assets/cbd65787-42ba-4278-a45c-bd3d538da986)

**After**


![image](https://github.com/user-attachments/assets/d750899a-bd07-4b57-80fb-420fcc0ae416)

## Changelog

🆑
fix: Fixed lizard body markings and ethereal feature previews in the
preference menu missing some overlays.
refactor: Optimized spritesheet asset generation greatly using rustg
IconForge, greatly reducing post-initialization lag as well as reducing
init times and saving server computation.
config: Added 'smart' asset caching, for batched rustg IconForge
spritesheets. It is persistent and suitable for use on local, with
automatic invalidation.
add: Added admin verbs - Debug -> Clear Smart/Legacy Asset Cache for
spritesheets.
fix: Fixed R&D console icons breaking on WebView2/516
/🆑
2025-03-03 14:58:27 +01:00
Majkl-J 254cd32c93 Merge branch 'master' of https://github.com/Bubberstation/Bubberstation into upstream-25-02a 2025-02-25 06:56:39 -08:00
Jacquerel 8c6062e948 Traitor Reputation does not scale with population & reintroduces population locked items (#89617)
## About The Pull Request

Closes #89617

Prior to progression traitor some items were only available with a
minimum number of (normally 25) players in the round.
These items were:
- The dual esword
- Noslip shoes
- The ebow
- Holoparasite
- Sleeping Carp
- Contractor Kit
- Maybe a couple of others that I forgot to write down

When we moved to a progression system this concept was merged with
reputation; under 20 players your reputation would advance more slowly
thus making these "dangerous" items less obtainable and also serving as
a sort of scaling factor on rewards (with fewer players the secondary
objectives are easier to complete, so the reward is commesurately
lower).

Now that we have removed secondary objectives this doesn't really make
sense any more, so now reputation simply advances at a rate of one
second per second all the time, but that leaves the old population locks
in question.

So... I just recoded items that are only available when there are enough
players

![image](https://github.com/user-attachments/assets/206577f0-dfdb-4b53-a00f-36e39b2a7f44)

![image](https://github.com/user-attachments/assets/8f840168-9550-4c77-aad0-cb87beb20499)
(This iconography simply vanishes once the pop level is reached).

Note that this is based on "players who have joined" (roundstart +
latejoin), not "players who are online" or "players who are alive".
Once an item becomes available it will never stop being available, but
it only becomes available based on people who are playing and not
watching.

Currently the only items I applied this to (with a value of 20 players)
are:
- Dual esword
- Sleeping Carp
- Spider Extract (the spider antagonist usually requires like 27
players)
- Romerol

It isn't applied to anything else.

## Why It's Good For The Game

Reputation isn't really a tool used to designate how dangerous an item
is any more (if it ever was) and resultingly it doesn't make any sense
to slow its gain based on population.
Some items though we maybe still don't want to show up in a "low pop"
round because they'll create an overall unsatisfying experience, so we
should be able to remove those items from play.

## Changelog

🆑
balance: Traitor reputation now advances at a fixed rate, not dependent
on current server population.
balance: The dual esword, sleeping carp scroll, spider extract, and
romerol vial cannot be purchased if fewer than 20 players have joined
the game.
/🆑
2025-02-22 22:38:40 +00:00
Majkl-J b6b8306fda Merge branch 'master' of https://github.com/tgstation/tgstation into upstream-25-02a 2025-02-20 00:00:19 -08:00
itsmeow 0ab9b55a1f RTD Icon Improvements (#89491)
## About The Pull Request

RTDs try to use tile item icons instead of turf icons for code that was
clearly intended to work with turfs themselves (they support combination
dirs, but none of the items actually have these!)

They also recreate datums with static data *every single time* you
select a new tile in *each individual RTD*. They now make much smarter
use of this data and quit storing stuff inside temporary datums that get
deleted every time you select something else.

FYI this thing is still pretty busted but I don't have time to fix every
problem with it. I'm mainly doing this to get rid of the Turn() procs
and broken, nonexistent dirs being inserted into the spritesheet for
#89478.

## Why It's Good For The Game

Code improvements, better previews of the turfs you're going to get in
the RTD.


![image](https://github.com/user-attachments/assets/3732370b-36ba-4221-8571-e80a20ff21d8)

## Changelog

🆑
tweak: RTDs now show the icon of the actual turf being placed rather
than its tile item.
/🆑
2025-02-17 00:20:56 +01:00
nevimer 371eaa1a61 Investigate Stat Panel as a Stutter cause (#2201)
Test PR

---------

Co-authored-by: Waterpig <49160555+Majkl-J@users.noreply.github.com>
2025-02-14 20:47:52 +01:00
MichiRecRoom 0d3c813c67 [NO GBP] Fix-up a line I missed during refactoring in my icon_exists optimization PR (#89374)
## About The Pull Request
While porting https://github.com/tgstation/tgstation/pull/89357 over to
monkestation, I found that I missed refactoring a couple lines in
`code\modules\asset_cache\assets\vending.dm`. This PR fixes that.

The changed code is all behind `if
(PERFORM_ALL_TESTS(focus_only/invalid_vending_machine_icon_states))`.
This means the changed code will only be executed if unit tests are
enabled *and* `invalid_vending_machine_icon_states` is a test that will
be run.

Despite that, I feel this code may be marginally faster, as the use of
`icon_states()` is now behind `!icon_exists()`.

## Why It's Good For The Game
Gotta go ever so slightly faster.
2025-02-08 15:19:53 -08:00
MichiRecRoom 344d3b6266 Optimizes /proc/icon_exists() (#89357)
## About The Pull Request
This PR reimplements https://github.com/tgstation/tgstation/pull/71538
atop `master`. Quoting the original PR:

> Every `icon_exists()` call will cache the entire file. Past me didn't
realise _why_ file opts were so expensive, but I do now. This is
immeasurably slower on a single call, and _significantly_ faster on
subsequent calls to the same file.

I attempted to handle some of the review comments that were posted
there, by splitting screaming functionality into its own proc.

* `if(icon_state in icon_states(file))` and `if(!(icon_state in
icon_states(file)))` were refactored to use `icon_exists(file,
icon_state)`.
* Where screaming was seemingly wanted (and where there wasn't a more
descriptive error inside the `if` block), I refactored them to use
`icon_exists_or_scream(file, icon_state)`
* The exception to the above was under
`/datum/unit_test/turf_icons/Run()` and
`/datum/unit_test/worn_icons/Run()`, where `icon_states()` was being
passed a mode flag. Given that this is only used in unit tests (where
performance isn't a priority), I opted to leave these be.

Additionally, I revised the documentation comment for
`/proc/icon_exists()`, as I felt it was a bit vague currently.

## Why It's Good For The Game
https://youtu.be/Z9G1Mf6TZRs

## Changelog
No player-facing changes (hopefully).

---------

Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
2025-02-05 20:00:27 +01:00
John Willard 2e4d70afe5 Updates href uses for 516 (#88699)
## About The Pull Request

Was just scrolling through the Paradise github since they seem to have
more work done for 516 to see if there's anything I can port over, found
this and thought why not.

Ports parts of https://github.com/ParadiseSS13/Paradise/pull/25105
Specifically, updaing all hrefs to use the internal ``byond://``, and
adding it to grep.

## Why It's Good For The Game

More work towards 516.

## Changelog

Nothing player-facing.
2024-12-24 11:42:20 -08:00
Boviro 5d06e7af9a PaperworkWarden, or, giving the Warden a custom stamp (#2422)
<!-- 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

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->
Adds a stamp for the Warden role, and adds it to the Warden's locker
structure
<!-- Please make sure to actually test your PRs. If you have not tested
your PR mention it. -->

## Why It's Good For The Game

<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->
The warden has a fair amount of paperwork that they can handle instead
of the Head of Security, and is sometimes expected to handle, like
search warrants. It seems understandable that they are given a stamp so
they can do so properly.

## Proof Of Testing

<!-- Compile and run your code locally. Make sure it works. This is the
place to show off your changes! We are not responsible for testing your
features. -->

![image](https://github.com/user-attachments/assets/8bbe7190-9638-452c-b14e-773ca3335d0f)

![image](https://github.com/user-attachments/assets/a888cc41-ac45-46ed-a364-dd2a4a8324d1)

![image](https://github.com/user-attachments/assets/1f1d34c3-3118-485f-a7ff-cda30ad1aa88)

![image](https://github.com/user-attachments/assets/0377eb85-7546-47bb-af4c-d1c0b59101cd)

## 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 its 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: gives the warden a stamp
/🆑

<!-- 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. -->

<!-- By opening a pull request. You have read and understood the
repository rules located on the main README.md on this project. -->
2024-11-15 02:20:19 +00:00
Penelope Haze 9d618cd448 Check icon state existence in spritesheet insert (#86959)
## About The Pull Request
Adds a check for icon state existence in spritesheet insert, run during
unit tests.

## Why It's Good For The Game
Inserting a nonexistent icon state via `Insert()` will corrupt the
spritesheet it's inserted to, resulting in offsets being
incorrect—specifically, it results in the entire icon's contents being
inserted. This happened downstream on Doppler Shift and broke language
icons. I fixed the issue there but figured that there should be a check
upstream for it.

`if (!I || !length(icon_states(I))) // that direction or state doesn't
exist)` This check doesn't catch it, by the way. Since it returns the
entire icon file, `length(icon_states(I))` is >0. You could do
`length(icon_states) != 1`, but then it still wouldn't catch cases where
there's a single-icon-state icon *and* the icon_state is invalid. Boo. A
test like this is the best option.

I tried using the rust-g variant of icon_states and sort-of got it
working, but I figured it'd be too fragile to justify given that it
doesn't accept actual icon instances, only paths.
2024-11-11 00:41:54 -08:00
Majkl-J e59d8ba64b Merge commit '179a607a90ad7ec62bdaff4e6fe72af60ee56442' of https://github.com/tgstation/tgstation into upstream-24-10b 2024-10-23 23:27:16 -07:00
Majkl-J f8faccd70a Merge branch 'master' of https://github.com/Skyrat-SS13/Skyrat-tg into upstream-24-10a 2024-10-20 04:12:02 -07:00
Waterpig bb70889f6e TG Upstream Part 1
3591 individual conflicts

Update build.js

Update install_node.sh

Update byond.js

oh my fucking god

hat

slow

huh

holy shit

we all fall down

2 more I missed

2900 individual conflicts

2700 Individual conflicts

replaces yarn file with tg version, bumping us down to 2200-ish

Down to 2000 individual conflicts

140 down

mmm

aaaaaaaaaaaaaaaaaaa

not yt

575

soon

900 individual conflicts

600 individual conflicts, 121 file conflicts

im not okay

160 across 19 files

29 in 4 files

0 conflicts, compiletime fix time

some minor incap stuff

missed ticks

weird dupe definition stuff

missed ticks 2

incap fixes

undefs and pie fix

Radio update and some extra minor stuff

returns a single override

no more dupe definitions, 175 compiletime errors

Unticked file fix

sound and emote stuff

honk and more radio stuff
2024-10-19 08:04:33 -07:00
Penelope Haze 4437bb5ebf Check icon state existence in spritesheet insert (#86959)
## About The Pull Request
Adds a check for icon state existence in spritesheet insert, run during
unit tests.

## Why It's Good For The Game
Inserting a nonexistent icon state via `Insert()` will corrupt the
spritesheet it's inserted to, resulting in offsets being
incorrect—specifically, it results in the entire icon's contents being
inserted. This happened downstream on Doppler Shift and broke language
icons. I fixed the issue there but figured that there should be a check
upstream for it.

`if (!I || !length(icon_states(I))) // that direction or state doesn't
exist)` This check doesn't catch it, by the way. Since it returns the
entire icon file, `length(icon_states(I))` is >0. You could do
`length(icon_states) != 1`, but then it still wouldn't catch cases where
there's a single-icon-state icon *and* the icon_state is invalid. Boo. A
test like this is the best option.

I tried using the rust-g variant of icon_states and sort-of got it
working, but I figured it'd be too fragile to justify given that it
doesn't accept actual icon instances, only paths.
2024-10-04 02:47:38 +02:00
SmArtKar d4ac95a0e1 Nobody expects the span inquisition: replaces most <span>s with macros (#86798)
## About The Pull Request
123 changed files and multiple crashes after writing broken regex, I
replaced most remains of direct spans with macros. This cleans up the
code and makes it easier to work with in general, see justification for
the original PR. I also fixed a bunch of broken and/or unclosed spans
here too.
I intentionally avoided replacing spans with multiple classes (in most
cases) and spans in the middle of strings as it would impact readability
(in my opinion at least) and could be done later if required.

## Why It's Good For The Game

Cleaner code, actually using our macros, fixes borked HTML in some
places. See original PR.

## Changelog
Nothing player-facing
2024-09-26 19:36:13 +00:00