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

Stop portable machines updating their icon every atmos tick #27941

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

warriorstar-orion
Copy link
Contributor

What Does This PR Do

This PR makes it so that portable atmos machines, notably canisters, spend less time in SSair updating their icons and checking to see whether they should update their icons. Despite all the bookkeeping and flag updating here, update_icon was still getting called and executing countless times, to the tune of 3.5 million times a round:
2025_01_11__11_17_57__Paradise Profile Viewer

This removes all that and just calls update_icon when it needs to be called, when we know the appearance needs changing:

  • When the portable is connected to a port
  • When a tank has been inserted
  • When the total pressure in the portable has changed
  • When the can is repainted

Why It's Good For The Game

Performance.

Images of changes

Before

2025_01_11__11_53_30__2025_01_11__11_52_57__dreamdaemon exe @ 2025-01-11 11_45_23 - Tracy Profiler 0 8

After

2025_01_11__11_52_57__dreamdaemon exe @ 2025-01-11 11_45_23 - Tracy Profiler 0 8 2

Testing

Attached canisters to ports, unattached, added tank to canister, removed tank, opened valve, watched light as pressure changed, modified canister paint job.


Declaration

  • I confirm that I either do not require pre-approval for this PR, or I have obtained such approval and have included a screenshot to demonstrate this below.

Changelog

NPFC

Copy link
Member

@chuga-git chuga-git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh my god

@ParadiseSS13-Bot ParadiseSS13-Bot added -Status: Awaiting type assignment This PR is waiting for its type to be assigned internally -Status: Awaiting merge This PR is ready for merge and removed -Status: Awaiting type assignment This PR is waiting for its type to be assigned internally labels Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Status: Awaiting merge This PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants