Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mirror: Cycle injector transfer amount on alt. use #178

Conversation

SimpleStation14
Copy link
Member

Mirror of PR #25566: Cycle injector transfer amount on alt. use from space-wizards space-wizards/space-station-14

ad6ac73f6f41d1cbd3fe80a43c8bf4b83e03f392

PR opened by veprolet at 2024-02-25 19:37:49 UTC


PR changed 3 files with 26 additions and 3 deletions.

The PR had the following labels:

  • Status: Needs Review

Original Body

About the PR

When the user tries to use alternative interaction on an injector capable of changing transfer volume, this will cycle between the maximal and minimal transfer amount (defaulting to maximum if the value was in-between the extremes).

The interaction is only available with in-hand usage or empty-handed usage. This is deliberate (but not necessarily correct).
The interaction is only implemented for injectors and not arbitrary containers capable of solution transfers. This is to limit the scope of this PR.

Why / Balance

Changing the transfer amount was only possible using the context menu. This was difficult and slow, but this tedium didn't seem to be a valuable part of the gameplay experience.

Instead of cycling over all the possible transfer amounts, the choice has been made to only cycle between the two extremes. This is for two reasons:

  • Scalability: If this is merged, we'll probably want the same behavior for the other solution containers like jugs. It would be very tedious (probably more tedious than using the context menu) to cycle to the correct transfer amount with more available transfer amount steps. It would also be IMO unintuitive to have a different behavior between the two types of solution containers.
  • Simplicity: It is easier to reason about the next state this way. Otherwise, one would have to figure out how many times to perform the interaction to cycle to the desired amount, which involves knowing the total number of steps for each injector/container, order of the current step and modular arithmetic (or just cycling until you are at the correct one, which is slow, error-prone and frustrating whenever you overshoot).

This decision has obviously some tradeoffs, but I feel like those are manageable. If you need to transfer the in-between amounts, you can usually switch to the minimal amount (I assume the property of in-between amounts being a multiple of the minimum will be upheld in the future) and click a few times. This is generally as tedious or less tedious than cycling the amounts. There are some instances where you can't do that. One example would be manual mixing of the advanced brute medications. This is a niche use-case and can be still solved using the context menu verb system and is supposed to be a bit more difficult anyway.

This also makes the alternative interaction a bit less predictable, as it no longer always uses the first context menu verb. I think the interaction is similar enough and inconsequential enough to justify this.

It makes the syringe marginally more powerful, but as this doesn't introduce any previously unavailable actions, I believe this to be perfectly acceptable and heavily outweighed by the convenience.

Technical details

This introduces a new concept of "special alternative" interactions. Those interactions have their own events and handlers.

Please scrutinize the code hard , because it touches some quite fundamental parts of the game, and I'm not too knowledgeable about C# or the conventions of this repo. I tried to follow guidelines where possible while not impacting the existing code too much, but maybe this leads to too much weirdness in some places.

Media

optimized

  • I acknowledge that I have no idea how to showcase or record this feature well, or I'm trying my best.

Breaking changes

N/A

Changelog
🆑

  • tweak: Injectors like the syringe can now toggle their transfer amount using alternative interactions.

@SimpleStation14 SimpleStation14 added the Pull Request Mirror Mirrors a PR from another Repo. Automatically applied by mirror bot label Apr 22, 2024
@SimpleStation14 SimpleStation14 marked this pull request as draft May 4, 2024 21:13
@VMSolidus VMSolidus marked this pull request as ready for review May 6, 2024 18:44
@VMSolidus VMSolidus merged commit b8489be into Simple-Station:master May 6, 2024
20 checks passed
Mnemotechnician pushed a commit to Mnemotechnician/Einstein-Engines that referenced this pull request Sep 9, 2024
…-upstream-merge-2024-09-05

Upstream Merge 2024-09-08
Mnemotechnician pushed a commit to Mnemotechnician/Einstein-Engines that referenced this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pull Request Mirror Mirrors a PR from another Repo. Automatically applied by mirror bot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants