Commit Graph

9869 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
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
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
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
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
Ghom
21ac10d3d4 multiz movement refactor redux (#62132) 2021-12-06 23:13:48 -08: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
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
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
OrionTheFox
ac63233e5d Catwalk Tiles REVAMP + floorbot buff (#63016)
Requested to bring this upstream, so here we are now. The floorbot stuff is new though.

Adds new catwalk tiles that blend better with other flooring

Also does some improvements to floorbots, specifically:
-Auto-place catwalks in maints (now when they wander in there they'll actually be helpful!)
-Actually patch holes (they used to just lay a tile over space and call it good; crowbarring it up would show a lack of plating)
-Repairing floor tiles actually REPAIRS it, leaving the decals intact

More usable catwalks, rather than what we currently had.

Added new reskins of the Catwalk Tiles, which will blend better with other types of floor! These can be selected via a radial on the base catwalk tile, crafted with iron rods.
Floorbots will automatically place catwalks when they're in a maintenance area, and will repair damaged/burnt tiles rather than fully replacing them.
Floorbots will actually place a plating when repairing a breach with tiles, rather than haphazardly laying a tile that has space below it.
2021-11-26 02:04:13 -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
John Willard
03604bfb77 Bot code improvement (2/??) (#62671) 2021-11-25 20:41:52 -08:00
Seth Scherer
f815929b47 Toy Crossbows can be fired with one hand again (#63021) 2021-11-24 15:12:43 -08:00
ShizCalev
e100f3ca8c Fixes ghosts' boo ability going on cooldown when the light they tried to flicker didn't flick (#62965) 2021-11-23 17:58:43 -08:00
tralezab
20a2b418a1 Department orders now include unique circuitboards (#62830)
About The Pull Request

I missed the circuitboards in the original pr, now they have em!
Why It's Good For The Game

Not really even printable right now but they are needed to reconstruct them in case of damage
Changelog

cl
fix: department order consoles include circuitboards
/cl
2021-11-24 12:21:02 +13: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
Wallem
827eb0810d Lets you build & deconstruct glass floors (#62890) 2021-11-22 23:10:47 -08:00
Colovorat
17f491748e Bonfire can be made with wood (#62939)
Co-authored-by: Colovorat <lolqwert569@gmail.com>
2021-11-21 22:45:43 -08:00
Farquaar
3d183698c3 Yee-haw Update: Code Spaghetti Western Edition (#62937)
About The Pull Request

Previous PR (Closed Because I'm a Git Newbie)
https://youtu.be/AFa1-kciCb4

Ever wondered why we had cowboy boots in the autodrobe and clothesmate, but no hats?
Ever wanted to start a posse but the fluorescent lighting was beating down on your head?
Ever wanted to run your bar like an old-timey saloon but you were too ashamed of your bald spot?
Ever wanted to say "See you Space Cowboy" and actually mean it?

This is the PR for you!

image
Left to Right: Desperado Hat, Drifter Hat, Sheriff Hat (with Sheriff Vest), Ten-Gallon Hat, & Deputy Hat

All hats are craftable using two sheets of leather. The vest can be crafted with four sheets, and can be attached to jumpsuits.
The drifter hat and the ten-gallon can be found in the clothesmate. The others can be found in the autodrobe.
Every item has in-hand sprites!

This PR does not alter fugitive bounty-hunter items in any way.
Why It's Good For The Game

It always puzzled me that we had so many western-themed items, clothing, and references, but no hats to back it up. Now we can run cowboy gimmicks to our heart's content, and admins have more than enough to cobble together an event straight out of the old-space-west.
Changelog

cl
imageadd: Due to lobbying pressure from the Yee-haw Conservation Society, Nanotrasen vending machines now stock five new cowboy hats and an old-west vest.
/cl
2021-11-22 15:10:44 +13:00
Colovorat
927187f2ec Stun Batong now turns off/on constantly for short time after emp (#62943)
About The Pull Request
title

Why It's Good For The Game
i dunno, seems funny it gives more depth or something allows for more intresting interactions

Changelog
🆑
expansion: Stun Batong now turns off/on constantly for short time after emp
2021-11-21 17:24:43 -05: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
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
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