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.
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
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
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
* 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>
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.
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.
Just fixes some spelling for gangs. I also fixed misspellings for "posession" to "possession". Fixed "seperate " to "Separate" Fixed "Cemetary" to "Cemetery"
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.
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
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
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.
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.
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!
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.
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
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.
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
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
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.