Commit Graph

1222 Commits

Author SHA1 Message Date
Mothblocks
af8902331d Amortize the cost of creating preference assets by caching them per git revision on production, reducing best case init times by ~20 seconds (#63503)
Preference asset creation, which while consistently created in early assets, can be requested at any time before then and often is, currently takes about 15 to 25 seconds to produce. Because of extremely hard to reproduce BYOND icon bugs, most of this is done on the same tick.

Lowering the cost of initialization itself is very tricky. Some of it we can theoretically optimize, such as creating humans for antagonists, others we can't, such as the raw cost of icon blending.

Furthermore, adding new icons later down the line would just increase this initialization time even more.

Instead of optimizing the asset creation, which is an uphill battle, this instead chooses to amortize the cost by caching preference assets created per git revision. This means that preference assets will be created, with their long delay, only once whenever the code changes.

This is done on a config, defaulting to on so that production needs no changes, as the whole point of these being made at runtime at all is that it keeps assets/art styles consistent, and PRs making subtle bugs that break preference generation in some way is not uncommon. On development, your git revision will stay the same until you commit, no matter what code changes you make.
2022-01-01 04:36:30 +00:00
Jeremiah
9c6fdb567d TGUI list conversions + bug fixes (#63354)
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 #63629
Fixes #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
2021-12-31 11:07:28 +13:00
Mothblocks
58cf5d5641 Move MouseEntered to a queue, such that only the most recently hovered atom will be processed (#63567)
bout The Pull Request

MouseEntered currently fires multiple (multiple) times per frame, presumably over every atom that was hovered in some timeframe (though it appears to be much worse than that).

This makes MouseEntered only add to a queue, while a per-tick subsystem ensures only the most recent MouseEntered gets the screentip work done on it, through a generic on_mouse_enter proc call.

Contextual screen tips are coming and are going to make the screen tip code more computationally expensive, so slimming it down is going to be a must.

Would like to hear from @LemonInTheDark if this makes any obvious difference in time dilation, since it of course won't be as easy as just checking MouseEntered overtime anymore.
2021-12-27 13:02:21 +13:00
Kylerace
6207f14e80 creates SSspeech_controller so the MC can control say() execution (#63118)
makes say_verb() not execute immediately and instead put itself in the queue of the subsystem meant to process it: SSspeech_controller so that it executes at the start of the next tick during the MC's run instead of outside of it.

i considered making this part of #61422 (d005d76f0b) but this is good regardless of how that one pans out and i already overstuffed that one.

tldr the REAL cause of get_hearers_in_view() overtime is an effect of how byond schedules verbs within the tick.

when the server is overloaded there isnt much time between when SendMaps finishes and when the next tick was supposed to start, but verbs still need to be executed. So verbs will eat into the time the next tick should have started and the MC cant compensate for it at all since it uses byonds internal tick scheduler instead of our external tick scheduler.
2021-12-24 21:37:37 -08:00
Fikou
7b38dd4ff7 MODsuits (#59109) 2021-12-24 12:00:24 -08:00
AndrewL97
619acc1624 Fix skin tone sorting and refactor color procs (#63554)
* Remove superfluous hash from hex2rgb call
Add stack_trace to hex2rgb to catch future nonsense
2021-12-22 21:07:53 -08:00
John Willard
a1013422f7 Moves the suicided var to where its supposed to be (#63470)
Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
2021-12-19 12:24:36 -08: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
Azarak
19329cd74a Fixes objects with bad planes and FoV bugs (#63412) 2021-12-15 16:59:56 -08: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
tralezab
8b4dd8df6c fugitives now poll for a fugitive role, instead of being based on traitors (#63339)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2021-12-12 21:50:05 -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
Jeremiah
c1e2d5ae8f TGUI input box framework (#63190)
About The Pull Request

Creates the framework for two new TGUI input boxes that can be toggled via game prefs.
This does not convert any actual inputs to TGUI
This does not convert any tgui_list_inputs into being toggleable
Example pictures

Input on a hand labeler. This has a MAX_LENGTH set, so it can be invalidated. Cancel always returns null. Enter button submits, if valid.
text input
(OUTDATED) Multiline input on newscaster. Newer version fills the window with a section, like the others
multiline
Sheets from a stack
number input
Why It's Good For The Game

1
So I did...

    Much sleeker input boxes
    Result should be a in place swap for most occurrences of input
    Renders casting as text/num/null obsolete but still doable
    Input validation from both sides handled
    Prefs toggle if you don't like the look

Changelog

cl
add: TGUI input boxes are on the way! You can find new preferences in the menu. They will be on by default.
/cl
2021-12-09 09:47:07 +13:00
Mothblocks
0989ce2d6f Remove job .tsx files from preferences menu, use compiled data instead (#63200)
Removes every job .tsx file, and moves their necessary data over to the job datums themselves. This lowers the burden of both adding and removing jobs, and allows for jobs to be removed without touching any internal code (I'm specifically doing this for events)
2021-12-06 03:56:46 +02:00
tralezab
1d8693c26f Ethereals no longer get the "he" pronoun accidentally (#63221)
Character preferences now disregards the gender value if the species you're playing as is sexless
fixes #61491 (Ethereals being "He" instead of "They")
2021-12-05 01:43:00 -08:00
Seris02
77ea00b5d7 makes the gradient color options not show if no gradient is selected (#63169) 2021-12-02 13:49:45 -08:00
Ghom
79c8b3a8ca Gradients can now be applied to facial hair too. (#62996)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2021-11-25 22:44:06 -08:00
Mothblocks
395fb02f77 Fix vampire clans applying to everyone (#63036) 2021-11-23 19:19:30 -08:00
John Willard
59b4ac982b de-hardcodes moth antennae preference icons (#62888)
It just makes the preferences actually appear for downstreams who have unique moth preferences.
2021-11-23 13:36:48 +00:00
tralezab
623290915c Replaces Batform with Vampire houses (#62516)
Permissions for species change

image
About The Pull Request

Goodbye batform

Hello, new preference called vampire status. Outcast vampires act just like normal, Inoculated vampires join their department under a unified "vampire house name" everyone shares.

image

image

image
Why It's Good For The Game

I've heard people complain about batform for years now, if vampires aren't gone by next halloween we can at least enjoy making them far less griefy (ruining a lot of the fun of halloween as just a dumb grief holiday) and more roleplay oriented. I don't even know why vampires got a griefy spell when they already have their main mechanic encourage randomly attacking people and stealing their blood to stay alive
Changelog

cl
del: Batform is gone!
add: ...Replaced by vampire houses as a preference. Join your department as a vampire ménage!
/cl
2021-11-23 16:29:23 +13:00
Ghom
a45ea1cb0b Hair gradient preference no longer shows for species that don't have hair (#62950) 2021-11-22 14:17:32 -08: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
Timberpoes
1152f4f15a Exempts non-deadminned admins from all the chat filters so they can break the server rules and get banned if they want to. (#62944)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2021-11-19 23:18:11 -08:00
Thunder12345
0ab5f14870 Allows any character to use the body type setting regardless of gender (#62733)
Co-authored-by: Thunder12345 <stewart@critar.demon.co.uk>
Co-authored-by: Jared-Fogle <35135081+Mothblocks@users.noreply.github.com>
2021-11-12 23:16:29 -08:00
Timberpoes
1950da9f70 Removes cryostasis pods from the game pending creation of a proper design document (#62731)
* Baleeted

* Unmap

* Nudge the cabinet out of the way of the door
2021-11-12 15:57:22 -08:00
Mothblocks
061f47d0ee Antag HUDs will now animate if you have multiple antagonists, and will no longer clear on deconversion (#62718)
About The Pull Request

This is for the admin combo HUD. Players shouldn't notice any difference (except at roundend).
2021-11-09T16-27-26.mp4

Removes the ability to set custom antag HUDs for custom admin teams for complexity, though if there's a large enough demand I can try to bring it back in another PR.

Fixes #59767

TM candidate only so that I can make sure antags aren't getting leaked to people who shouldn't see them.
Changelog

cl
fix: Antag HUDs will no longer clear on deconversion if the player was another antag.
qol: Antag HUDs (as seen by admins and at the round end) will now animate between all antagonists, rather than just choosing the most latest.
/cl
2021-11-12 10:53:45 +13:00
GoldenAlpharex
d407799f4a The word filter will now be less scared of double or trailing spaces (#62703)
It kept on tripping because the RegEx expression was malformed due to an absence of words in to_join_on_whitespace_splits, which caused it to filter out spaces that were at the beginning or at the end of a message, or if there was two spaces one by the other.

Also prevents people from sending a message that's only spaces in OOC, because that's a little silly.
2021-11-10 18:26:53 +00:00
MrMelbert
948d548ed4 Adminwho and the status panel now shows when fellow admins are readied up in pre-game lobby (#62670) 2021-11-09 02:24:51 -08:00
GoldenAlpharex
54c30da324 Fixes numeric prefs not working with TGUI dropdowns that might return a string instead of a number (#62653) 2021-11-08 14:54:22 -08:00
AnturK
f03fd9dd8a Few minor runtime fixes (#62394) 2021-10-28 19:24:18 -03:00
NamelessFairy
1238ce2373 Adds the ability to soft filter words, also fixes some word filter bugs (#62158) 2021-10-26 12:45:36 -07:00
Watermelon914
001db28eac Players now see any notes they may have gotten whilst disconnected when they join the server for the next time (#62063)
Players no longer find out they were noted days later when they check their notes for any notes/bans applied by an admin.
2021-10-25 11:22:57 -04:00
Mickyan
37c6f90013 Nearsighted quirk lets you pick the look of the glasses you spawn with (#62145)
expansion: Nearsighter quirk now lets you pick the look of your prescription glasses from the character preference menu
imageadd: Added thin prescription glasses
2021-10-19 17:51:57 -04:00
Gandalf
9f8a5a96e7 Moves hair gradients to the preferences menu (#62102)
* Hmm yes.

* let's not make everyone have rainbow hair

* Update basic.dm

* Undoes the dyekit removal!

* Update tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/species_features.tsx

* Update tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/species_features.tsx

* Update basic.dm
2021-10-15 17:06:14 -07:00
Seris02
694c2999b0 makes it so the sanitize_hexcolors' default is 6 characters rather than 3 and gets rid of color_legacy (#61980) 2021-10-15 11:48:55 -07:00
Ryll Ryll
b3f176998d Buffs eye contact, adds "Shifty Eyes" quirk (#61711) 2021-10-14 00:19:27 -07:00
Ghilker
95c8e00af7 cleanup _HELPERS/_lists.dm and all the necessary files (#61827)
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)
2021-10-12 14:48:51 +01:00
Mothblocks
ed89d9fbd4 Add reset keybindings button (#61942) 2021-10-10 14:50:38 +03:00
Watermelon914
7f0bb743b4 Fixes default FPS and makes it apply to new players (#61957)
Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2021-10-08 05:04:56 -07:00
Ghilker
b95c0366a4 _HELPERS/unsorted.dm has been sorted (#61882)
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
2021-10-05 20:22:57 +01:00
MrMelbert
a11e9f7a00 (Maybe) fixes panic-bunker rejecting people it shouldn't when interviews is enabled (#61837)
This pr (maybe) fixes #61383 . Testing it is difficult as I don't know how to set up a DB on local - I suggest a testmerge on Manuel?

If panic bunker interviews are enabled, everyone should be able to connect - either they have enough hours and don't need an interview or are a new player and will enter an interview.
If panic bunker interviews are disabled, we then check panic_bunker_living.
If 0, we only check for whether the client has a database entry.
If a set number, we check for the client's playtime vs that number. (Players underneath the living playtime, will be prompted to fill out an interview)
#60289 made it so people who should bypass the panic bunker to enter an interview were wrongfully rejected.

Since the default value for living time was 0, and the time we use on the game servers was 0, it ALWAYS rejected new players from entering the game, even if interviews was enabled.
2021-10-04 19:13:17 +01:00
Mothblocks
f158357375 Add preference to disable deadmin preferences in CentCom (#61751) 2021-10-01 04:00:32 +03:00
TiviPlus
901bbf7699 Rendering refactor P1: Plane unification and render relaying (pictures and video included) (#61286)
What does the PR do

This reworks how our rendering is handled, specifically moves away from plane masters as the end solution:

Instead we replace plane masters rendering directly to client with planes that render multiple planes onto them as objects in order to be able to affect multiple planes while treating them as a single object. This is done by relaying the plane using a "render relay" onto a "render plate" which acts as a plane master of plane masters of sorts, and since planes are rendered onto it as single objects any filters we apply to them will render over the planes, treating them as a single unit
image

Also cleaned up unused plane masters and render targets to reduce clutter, as well as removing a useless filter that was resulting from confusion due to said clutter.

Clientside performance testing showed no significant change, no effect on serverside performance as this is clientside.

Also added the blackness plane master so it can be relayed, side effect is that it can now be used to adjust how blackness is rendered

P2 should introduce rendering one plane to multiple render_plates, but i want to get this done before I finish that, though testing shows its feasible

Why It's Good For The Game

Allows more advanced effects.
As an example i made a grav anomaly effect in like 30 seconds for this video i will improve it once im awake properly:
https://streamable.com/lu98dz

Documentation images should be merged here after this pr is done
tgstation/documentation-assets#2
Changelog

cl
qol: grav anomalies now have a pretty effect
refactor: Rendering has been refactored, remember to report bugs
/cl
2021-09-29 22:51:14 +13:00
Mothblocks
dbe560f4d9 Change the word filter configuration to allow providing reasons, fix emotes not working in filters, and implement separate OOC/IC/PDA filters (#61606) 2021-09-25 21:13:43 -07:00
Mothblocks
ec69a3433e Fix incorrect antagonists showing up on be_special (#61676)
Fixed not being able to disable specific antagonists randomly.
For me, this meant I was unable to toggle cultist and traitor. This might've been a migration bug, though it's safe to just sanitize it on read.
2021-09-25 09:32:40 +01:00
LemonInTheDark
d610ab97c8 Adds keyloop to the autoclearing ss, cleans up ssambience a bit (#61540)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2021-09-21 17:57:27 -07:00
Mothblocks
0ce04c12b1 Fix quirks list in preferences menu being empty before SSquirks (#61492)
About The Pull Request

Fixes #61490
Changelog

cl
fix: Fixed the quirks list in the preferences menu sometimes being empty.
/cl
2021-09-22 12:14:53 +12:00
Mothblocks
b2cb5156b6 Sanitize quirks after being loaded (#61588)
Fixes #61468, where quirks being removed/renamed/rebalanced would fuck with your quirk settings.
2021-09-21 16:32:13 +01:00
LemonInTheDark
a08f698230 Harddeletes: Accident edition (#61562)
So I started with fixing some timing stuff in #61540, decided to look into foam harddels since I've known about them for a while, got bored, tried to figure out the plane master failures I've seen, and well uh, did.

I'm sure there'll be more, but for now:
Fixes foam darts sticking around post qdel due to dumb guncode, adds a stack trace to handle it.
Makes map popups actually clear the screen they're effecting of their objects, preventing plane master harddels, most commonly sourced from admin pod memes. Not clearing from the screen WAS SOMEHOW AN INTENDED FEATURE!?!@ because "clients log out often anyway and that clears screen so it's fine" I am having a meltdown
Changes examine timers from a ref + signal to a ref(), the timer's 1 second, it's not gonna cause any collisions for the love of christ
2021-09-20 17:17:09 +01:00
Mothblocks
fac93a0d4f Change preference cache from addtimer to spawn, ideally preventing the savefile bug from happening pre-init (#61536)
The bug #61469 (940d9aa99d) was trying to fix is mostly successful, except in rare cases of a lot of people opening preferences pre-timer SS init, where addtimer is delayed. This changes it to spawn, which is good to run pre-init, though in small amounts. If this doesn't work, then I'm going to make a savefile pass through every proc as an argument, but it's a very tedious and frustrating change to do, and I only really want to do it if necessary.
2021-09-19 12:24:55 -07:00