Commit Graph

6760 Commits

Author SHA1 Message Date
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
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
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
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
Iamgoofball
bb309ff434 Fixes being able to telekinesis through cameras, and telekinesis across z-levels through cameras. (#63377)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2021-12-13 15:23:40 -08:00
Jeremiah
1052bc19ed TGUI input box conversions 1 (#63313) 2021-12-11 14:21:35 -08: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
MrMelbert
8c7b629896 Stops Starlight Condensation from runtiming to hell and back (+ cleans up the code a bit) (#63300) 2021-12-10 02:15:54 -08:00
Seth Scherer
caf81f2dd9 F2 works for quick screenshotting again (#63293)
Co-authored-by: SuperNovaa41 <supernovaa41@protonmail.com>
2021-12-10 02:15:14 -08:00
EOBGames
cf899a1821 Moth Food Returns: A Taste of the Fleet (#63174) 2021-12-09 21:41:36 -08: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
TemporalOroboros
6107897e16 Fixes exploded circuit shells attempting to remove a deleted circuit (#63268)
Fixes a runtime that would occur when a circuit shell was inflicted with a devastating explosion and the shell attempted to remove the circuit after it had been deleted.
2021-12-07 18:04:37 +00:00
LemonInTheDark
ec02c09997 Makes the STOP_PROCESSING macro remove the argument from currentrun (#63222) 2021-12-07 00:10:12 -08:00
Ghom
21ac10d3d4 multiz movement refactor redux (#62132) 2021-12-06 23:13:48 -08:00
Capsandi
7e11d56a42 Adds Moffuchi's Pizzeria as a ruin to the surface of Icebox (#63185) 2021-12-06 17:27:12 -07:00
Ghom
fea3637316 Finish off the old strip menu, add tk checks (#63219)
* Finishes off the old strip menu (also fixes the new one not properly checking against tk)

* I'm having second thoughts. Better safe than sorry.
2021-12-06 04:02:34 +02:00
RandomGamer123
06a00e4e38 Make USB cables attached to locked circuits unable to be modified (#63084)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2021-12-05 03:02:09 -08:00
GoldenAlpharex
7fdc81576d Makes the edible component not runtime due to connect_loc_behalf when applied to turfs (#63232)
This makes it so it stops trying to use connect_loc_behalf if the parent of the edible component is a turf, just registering the signal normally instead, which should hopefully be the same functionality.


Runtimes are bad, and even if there's not really any relevant use of that proc in most cases, this is to future-proof things anyway.
2021-12-05 01:23:58 -08: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
Mothblocks
a7409fbff2 Add investigate logs for crafting (#63178) 2021-12-03 15:16:38 +01:00
LemonInTheDark
a606652e32 Fixes the overflow station trait not working (#63205)
Fixes the overflow station trait not working

Station traits init before jobs, soooooo

We could fix this with GetJob or 
if(!length(all_occupations))
	SetupOccupations()
or something, but this is cleaner, since we're waiting for subsystem init anyway
2021-12-03 01:41:24 -08:00
Ghom
d6acc3463c Fixes cult softlock situations with the sacrifice objective. (#62983) 2021-12-01 17:07:21 -08:00
John Willard
35bdc9e53d Nerfs HoP's access (#63165)
About The Pull Request

Removes HoP's access to security office.
Removes HoP's mech access entirely (except mining)
Why It's Good For The Game

HoP already has a TON of access for what their job is about, managing job changes and service/cargo. There's no reason why they would need such things as access to mechs, science, medical, ect. But for now, I just want to focus on removing Security Office:

HoP, on all maps, has a gun recharger in their office, and they will still remain access to departmental offices, so security office access is irrelevant for charging their gun. I personally don't think that HoP, a non-sec role, should have aceess to security lockers. They are a Service/Cargo job, they shouldn't have access to just walk in and take SecHUDs.

If HoP really needs access to security office, they can give themselves the access, but thanks to ID trimming, that cost isn't free anymore. Though it technically is, because they only need to give themselves 1 access edit, which isn't gonna affect a Silver ID, so I personally think they should have more access removed but that's not the point right now.
Changelog

cl
balance: the Head of Personnel no longer has access to Security Office nor Mechs (outside of mining ones).
/cl
2021-12-02 11:26:11 +13:00
Aerden
806a8e6405 Fixed nyctophobia being triggered even if you have mesons (#63145)
About The Pull Request

Having meson scanners equipped will still make you scared of the dark when you have nyctophobia. This PR fixes that.
Why It's Good For The Game

Being able to see in the dark should not make you scared.
Changelog

cl
fix: Fixed being scared of the dark even if you have mesons.
/cl
2021-12-02 11:23:55 +13:00
Seth Scherer
3429ac976a exploitation (#63168)
Co-authored-by: SuperNovaa41 <supernovaa41@protonmail.com>
2021-12-01 20:48:48 +01:00
Fikou
4b228af506 fullauto now checks for incapacitated instead of stat (#63083) 2021-11-30 10:27:54 +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
Ghom
1609ee074d Stops the riding comp from overriding the glide of the parent each time they move and not only when they are ridden/driven. (#63048) 2021-11-29 10:47:31 +01: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
John Willard
03604bfb77 Bot code improvement (2/??) (#62671) 2021-11-25 20:41:52 -08:00
Mothblocks
b25906f383 Remove pick_weight_allow_zero, and allow pick_weight to take zero values (#63035)
* Remove pick_weight_allow_zero, and allow pick_weight to take zero values
2021-11-25 12:57:40 -08:00
tralezab
b5571b8c68 Fixes rites being able to be done by non-chaplains (#63002) 2021-11-23 19:40:15 -08:00
MrMelbert
c979a23b6c Refactor cult dagger rune drawing and null rod rune clearing into components + minor rune / blood magic tweaks (#62918)
The act of inscribing runes, anchoring / unanchoring cult structures, deconstructing cult girders, and purging cultists of holy water have all been moved off of the cult dagger itself and onto a component, cult_ritual_item.

The act of destroying a cult rune or heretic rune with the null rod have been moved off of their respective items and onto the nullrod itself.

Added a signal, COMSIG_ITEM_ATTACK_EFFECT, for the above purposes.
Various cult spells and dagger interactions have had their code improved slightly.
2021-11-23 17:26:30 +00:00
dragomagol
44d927ec14 Makes hypnosis victims more visible to admins (#62745)
Gives hypnotized victims a visible antag hud for admins, puts them in the Check Antags panel, and makes their objectives visible in the Traitor Panel and on the round end report.
Why It's Good For The Game

Right now, victims of hypnosis are very difficult to visually identify as an admin. This not only distinguishes them easily but makes their objective easily visible too.
Changelog

cl
admin: hypnotized players now have a visible antag hud, are visible in the check antag panel, and have objectives visible on the traitor panel
expansion: hypnotized victims and their objectives are now visible on the round end report
/cl
2021-11-23 20:23:23 +13:00
Mothblocks
6ea8b19eb9 Add disabling footstep sounds and parallax to the lag switch panel (#62999)
At the last Toolbox Tournament, @MrStonedOne pointed out some big performance consumers. Some are disablable through easy means, but others were not. This adds two easy ones to the mix.
2021-11-22 23:19:33 -08:00
Mothblocks
a94e0ca392 Add station trait for varying colored assistant jumpsuits (#62998)
About The Pull Request

Adds a new station trait to color the assistant jumpsuits semi-randomly.

There are several styles for it to choose from, including some especially colored ones, and some randomized ones. This includes the current alternative rainbow jumpsuits, but if GREY_ASSISTANTS is not enabled, then grey jumpsuits will be a valid random option.

I don't really want to hear too much more about the config, I got the OK on this from head admins.
Why It's Good For The Game

Adds more variety to look at on assistants, while still mostly preserving a consistent style if GREY_ASSISTANTS is enabled (as it is a station trait).
Changelog

cl
add: Added a station trait for varying colored assistant jumpsuits.
/cl
2021-11-23 20:19:16 +13:00
Mothblocks
271ce9f995 Move current pick_weight consumers to not pass in zeros (#62940)
About The Pull Request

pick_weight_allow_zero was a backwards compatible hack, so it exists alongside pick_weight.

I would really like to just remove the old proc and just rename it, so I want to log what, if anything, is relying on this behavior, to see if it's a bug or if it needs to be handled especially in that case.
2021-11-23 20:19:02 +13:00
Ghom
2dd29f5286 Lavaland ash storms once again replenish ash on the ground. (#62954) 2021-11-22 23:06:30 -08:00
Ghilker
d466b260f8 fix message spam for atmos construction (#62796)
About The Pull Request

partial fix to #62783
the check was never meant to have feedback messages added in it because it runs every UI tick. Added the message as additional requirement text.
GBP no update please
Why It's Good For The Game

fix
Changelog

cl
fix: fix message spam for manual pipe crafting
/cl
2021-11-23 16:42:25 +13:00
Ghom
41b8d99401 DNA code now supports unique identity and features blocks of different size. (#62303)
#61980 (694c2999b0) has uncovered a few issues with our dna datum code. Mainly the lack of support for ui/uf blocks of different sizes.
So, in order to fix this issues, I had to create four global lists, two for UI and UF blocks which sizes differ from DNA_BLOCK_SIZE and two more that store the points in the ui and uf strings where different dna blocks start (this way we avoid having to calculate them every getter and setter proc call).

This will add support for heterogeneous ui/uf block sizes and make 24-bit color features and identities possible.

To the maintainers of downstream codebases: Remember to add your modular code ui and uf color blocks to the identity_block_lengths and features_block_lengths global lists respectively ... Unless you have rewritten dna code on your end. If that's so, good luck.

Tested and working (unless CI says otherwise).
2021-11-22 18:09:09 -08:00
Iamgoofball
133809765d The bureaucratic mistake station trait can now truly chose any job. (#62960)
Too many Captains. So little time.
2021-11-22 12:57:15 -08:00
Wallem
96b81f6c7f Refactors Sign Language & Fixes Inconsistency (#62836)
Refactors Sign Language code so instead of copy-pasting the same giant wall of checks we can just use a proc.
Also now checks to see if your limb is disabled, which fixes people with disabled robotic limbs being able to sign still.
Finally, the tongue only has ORGAN_UNREMOVABLE if you attained it from the trait. I've been told that the tongue could be attained from meateors and I think that's funny as hell so I swapped that over.
2021-11-21 11:32:58 +00:00
Watermelon914
fb8d95a2f5 Allows players to send more visible adminhelps when no admins are on, which'll definitely alert admins (#62711)
Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
2021-11-20 03:06:50 -08:00
Watermelon914
a2369f8f42 Allows shells that requiring anchoring to take power from APCs (#62907)
Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
2021-11-19 11:56:14 -08:00
Ghom
243cd2bfa5 Replacing more C-style for loops with the faster, traditional ones. (#62908) 2021-11-18 17:39:05 -08:00
Ghom
8fdebe8e80 Donuts found in sec vendors and boxes can now be used to make glazed donuts (#62910) 2021-11-18 17:38:37 -08:00