Commit Graph

15037 Commits

Author SHA1 Message Date
MrMelbert
bae0967b8e Stops aux base turrets from hard-deleting (and 1 other fix) (#63424)
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.
2021-12-17 11:49:22 +00:00
Kylerace
d005d76f0b Fixes Massive Radio Overtime, Implements a Spatial Grid System for Faster Searching Over Areas (#61422)
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.
2021-12-16 19:49:27 -08:00
Seth Scherer
cd607d1770 Updates /code/game/objects/item/food/* to follow the style guide (#63051)
Updates every file in /code/game/objects/item/food/ to follow the style guide.
2021-12-16 01:28:19 -08:00
Azarak
19329cd74a Fixes objects with bad planes and FoV bugs (#63412) 2021-12-15 16:59:56 -08:00
Jeremiah
d17a60fb53 TGUI input box conversions 2 (#63395)
More text inputs converted to tgui, TGUI text and number input now more sanely handles ENTER key being pressed, you can now press anywhere in the window to enter the input. TGUI text input now considers placeholder text for the default valid state. IE, if there is default text you can press enter immediately without having to rewrite it just to recheck validity. Fixes: useSharedState => useLocalState. not only was sharedstate not needed but it opened up the ui to vulnerabilities
2021-12-15 14:12:04 -08:00
vincentiusvin
d69dd1f1dd Fixed rough iron false wall alert text and rough iron wall deconstruction amount. (#63389) 2021-12-15 01:08:41 -08:00
John Willard
2834383245 Makes all default job titles, defines. (#63357)
Jesus christ we were just waiting for someone to misspell something eh?
2021-12-14 17:48:46 -08:00
tralezab
82615e7462 Super Mega Mob Spawn Refactor (#63279)
About The Super Hyper Ultra Ultimate Deluxe Perfect Amazing Shining Mob Spawn Refactor

The Super Hyper Ultra Ultimate Deluxe Perfect Amazing Shining Mob Spawn Refactor is my attempt to clean up the file structure, the code, and the type tree for mob spawns.

    Splits mob spawn types into corpses (dead spawns) and ghost roles (living spawns you can possess). The vars that didn't make sense for corpses and vice versa for ghost roles are now appropriately there
    Because of above, there are no longer the fucking "death, roundstart, and instant" vars. thank god
    Removes a lot of single or very few used vars, whose properties can be applied on special().
    All Mob Spawns are given fitting folders instead of just being stuck in a single ghost roles file. Corpses are in the corpse folder, Ghost Roles are in the ghost role folder. Only exception are drones which should stay near their respective homes
    Just generally cleaner all around you know
    spider structures file renamed to spiderwebs now that spider eggs are gone

Why Super Hyper Ultra Ultimate Deluxe Perfect Amazing Shining Mob Spawn Refactor Is Good For The Game

The Super Hyper Ultra Ultimate Deluxe Perfect Amazing Shining Mob Spawn Refactor cleans up so many terrible cases and uses
Changelog For The Super Hyper Ultra Ultimate Deluxe Perfect Amazing Shining Mob Spawn Refactor

cl armhulen
refactor: Mob spawns are refactored, no more assortment of "random, instant, and roundstart" vars on every mob spawn type
refactor: if there are some minimal differences in how mob spawners feel, that's why!
/cl
2021-12-15 11:13:21 +13:00
LemonInTheDark
4610f700eb Fixes up multiz atmos connection, cleans some things up in general (#63270)
About The Pull Request

ALLLRIGHT so
Multiz atmos was letting gas flow down into things that should be well, not flowable into
Like say doors, or windows.

This is weird.

Let's get into some context on why yeah?

First, how do things work currently?

atoms have a can_atmos_pass var defined on them. This points to a define that describes how they interact with
flow.
ATMOS_PASS_NO means well, if we're asked, block any attempts at flow. This is what walls use.
ATMOS_PASS_YES means the inverse
ATMOS_PASS_DENSITY means check our current density
ATMOS_PASS_PROC means call can_atmos_pass, we need some more details about this attempt

These are effectively optimizations.

That var, can_atmos_pass is accessed by CANATMOSPASS() the macro
It's used for 3 things.

1: Can this turf share at all?
2: Can this turf share with another turf
3: Does this atom block a share to another turf

All of this logic is bundled together to weed out the weak.

Anyway, so when we added multiz atmos, we effectively made a second version of this system, but for vertical
checks.

Issue here, we don't actually need to.
The only time we care if a check is vertical or not is if we're talking to another turf, it's not like you'll
have an object that only wants to block vertical atmos.
And even if you did, that's what ATMOS_PASS_PROC is for.

As it stands we need to either ignore any object behavior, or just duplicate can_atmos_pass but again.
Silly.

So I've merged the two, and added an arg to mark if this is a verical attempt.
This'll fix things that really should block up/down but don't, like windows and doors and such.

Past that, I've cleaned can_atmos_pass up a bit so it's easier for people to understand in future.
Oh and I removed the second CANATMOSPASS from immediate_calculate_adjacent_turfs.
It isn't a huge optimization, and it's just not functional.

It ties into zAirOut and zAirIn, both of which expect to be called with a valid direction.
So if say, you open a door that's currently blocking space from leaking in from above, you end up with the door
just not asking the space above if it wants to share, since the door can't zAirOut with itself.

Let's just wipe it out.

This makes the other code much cleaner too, heals the soul.

Anyway yadeyada old as ass bug, peace is restored to the kingdom, none noticed this somehow you'd think people
would notice window plasma, etc etc.
Why It's Good For The Game

MUH SIMULATION
Also fuck window gas
Changelog

cl
fix: Fixed gas flowing into windows from above, I am.... so tired
fix: Fixes gas sometimes not moving up from below after a structure change, see above
/cl
2021-12-14 15:57:59 +13:00
Azarak
680ca7d3b9 Field of View and Blindness improvements [bounty + upstream push] (#63312)
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
2021-12-14 15:52:52 +13:00
Tony
f397f72377 Health scanner readability improvements + code cleanup (#63340)
Co-authored-by: bumtickley00 <pebis@lol.com>
2021-12-12 10:56:17 -08:00
Ghom
48ff9fde3a Fixing and making PDA bomb logging less confusing. (#63302) 2021-12-12 03:50:48 -08:00
Jeremiah
1052bc19ed TGUI input box conversions 1 (#63313) 2021-12-11 14:21:35 -08:00
John Willard
324a33f606 Bot code improvement part 3 - Removes bot core. (#63321)
This deletes bot_core entirely, instead the access required is on the bot itself

My previous refactor broke bot access cover requirements, and that bug is what inspired me to make this refactor.
This is a stupid thing to have on the bot, I have no idea why it is a thing, and has only ever confused me since the very start. I find this functions better, and makes the code more easy to understand.

Closes #63259
2021-12-11 14:02:08 +00:00
Jeremiah
60922e7cfc TGUI list input conversions (#63315)
Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com>
Co-authored-by: Sealed101 <75863639+Sealed101@users.noreply.github.com>
2021-12-10 02:20:01 -08:00
Seris02
fa22f80262 fixes bots getting stuck on railings and crashing clients (#63306)
Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
2021-12-10 02:12:35 -08:00
EOBGames
cf899a1821 Moth Food Returns: A Taste of the Fleet (#63174) 2021-12-09 21:41:36 -08:00
BlueMemesauce
2ee3d602fc Increases volume of the sound effect for knocking on firelocks (#63053)
Changed firelocks to have the same bash and knock sound effects as windows.
Which increases the volume of the knock sound effect and also adds the bash sound effect.

Also improves some of the code for firelock and window

Firelocks already had the knock sound effect, but it is so quiet that you can barely hear it. The volume should be increased so that people can hear it.
2021-12-09 16:45:47 -08:00
Bond
d2efad15c2 Fixes buckling onto tiles with dense atoms (#63277)
Before this change, you could put a dense object (like a computer frame) over a chair and buckle to it. This fixes that
2021-12-09 16:54:13 +00:00
LemonInTheDark
9b605b9cc0 Speeds up the preference menu, significantly. Adds object pooling, other stuff too (#63225)
* 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>
2021-12-08 16:20:03 -08:00
vincentiusvin
3bb8424d78 Makes welding plasma bars/statues/floors use flooder component (#63154)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2021-12-08 16:14:28 -08:00
John Willard
bbdbe79049 Magic mirror: Fixes changing races & code improvement (#63201)
All mirrors now use the same Initialize(), with a var determining which flag to check.
Improves some of the code with better var names and early returns.
Moves pride ruin's mirror to the rest of the mirrors
Removes /curse() proc, replaces it with Pride's mirror just calling parent instead, since it was the only mirror that used it.
Also fixes not being able to change races with the mirror.
2021-12-07 12:15:08 -08:00
RandomGamer123
e52fc6aa9f Stops transit tube dispensers from transporting anchored objects such as immovable rods (#63108)
Stops transit tube dispensers from transporting anchored objects such as immovable rods
2021-12-07 19:27:04 +00:00
Ghom
21ac10d3d4 multiz movement refactor redux (#62132) 2021-12-06 23:13:48 -08:00
GoldenAlpharex
1696f0bfe3 Adjusts the greyscale sprites of the benches (#63261)
* Adjusts the greyscale sprites of the benches

* More of a wooden color for the benches
2021-12-07 00:57:35 +01:00
maxspells
56940b8b9b Move scan results from health analyzers/other scanners from local chat to info tab (#63245)
This will change the results from a health analyzer scan to show up in the info chat tab instead of local chat. It will also do the same for gas and atmos scans, because why not.
2021-12-05 11:15:11 +00:00
Bond
12d9997910 Wethide now dries into leather after burning and grilling (#63198)
You can now dry wet hide (obtainable by skinning and wetting goliath plates or other animal hides) into leather by lighting it on fire (with a bonfire grill especially, though the heat of being on fire will dry it regardless of the origin of the fire)

This also means that ashwalkers will be able to obtain leather without getting power, since drying racks require power, which, as shown in #63195, is apparenly intended and not a bug.
2021-12-03 17:57:54 -08:00
Doctor Pope
aa034d02cd Fixed spelling of possession, separate, and cemetery (#63203)
Just fixes some spelling for gangs. I also fixed misspellings for "posession" to "possession". Fixed "seperate " to "Separate" Fixed "Cemetary" to "Cemetery"
2021-12-03 13:29:29 -08:00
vincentiusvin
1d6c77dce2 Added an examine message to wired glass tiles (#63175)
I thought that not being able to place those tiles were a bug. Seems like it's a feature.
2021-12-03 13:27:32 -08:00
MMMiracles
581cba6a1d the goat plushie can be run over (#63148)
You can now run over the plushie with the tram, splatting it into the ground

Non-joke reason: The tram now sends a signal to the destination turf, which can be used by objects to have unique interactions with the tram when being ran over.
2021-12-03 13:26:13 -08:00
Jeremiah
307ab2ab6b TGUI pAI Hotfix 1 (#63160)
Adds a new ui state so that players can access the paicard tgui while it's slotted in their PDA (inside the pda wasn't technically in the user's close inventory).
Adds some documentation for the pAI candidate file
Users now get notifications if they can't save files (guest keys).
pAIs previously had NO on screen indicator of hack progress, so I've given them a progressbar over the door
More visual output for pAIs
More output for edge cases
More documentation
Fixes #63161
2021-12-03 20:16:52 +00:00
HarseTheef
a0fdf2bceb Fixes forged agent id cards breaking wallets (#63069)
Forged agent ids no longer prevent access from being combines from cards in a wallet
2021-12-03 15:33:00 +01:00
Tom
aea7875fd0 Gives blind people a chat message when someone tries to handcuff them (#63192)
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2021-12-02 13:47:07 -08:00
Seth Scherer
24169f0d80 Updates /code/game/objects/item/{melee,tcg}/* to follow the style guide (#63130)
Co-authored-by: SuperNovaa41 <supernovaa41@protonmail.com>
2021-12-02 12:56:25 -08:00
Tom
b4d1f582fa Fixes another TK teleportation trick, but more literally (#63125)
Stop people with TK being able to instantly teleport onto weight machines
2021-12-01 13:19:20 +00:00
OrionTheFox
df27efc4e7 Catwalk Tiles have names now & can be recycled (#63142) 2021-11-30 20:37:08 -08:00
Tastyfish
554ce885ab Fixes PDA skill tracker hard lock (#63024) 2021-11-30 10:29:41 +01:00
Jeremiah
7107128fbb pAI TGUI conversion (#62916)
About The Pull Request

Does what it says! pAI interfaces, including pAI card interfaces, have all been reworked.

I spent a bit of time working with pAIs doing this, so I've changed and fixed other things in the process.

    Door jacking had little to no UI feedback
    Many of the pAI actions had little feedback
    Some of the logic was poor or not working (pAI request, for instance)

Why It's Good For The Game

    One of the worst UIs in the game is redone
    Three interfaces are now two: pAI cards and recruit window -> 1 tgui window, pAI software interface -> tgui
    Door jacking gives more feedback, including sounds and messages.
    New procs inside general and security records to fetch data
    Requesting a pAI now uses the notify_ghosts proc like most other ghost roles

Changelog

cl
refactor: pAI interfaces have been converted to TGUI.
refactor: Requesting a holographic pAI friend now correctly notifies ghosts of your loneliness.
add: pAI door jacks have been given a bit more UI feedback.
del: Requesting and downloading a pAI no longer uses two separate screens.
/cl
2021-11-30 17:34:00 +13:00
HarseTheef
dc8dde9dd0 Fixes baseball bat knockback direction (#63089)
Baseball bats now establish their direction of knockback based on the cardinal direction from the atom of the bat to the target instead of the user to the target.
2021-11-29 22:51:05 -05:00
MrMelbert
1b6fbbb20e DELTASTATION: Complete service + arrivals revamp, cargo tweaks (some maintenance was harmed in the making of this pr) (#62972) 2021-11-29 16:44:05 -07:00
GoldenAlpharex
bdc7043dda Industrial lift should no longer phase through floors and ceilings (#63067)
About The Pull Request

There was no check to see if there was a ceiling above the elevator, so you could always go up if you wanted to, you just couldn't go down.

There was also an issue where if the menu was opened and any change was made either up or down, it wouldn't be taken into account by the lift and it would do it anyway. That means that the top level could become unsuitable by someone blocking it off and the elevator wouldn't care.

Finally, should fix the issue where the radial menu doesn't update when the lift move, causing you to be able to make illegal moves because there was no sanity checks. Now there is some sanity checks, and the menu will additionally close if the elevator has moved since you opened it. Just click on it again to open it once more.

I also ended up documenting some of the code there while I was there, and improved a few variable names because they didn't follow coding standards.
Why It's Good For The Game

Going through floors and ceilings was in general a pretty bad thing about elevators. Now it shouldn't happen anymore.
Changelog

cl GoldenAlpharex
fix: Elevators are no longer defying the laws of physics and therefore can no longer phase through ceilings or floors.
fix: When an individual is interacting with an elevator and said elevator is moved, their menu will be closed if they weren't the one to cause that move, to prevent more physics-defying operations.
code: Improved the industrial lift code by adding documentation and trying to enforce the coding standards in there while I was at it.
/cl
2021-11-29 14:42:18 +13:00
MMMiracles
1d88b2895b The Tramstation Tram no longer shoves the handicapped out of their wheelchairs when moved (#63041)
* tram no longer pushes over buckled people

* varbgone
2021-11-29 00:51:31 +01:00
Ghom
7b7b058048 Fixes yet another couple TK teleportation tricks. (#62925)
Fixes airlock notes and cloth sheets cut from gauzes being teleported to the user because of TK.
2021-11-28 08:29:27 +00:00
Ghom
89baf9ffc7 I forgot to add an achievement for getting pda bombed. (#62948)
Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>
2021-11-27 12:18:48 -08:00
MMMiracles
6f2382d722 Tramstation Perma Genpop (#62966) 2021-11-27 10:38:54 -07:00
Tom
4af0624548 Re-paths and changes the layer of GAR glasses (#63009)
Re-paths GAR glasses to make them subtypes of each other, where applicable.
Re-names some of the icon states, to make it clearer as to what they are.

Changes the alternate_worn_layer to make them show over hair, rather than under. (Muh reference) 

Subtypes good. Being able to see what you're wearing properly also good.
2021-11-26 18:15:26 -08:00
Seth Scherer
ec86b62db4 Updates /code/game/objects/item/circuitboards/* to follow the style guide (#63026)
Co-authored-by: SuperNovaa41 <supernovaa41@protonmail.com>
2021-11-26 15:47:44 -08:00
carshalash
8db7995841 Abductor Frankenstein edition: How aliens got a limb grower. (#62841)
This PR will completely remove the brain traumas component of being abducted. in its place, there will be a round start limb grower machine to make up for it. All upgrade disks for the machine come in the above locker and I was even nice enough to include 50 units of synthflesh! Wow!
2021-11-26 14:22:12 -08:00
tralezab
eb060455f1 prison plates now include their name in a lot of places it was missing (#63068) 2021-11-26 12:28:00 -08:00
Seth Scherer
324117d637 Updates /code/game/objects/item/grenades/* to follow the style guide (#63030)
Co-authored-by: SuperNovaa41 <supernovaa41@protonmail.com>
2021-11-26 12:10:01 -08:00