About The Pull Request
Converts more inputs to TGUI. Possibly all user-facing input lists in the game.
Did any surrounding text/number inputs as well
Added null choice support so users can press cancel.
Added some misc TGUI input fixes
Fixed custom vendors while I was there
I refactored a lot of code while just poking around.
Primarily, usage of .len in files where I was already working on lists.
Some code was just awful - look at guardian.dm and its non use of early returns
If there are any disputes, I can revert it just fine, those changes are not integral to the PR.
Why It's Good For The Game
Fixes#63629Fixes#63307
Fixes custom vendors /again/
Text input is more performant.
Part of a long series of TGUI conversion to make the game more visually appealing
Changelog
cl
refactor: The majority of user facing input lists have been converted to TGUI.
refactor: Tgui text inputs now scale with entered input.
fix: Many inputs now properly accept cancelling out of the menu.
fix: Fixes an edge case where users could not press enter on number inputs.
fix: Custom vendor bluescreen.
fix: You can now press ENTER on text inputs without an entry to cancel.
/cl
I'm refactoring proximity monitors and fields, removing lots of bloat from both that's hardly even used. Proximity monitors no longer generate effect objects to track the surrounding area, should be less cpu expensive and easier to maintain (or phase out), read and use.
This PR also adds a couple components which may be needed for future stuff (for starters, the mirror reflection PR #62638 could use the connect_range comp)
Improving old old, ugly old code and adding some useful backend components. Tested and working.
Fixes#62643
Fixes aux-base turrets from hard-deleting by handling their deleting on the aux base itself.
Converts the turrets list to a proper lazylist and cleans up some surrounding code involving the turrets list.
Also fixes a copy+paste error with tiny fans being placed.
a month or two ago i realized that on master the reason why get_hearers_in_view() overtimes so much (ie one of our highest overtiming procs at highpop) is because when you transmit a radio signal over the common channel, it can take ~20 MILLISECONDS, which isnt good when 1. player verbs and commands usually execute after SendMaps processes for that tick, meaning they can execute AFTER the tick was supposed to start if master is overloaded and theres a lot of maptick 2. each of our server ticks are only 50 ms, so i started on optimizing this.
the main optimization was SSspatial_grid which allows searching through 15x15 spatial_grid_cell datums (one set for each z level) far faster than iterating over movables in view() to look for what you want. now all hearing sensitive movables in the 5x5 areas associated with each spatial_grid_cell datum are stored in the datum (so are client mobs). when you search for one of the stored "types" (hearable or client mob) in a radius around a center, it just needs to
iterate over the cell datums in range
add the content type you want from the datums to a list
subtract contents that arent in range, then contents not in line of sight
return the list
from benchmarks, this makes short range searches like what is used with radio code (it goes over every radio connected to a radio channel that can hear the signal then calls get_hearers_in_view() to search in the radios canhear_range which is at most 3) about 3-10 times faster depending on workload. the line of sight algorithm scales well with range but not very well if it has to check LOS to > 100 objects, which seems incredibly rare for this workload, the largest range any radio in the game searches through is only 3 tiles
the second optimization is to enforce complex setter vars for radios that removes them from the global radio list if they couldnt actually receive any radio transmissions from a given frequency in the first place.
the third optimization i did was massively reduce the number of hearables on the station by making hologram projectors not hear if dont have an active call/anything that would make them need hearing. so one of hte most common non player hearables that require view iteration to find is crossed out.
also implements a variation of an idea oranges had on how to speed up get_hearers_in_view() now that ive realized that view() cant be replicated by a raycasting algorithm. it distributes pregenerated abstract /mob/oranges_ear instances to all hearables in range such that theres at max one per turf and then iterates through only those mobs to take advantage of type-specific view() optimizations and just adds up the references in each one to create the list of hearing atoms, then puts the oranges_ear mobs back into nullspace. this is about 2x as fast as the get_hearers_in_view() on master
holy FUCK its fast. like really fucking fast. the only costly part of the radio transmission pipeline i dont touch is mob/living/Hear() which takes ~100 microseconds on live but searching through every radio in the world with get_hearers_in_radio_ranges() -> get_hearers_in_view() is much faster, as well as the filtering radios step
the spatial grid searching proc is about 36 microseconds/call at 10 range and 16 microseconds at 3 range in the captains office (relatively many hearables in view), the new get_hearers_in_view() was 4.16 times faster than get_hearers_in_view_old() at 10 range and 4.59 times faster at 3 range
SSspatial_grid could be used for a lot more things other than just radio and say code, i just didnt implement it. for example since the cells are datums you could get all cells in a radius then register for new objects entering them then activate when a player enters your radius. this is something that would require either very expensive view() calls or iterating over every player in the global list and calling get_dist() on them which isnt that expensive but is still worse than it needs to be
on normal get_hearers_in_view cost the new version that uses /mob/oranges_ear instances is about 2x faster than the old version, especially since the number of hearing sensitive movables has been brought down dramatically.
with get_hearers_in_view_oranges_ear() being the benchmark proc that implements this system and get_hearers_in_view() being a slightly optimized version of the version we have on master, get_hearers_in_view_as() being a more optimized version of the one we have on master, and get_hearers_in_LOS() being the raycasting version currently only used for radios because it cant replicate view()'s behavior perfectly.
About The Pull Request
I have received exemption from the freeze by Oranges.
This PR was originally done for Skyrat-tg, as a bounty. Oranges took interest and Skyrat people approved taking it upstream so I did. (original PR Skyrat-SS13/Skyrat-tg#9912 )
Features:
This PR adds "field of view" mechanics, which by default don't do anything.
Once you pick up and wear a gas mask you'll notice a cone behind you.
That cone will hide all mobs, projectiles and projectile effects.
HOWEVER... hidden things in the cone (or for people who are blind or nearsighted) will play a visual effect.
The fov cone shadow density can be adjusted
Technicalities:
Originally a component, but by Watermelon's advice I have made this a datumized behaviour instead. (semi-component) This way it is faster, less memory use etc. Once again a component
People have native fov, which can be enabled by a config, by default it's off. (or by an admin verb)
People have fov traits, which add the fov impairings to you, gas masks do that now. All clothes have a support for possibly applying them.
Moves all things that should be hidden onto a new plane which is just above GAME_PLANE, that was we can efficiently filter them out of clients views.
Being dead or extending your eye view (xenobio console) will disable the FOV mask.
This PR was brought to you by Skyrat paying me aswell as rotational mathematics
Why It's Good For The Game
Oranges approves so it's good.
Changelog
cl
add: Gas Masks now limit your field of view
add: Added field of view mechanics. It's darkness can be tweaked by a pref
add: Blind, nearsighted and fov-limited people will now see sounds as visual effects.
/cl
* Removes like 50% of the cost of using the ui, it turns out that the storage component is fucking moronic. Likely significantly reduces the overtime of typecacheof
* Reduces the cost of reloading the dummy by ~50%
Turns out just initializing and deleting organs was like half the cost of reloading a default dummy.
It occured to me (Mothblocks) that we don't actually care about any organs we can't see or that don't effect visuals. So almost all of our organ loading can just be skipped.
This saves a significant chunk of cpu time, items next!
Co-authored-by: Seth Scherer <supernovaa41@gmx.com>
* Bags onto coats
* Bags fit onto wintercoats suit slot
* Bags fit onto suits suit storage slot
* Bags fit onto suits suit storage slot
* Adding mirror tray sprite to belt_mirror.dmi
* Bags fit onto suits suit storage slot
* Construction bag fits into hazard vest suit storage slot
* Fixes and hazard vest/explorer suit expansion
* Explorer suit ore bag
* Once again fix
* Even once more fix
* More and more fixes
* We love fixes. I hope its the last one
* Im back here once again. Fix
About The Pull Request
Gasmaks apply a darkening overlay similar to the welding one but much lighter and open.
Without mask
nomask
With mask
covid
With mask and sunglasses
image
Note that other items that apply tint haven't been changed if worn on their own (sunglasses don't darken the vision) but will increase the darkening effect if staked (mask + sunglasses will give an even darker overlay).
Oranges' approval
dad2
Why It's Good For The Game
All upside and no downside are no fun.
Changelog
cl
balance: gasmasks give a slightly darkening overlay, effect will stack with other items that have tint.
code: tint code has been updated to properly work.
/cl
About The Pull Request
Wall items mostly use the direction from the floor to the wall in the named mapping helper. Wall items mostly use the direction from the wall to the floor for the internal dir variable.
This leads to a headache when it comes to working out what conflicts with what, and what needs placing where.
Wall frames provided a member, inverse, which specified whether or not to invert the direction of the item when looking for conflicts. It was also used to specify whether to look for conflicts outside of the wall (cameras and lights appear external to the wall) or inside the wall (most wall items). This flag was set for Intercoms, APCs, and Lights. Since APCs and Lights expect a floor-to-wall direction, and Intercoms expect a wall-to-floor direction, this means that APCs and Lights were getting the correct direction, and Intercoms were getting the wrong direction.
Some implications of this setup were:
You could build an APC on top of another wall item, provided there was nothing external attached to the wall and the area didn't have an APC.
You could stack Intercoms indefinitely on top of the same wall, provided you weren't in a one-tile wide corridor with something on the opposite wall.
Or both! Here's twenty Intercoms placed on the wall, and a freshly placed APC frame after placing all Intercoms and deconstructing the old APC:
endless-stack-of-intercoms
Not everything used this inverse variable to adjust to the correct direction. For example, /obj/machinery/defibrillator_mount just used a negative pixel_offset to be visually placed in the correct direction, even though the internal direction was wrong, and never set! This also let you stack an indefinite number of defib mounts on the same wall, provided it wasn't a northern wall... except you could do this to northern walls too, since defibs weren't considered a wall item for the purposes of checking collisions at all!
Ultimately, every constructable interior wall item either used this inverse variable to adjust to the correct placement, set a negative pixel_offset variable to have its offset adjusted to the correct placement, or overrode New or Initialize to run its own checks and assignment to pixel_x and pixel_y!
Inventory: Table of various paths, related paths, and the adjustments they used
Unfortunately, untangling /obj/structure/sign is going to be another major headache, and this has already exploded in scope enough already, so we can't get rid of the get_turf_pixel call just yet. This also doesn't fix problems with the special 2x1 /obj/structure/sign/barsign.
Some non-wall items have been made to use the new MAPPING_DIRECTIONAL_HELPERS as part of the directional cleanup.
tl;dr: All wall mounted items and some directional objects now use the same direction that they were labelled as. More consistent directional types everywhere.
Why It's Good For The Game
fml
Changelog
cl
refactor: Wall mounted and directional objects have undergone major internal simplification. Please report anything unusual!
fix: You can no longer stack an indefinite amount of Intercoms on the same wall.
fix: Defibrillator Mounts, Bluespace Gas Vendors, Turret Controlers, and Ticket Machines are now considered wall items.
fix: Wall mounted items on top of the wall now consistently check against other items on top of the wall, and items coming out of the wall now consistently check against other items coming out of the wall.
fix: The various directional pixel offsets within an APC, Fire Extinguisher Cabinet, Intercom, or Newscaster have been made consistent with each other.
fix: The pixel offsets of Intercoms, Fire Alarms, Fire Extinguisher Cabinets, Flashers, and Newscasters have been made consistent between roundstart and constructed instances.
fix: Constructed Turret Controls will no longer oddly overhang the wall they were placed on.
qol: Defibrillator mounts now better indicate which side of the wall they are on.
fix: Some instances where there were multiple identical lights on the same tile have been fixed to only have one.
/cl
Implements the Modernizing radiation design document ( https://hackmd.io/@tgstation/rJNIyeBHt ) and replaces the current radiation sources with the new system, as well as replacing/removing a bunch of old consumers of radiation that either had no reason to exist, or could be replaced by something else.
Diverges from the doc in that items radiation don't go up like explained. I was going to, but items get irradiated so easily that it just feels pretty lame. Items still get irradiated, but it's mostly just so that radiation sources look cooler (wow, lots of stuff around going green), and for things like the geiger counter.
Instead of the complicated radiation_wave system, radiation now just checks everything between the radiation source and the potential target, losing power along the way based on the radiation insulation of whats in between. If this reaches too low a point (specified by radiation_pulse consumers), then the radiation will not pass. Otherwise, will roll a chance to irradiate. Uranium structures allow a delay before irradiating, so stay away!
About The Pull Request
Ever since I saw @EOBGames PR this, I've wanted it. I've needed it. I've been delaying some mapwork FOR this. This is an identical PR to #61689, just updated so that it's not conflicting with anything. I've done everything @Krysonism asked for from last time too. That's right spacemen, double beds are back, and more cursed then ever. Cursed to succeed that is!
Why It's Good For The Game
We. Don't. Have. Benches.
Benches are a hallmark of any public space! You can sit on them, sleep on them, stand on them, even sleep on them! Our stations have a ton of chairs, but chairs don't really communicate public that well. Benches do. As for the beds? Well Inept wants them, and you know what? I respect that.
cl
expansion: Sofas now include the Bench Type. These are buildable with 2 metal plates from the crafting menu.
expansion: Beds can now be rotated (flipped), and include the Double Bed Type. Miners can also make Double Pod Beds to really feel like an Alaskan King.
expansion: Bedsheets to match! Try to share those big blankets with a lizard if you see that they're shivering!
code: Stuff that lets you interact with the benches and beds in-game, so that you too can enjoy being a king.
sprites: Ports the Benches and Double Bed sprites from Skyrat
sprites: Flipped Beds
human huds will no longer runtime and die when prefs aren't initalised
SSEconomy will no longer have to deal with pathed jobs inside accounts
Some of the negative/neutral quirks that use the mind have been relegated to last_mind instead for runtime purposes
Mafia saymode will no longer runtime when someone uses it with no current mafia game
Autolathe secondary_attack will no longer runtime/work only because of runtimes
MULTIPLE CHECKS FOR QDELETED STACKS BEFORE ADDING FINGERPRINTS
More player_list client checks
A lazyinitlist for proximity monitors, as they used lazyremove which nulls the list when it hits zero things in it
A check for cigarettes in case temperature exposure causes a reaction that removes all reagents
Catwalks no longer runtime every time someone walks on them
/obj/machinery/atmospherics/components/binary/crystallizer will no longer runtime on secondary_attack if someone can't interact
cyborg models will no longer assume the thing they're inside is a cyborg and runtime when it isn't (cryopods)
When a simplemob falls into nullspace, it will no longer runtime (goliaths falling into chasms and etc)
runtime fix in techweb.dm when using a card without a sanity check
runtime fix with folders when they have nothing in them
runtime fix with glowing eyes when the LAZYADD doesn't get called in regenerate_light_effets() and so doesn't initalise the list
They can only have electronics inserted if they
are welded shut (if they can be welded)
don't have electronics already and aren't secure
They can only have electronics removed if they
are welded shut (if they can be welded)
are unlocked
are secure (even if they don't have electronics, then it'll create them)
Basically makes the code less dumb, took a long time. I worked hard to make sure there were no unintended effects (minus the fact you can no longer get spoons from the experimentor). No player-facing effects
I thought it looked weird that all cultist and combat knives were subtypes of the kitchen knives
Creates two procs in /mob/status_procs for handling drowsiness changes (with check for negative values), and refactors all code to use these procs instead of assigning values to the mob's drowsiness themselves.
major cleanup of modules/atmospherics folder and all related files, still many missing
-cleanup of procs name
-cleanup of vars name
-documentation of some of the procs
-minor changes to some for() logic (no in game changes just early continue or as anything checks)
No in game changes, only code and docs
Bring _HELPERS/_lists.dm to latest standards by:
-Adding proper documentation and fixing existing one
-Giving vars proper names
-Procs now use snake case as per standard (many files that use those procs will be affected)
Please don't try and send chat messages if you have nothing to say
Fixes a spurious runtime.
Fixes a runtime caused by my lack of understanding of huds. remove_hud_from is intended for hud watchers, remove_from_hud is intended for hud items. Doesn't really make sense most of the time, and just runtimes out the ass
Fixes a runtime in shapeshifting, restore should not run if the object is not restoring, or if it's deleting. it should run if it's not restoring, and it's not deleted. 4head
Fun fact, if there's two turret control boards they'll override each other. Use weakrefs. Oh also removes a var called cp, nothing good will come of that
Today in: Good lord the stacking machine is an afront to god, we discover that the labor claims console was attempting to act as a console, which of course fails when it comes time to clear it's improperly named var. Disgusting
Attempts to fix potential wound ref hangs in surgeries? maybe?
Fixes a runtime in luminescent stuff I created in my big harddel crusade. owner is a mob, not a species
Fixes a runtime related to headspikes deleting themselves twice. Pain
Fixes hard deletes sourced from the prophet trauma. Good fucking lord this is awful
Offhand item is somehow hard deleting. I have no idea how. Here's hoping signals fixes it, because if it doesn't I'm stumped. It's not a common scenario, but it does happen in spurts that suggest repeated usage
bring code up to latest standards, move many procs to named files inside _HELPERS
no idea where to put some of these procs, help is appreciated
made more files to contain some unique code, deleted unsorted.dm, we can rest now
## About The Pull Request
stop forgetting to include mapload, if you don't include it then every single subtype past it by default doesn't include it
for example, `obj/item` didn't include mapload so every single item by default didn't fill in mapload

## Regex used:
procs without args, not even regex
`/Initialize()`
procs with args
`\/Initialize\((?!mapload)((.)*\w)?`
cleanup of things i didn't want to mapload:
`\/datum\/(.)*\/Initialize\(mapload`
Bluespace anomalies detonating Move() things. When something is Move()d, none of the logic in forceMove() or doMove() is called, and thus stationloving things can't tell when they've left the z-level (since that's where the logic for it is).
There are a number of approaches I could have taken: Refactoring anomalies to use different movement code. Refactoring Movement code to send more signals in various scenarios. Refactoring the stationloving component.
I settled on two steps. First, refactoring the component to bring it up to modern code standards. Second, moving the logic for COMSIG_MOVABLE_Z_CHANGED to Moved() so the signal always fires regardless of if Move() or forceMove() or doMove() is used, with an optional var for whether the z-change is communicated to contents. This means the ore box was changed to actually send the signal instead of just returning with no parent call or signal sent. Stationloving ore boxes when?
stationloving procs no longer call SIGNAL_HANDLERs directly. Var names are now more descriptive. Things are renamed and documented. At least for the parts of the code I know.
Probably some other code cleanups.
the Auxbase console is a subtype of consoles, despite being a wallmount, therefore it inherits consoles density = TRUE, despite being on a wall
this means that you get THIS ..... its on the WALL and the tile is EMPTY, but you cant step onto it, because the consoles there technically and dense
(I feel i should clarify before its asked: when a console is deconstructed it spawns a new console frame and copies the circuit over, that new frame will be dense again. so it only lacks density once its finished and on the wall)
This is not a species granted trait, seems it was like this out of laziness but correct me if you know better
(Arm: It's just a remnant of angel's being a species in the past)
Merged the item/melee/classic_baton and item/melee/baton families in this unholy matrimony.
Bad jokes aside. I have refactored the underlying code of both items with the scope of reducing potential copypasta,inconsistencies, logging, renewing some old code (like teleprods) and extending the anti-dual batoning and TRAIT_STUNRESISTANCE code** to all batons and not just security ones. Otherwise, I have tried to maintain the gameplay functionality of these items intact. They work just like they did for the most part.
** A badly designed feature that only considers one source of knockdowns - stunbatons - out of a multitude of different devices with corresponding purposes present in the game. The only thing it does is reduce the knockdown from them by 90%. The stamina damage and confusion are fully applied. The knockdown from batons is 5 seconds, standing up takes an extra 1 second and the baton cooldown is about 2.5. Doing the math, you'll have the grand advantage of one puny second of not lying horizontal on the floor with this trait before getting batoned again by the same guy because the stamina damage and the confusion have really hampered your chances of getting some distance. I wish to make the trait suck less in the future, but for now I'm including a slight gameplay change here, more for consistency than anything because as I already told you, it'll still be disappointingly bad per se.
The abductor baton is also no more a subtype of stun batons but batons, which don't use power cells to work. Its power cell is effectively infinite and can't be removed, and It overrides functions such as toggling the baton on/off. It hinders maintainability to keep it a subtype of stun batons.
Replaced the anchored check for mobs in teleprods with one for overwhelming move resistance and removed its clumsy_check copypasta (it was stunning clowns twices).
Wormhole jaunters will now save the user from a chasm if they fall in and it's on their belt. Wormhole jaunters also are affected by EMP correctly. Before it would only be affected by an EMP if it was in the belt storage area which made no sense.
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
(Lots of good work here, thank you tim)
Lava staffs were not terraforming regular lava into empty tiles. This is because it was only checking to see if the lava type was the same weak lava the staff spawns. It has now been fixed to check for all lava types.
In remembrance of all those people who used jump boots to cross lava unaware of an issue c*ders wouldn't fix....
EDIT: This is now a lava and weather immunities refactor:
Weather immunities are now status traits since they have a multitude of sources (especially for lava) which might conflict with one another otherwise.
The lava burn_stuff proc has also been been refactored in different procs, mostly because of that snowdin subtype with inconsistent, old checks.
Weather datums should now use can_weather_act instead of weather_act to check if something can be affected by weather or not, as they should.
All movables can protect contained mobs if they have the relative weather immunity traits. This works at any contents depth.
No more snowflake weather_protection variable for closets.
Removed the weather_immunities list from living mobs (simple animals still have it but it's only for traits assignment on init because way too many child types lack the immunities of their parents).
Removed some unused defines.
Renamed some variables as per guidelines.
It has been tested.
And yea, jump boots fixed because that's the original scope of this PR.
(Initially just made throwing make you fire immune, that was blocked because it breaks perma stuff, instead it ended up be a refactor to make jumpboots usable with weather immumnity stuff