Skip to content

fix alcahol lag. - #5953

Merged
walksanatora merged 2 commits into
Starlightfrom
starlight-dev
Sep 2, 2026
Merged

fix alcahol lag.#5953
walksanatora merged 2 commits into
Starlightfrom
starlight-dev

Conversation

@walksanatora

Copy link
Copy Markdown
Collaborator

Short description

Why we need to add this

Media (Video/Screenshots)

Checks

  • I do not require assistance to complete the PR.
  • Before posting/requesting review of a PR, I have verified that the changes work.
  • I have added screenshots/videos of the changes, or this PR does not change in-game mechanics.
  • I affirm that my changes are licensed under the MIT License and grant permission for use in this repository under its conditions.

Arkanic and others added 2 commits September 2, 2026 22:30
## Short description
Legendary long elusive alcohol lag bug, summoner of many a "remove
alcohol shader" red herring, isolated
Big thanks to blimpuf downstream for noticing a rather repetitive block
of code.

Background:
- ethanol "lag" bug occured exclusively during the metabolisation of
alcohol, not at other times
- lag was incredibly chuggy fps, no network rubberbanding or anything
- only reported by certain players, impossible to reproduce in dev env
- some players noted getting spammed with hundreds of locale warnings
(specifically those related to profile loading) while experiencing this
lag

Thesis:
- i posited that something was causing profile ui to spam reload,
suspected it to be railroading or achievements system, but could never
pin it down

What happens:
- while metabolising alcohol, progress is added/checked to the ethanol
acihevement task. This is done regardless of whether or not the ethanol
task has been fully completed. Every achievement progress update sends a
net message from server -> client with full achievement list and update.
- This means that every metabolism event update, the client is getting
an achievements update. Not most efficient, but not bad either, and
certainly not root cause of all the lag.
- When event is received by client, it is stored in a dict, and an
action is fired. This action is subscribed to by the achievements UI,
and the job manager UI.
- every time the job manager UI's update is invoked, it fully rebuilds
the job timer, humanoid profile editor, and antag list UI from scratch.
SL edits call the job manager update every time an achievement
*progress* is received.
- as far as I can find, there is no use case where the job manager needs
to know achievement progress (achievement UI is handled entirely
seperately to this), it doesn't use any data from the event and my
assumption is that it is there for potential future achievement-based
unlocks, but was made to be achievement progress instead.

Anyway, net result is that drinking alcohol -> spams progress updates
every tick -> every progress update causes incredibly expensive humanoid
profile/antag select/job UIs to fully reload at a rate of server
tickspersecond * number of metabolism events per tick

The fix:
fix is literally just make it only update those UIs when an achievement
is unlocked, not every individual progress increment
It's not used anywhere in code and there is no reason for those UIs to
be interested in individual progress steps, especially since those can't
possibly happen outside of game when those UIs are actually being viewed

Limitations:
- Achievements is still sending a ton of progress update events, which
probably isn't great (but not terrible) for network. As I don't think
anyone is willing to fully rewrite the achievements system, this is an
evil that will stay with us for now.
- Despite my confidence, I cannot truly test whether this fixes the lag
in dev, as achievement progress is sent through nulllink, not game
server.


## Why we need to add this
erm

## Checks
<!-- check boxes for faster reviewing of your PR -->

- [x] I do not require assistance to complete the PR.
- [x] Before posting/requesting review of a PR, I have verified that the
changes work.
- [ ] I have added screenshots/videos of the changes, or this PR does
not change in-game mechanics.
- [x] I affirm that my changes are licensed under the [MIT
License](https://github.com/ss14Starlight/space-station-14/blob/Starlight/LICENSE.TXT)
and grant permission for use in this repository under its conditions.

**Changelog**

:cl: Arkanic
- fix: Ethanol lag bugfix (hopefully) (likely) (for real this time).
@walksanatora
walksanatora requested a review from a team as a code owner September 2, 2026 23:40
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 815fee99-28b0-43a9-9d20-aa3c7fb31d3b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. size/S S: Needs Review Status: Requires additional reviews before being fully accepted. Not to be replaced by S: Approved. Changes: C# and removed S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. S: Needs Review Status: Requires additional reviews before being fully accepted. Not to be replaced by S: Approved. size/S labels Sep 2, 2026
@walksanatora
walksanatora merged commit 8e47999 into Starlight Sep 2, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants