Skip to content

add a command to enable atmos devices on arbitrary maps#4049

Open
Alkheemist wants to merge 10 commits intonew-frontiers-14:masterfrom
Alkheemist:2025-11-01-admins_can_have_a_little_atmos_as_a_treat
Open

add a command to enable atmos devices on arbitrary maps#4049
Alkheemist wants to merge 10 commits intonew-frontiers-14:masterfrom
Alkheemist:2025-11-01-admins_can_have_a_little_atmos_as_a_treat

Conversation

@Alkheemist
Copy link
Contributor

About the PR

Adds a command to re-enable atmos on maps.

Why / Balance

Admins can have a little atmos, as a treat

Technical details

Adds a hashset containing maps that atmos should be enabled on to the atmos system and checks if the map is in that hashset when checking whether or not to process atmos devices.

Note that the way AtmosInputCanRunOnMap works means that this is more computationally expensive the more atmos devices you have on maps that are not the main one, so hopefully the additional check isn't going to bog down the server. But before/after profiling should probably be done to see the real impact.

And the hashset seems cleaner to check compared to iterating through a list. The easiest would be a field on the component, but that's in the engine and I don't want to try and mess with that right now.

How to test

  • Go to your ATAG (or on exped)
  • Build an atmos setup, lament the devices not doing anything
  • Use the command
  • Rejoice

Media

dotnet_01_11-24-15.mp4

Requirements

Breaking changes

Changelog

N/A, admin only

@Alkheemist
Copy link
Contributor Author

reject ECS, return to hashset
(I forgot I could've just checked for the presence of a component)

@JojyAsmir
Copy link
Contributor

Realistically, this is going to be used for two things mainly: Cryo pods on the Rimworld event, and making the scrubbers work on the minicentcomm POI. Both of which are great to me! Though, how would I go about testing that before/after profiling stuff?

@NGGJamie
Copy link
Contributor

NGGJamie commented Nov 1, 2025

Since it's unlikely mamy maps will be set like this, and we're not using special properties of HashSets, it would probably be more optimal to use a normal list. HashSets have to hash the value being checked before knowing if it's in the list, which does have some measure of cost.

But since we're unlikely to get more than 10 of these maps on any shift even in generous terms, the O(n) check of a list would probably beat the O(1) check with hash cost. Lists will also play nicer with caching and branch prediction. Granted, we are checking an integer, so that cost will be especially low and probably measured in terms of ns.

A SortedSet could also work if we'd want to skip hashing and get O(log(n)) lookups.

@Alkheemist
Copy link
Contributor Author

rewrote to use ECS since we'd need to do so for persistence reasons later.

apply suggestions from the-hivequeen

Co-authored-by: the-hivequeen <49570376+the-hivequeen@users.noreply.github.com>
Copy link
Contributor

@arimah arimah left a comment

Choose a reason for hiding this comment

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

I'm sorry, I'm a nitpicky bastard 😢 Looks good, just one TINY change.

@Alkheemist Alkheemist requested a review from arimah December 29, 2025 03:23
@github-actions github-actions bot added the S: Needs Review This PR is awaiting reviews label Dec 29, 2025
Copy link
Contributor

@blackknight954 blackknight954 left a comment

Choose a reason for hiding this comment

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

tested and works as intended, now all we need is working thermal scanners..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants