* Micro-Optimize keyLoop's self time (#81464)
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->
## About The Pull Request
This is a REALLY hot proc, takes up to like 2% of total cpu at highpop
Let's micro it then
First, clients do not go null at random. It's not predictable per say
but it is consistent.
We can use this understanding to remove a bunch of null checks here
For loops are expensive. So rather then doing one each keyLoop, let's
cache the client's intended move direction on the client. Simplifies
some other code too
There is no sense running a turn call if it would have no effect, let's
be more intelligent about this
## Changelog
<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->
🆑
refactor: Fucks with how movement keys are handled. Please report any
bugs
/🆑
<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
* Micro-Optimize keyLoop's self time
---------
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
* Micro-optimize qdel by only permitting one parameter (#80628)
Productionizes #80615.
The core optimization is this:
```patch
- var/hint = to_delete.Destroy(arglist(args.Copy(2))) // Let our friend know they're about to get fucked up.
+ var/hint = to_delete.Destroy(force) // Let our friend know they're about to get fucked up.
```
We avoid a heap allocation in the form of copying the args over to a new
list. A/B testing shows this results in 33% better overtime, and in a
real round shaving off a full second of self time and 0.4 seconds of
overtime--both of these would be doubled in the event this is merged as
the new proc was only being run 50% of the time.
* Micro-optimize qdel by only permitting one parameter
---------
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
* fixes cursor catchers not working without widescreen (#77372)
## About The Pull Request
apparently vis x and vis y dont exist unless the object is transformed
## Changelog
🆑
fix: sniper scope and kinesis should work without widescreen
/🆑
* fixes cursor catchers not working without widescreen
---------
Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
* Restores Spell Card targetting behaviour (#73706)
## About The Pull Request
Fixes#52946
This has been broken ever since #44112 which apparently removed the proc
in this component which selected a target for performance reasons and
just... didn't replace it with anything else? So it's been bricked ever
since.
In order to restore the removed mouse tracking behaviour I implemented
the pattern used in scoped weapons and the kinesis module. As this was
the third thing I could find to use this code, I abstracted it out into
an object where most of the shared behaviour lives. I tested those
things too and they still seem to do what they used to.
Here it is in action:
https://user-images.githubusercontent.com/7483112/221954852-22244bb1-7c87-452d-a9b0-ebed81c4c1ef.mp4
Because this spell now applies a full screen overlay in order to
function, it's really begging for someone to make some touhou-style art
with cards and patterns around the edge of the screen while you are in
aiming mode, but I'm not going to be the one to make it.
I tidied this component up and refactored it as best I could while I was
reworking it to use a full screen overlay but I am... not totally
confident that it should be a component at all given that it keeps being
created and destroyed. But also it has worked that way for like four
years now, so who am I to say.
Oh yeah also the icon for this spell broke, so I fixed it.
## Why It's Good For The Game
Makes a reasonably terrible wizard spell marginally less bad.
Maybe now that this component works, some other things can use it?
If we make a fourth thing which follows your cursor it won't need to
copy/paste code around.
## Changelog
🆑
fix: Spell Cards from the Wizard spell will now home in somewhat on the
target nearest to your cursor.
fix: The Spell Cards spell now displays the correct icon instead of a
big red "error" text.
/🆑
* Restores Spell Card targetting behaviour
---------
Co-authored-by: Jacquerel <hnevard@gmail.com>
* (hopefully) improvements to use of scope and kinesis module (#70934)
## About The Pull Request
so, scope and kinesis are the only things in the game (other than the
body zone selector) which use the function MouseMove. this tracks every
mouse movement, which meant we had to stuff a cooldown on it to not
calculate a ton of useless stuff. this time can misalign if you move
your mouse fast, not registering at all, as well as not working out with
the 0.2 second processing time of the things handling it (the scope
component and kinesis module)
instead of doing that, we are now keeping the mouse parameters as a
variable, which we update with every mousemove to the current
parameters. then we handle the calculations right as we need them (in
the kinesis/scope) module, rather than relying on mousemove cooldowns,
this should hopefully feel way better
## Why It's Good For The Game
😁
## Changelog
🆑
qol: sniper scopes and kinesis module should feel better to use
/🆑
* (hopefully) improvements to use of scope and kinesis module
* seconds
Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
Co-authored-by: tastyfish <crazychris32@gmail.com>
* Adds a scope component, removes old zooming and adds sniper marksman ammo. (#66218)
Removes the old sniper rifle zoom, replaces it with a scope component. the scope activates on right click and lets your camera follow your mouse.
https://streamable.com/2c63u4 (due to byond rounding some shots were weirdly missed in that video, its fixed now)
Also adds sniper marksman ammo to the nukie uplink. It does slightly less damage, but it is hitscan and has one guaranteed ricochet shot, so you can shoot a wall and it could still hit someone.
* Adds a scope component, removes old zooming and adds sniper marksman ammo.
Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>