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

Fix artifact analyzers to consume power only during scanning #2064

Conversation

spacedwarf14
Copy link
Contributor

@spacedwarf14 spacedwarf14 commented Sep 23, 2024

About the PR

Currently artifact analyzers consume 12000W regardless of whether they are in use or not. In the YML it is commented that the intention is to only consume power during scans, but this is not the case because the APC load doesn't get updated. I think there was confusion about what apc.NeedsPower actually does, as it shouldn't affect the receiver's load (but rather, the receiver's requirement for power in the first place).

Technically wattage is set to 1 while not scanning for upstream APC bugs reasons, as @dvir001 mentioned earlier.

Why / Balance

It would certainly reduce power / fuel requirements for science ships. However the same effect is achieved by unanchoring the analyzer. Currently it's just an extra step that feels lrp.

How to test

Spawn a science ship, place artifact and scan / finish scan while monitoring power. Experiment with toggling power during scans as well to make sure pause / resume logic wasn't affected.

Media

2024-09-23-162234_586x750_scrot
2024-09-23-162219_653x819_scrot

Requirements

  • I have read and I am following the Pull Request Guidelines. I understand that not doing so may get my pr closed at maintainer’s discretion
  • I have added screenshots/videos to this PR showcasing its changes ingame, or this PR does not require an ingame showcase

Breaking changes

Not a breaking change, but something I'd like to do better before this is merged: when the analyzer begins scanning, the sudden 0->12kW power draw causes apc brownout. This

  1. closes the analyze console UI. not the friendliest effect.
  2. Emits a PowerChanged event, which then pauses the scan, then is issued again once the APC is ramped up to resume the scan. Pausing and resume the scan doesn't call SetPowerSwitch(...) because it's actually only called when power is lost and restored, and only concerns the ActiveArtifactAnalyzerComponent. Anyway, it's kinda noisy and waste of cpu cycles.

ideas?

Changelog

🆑

  • fix: Artifact analyzers do not consume power when idle

@spacedwarf14
Copy link
Contributor Author

Maybe there's a way for a power receiver to ramp up its own consumption (just as a generator does with its supply power).

Technically wattage is set to 1 while not scanning for upstream APC bugs reasons.
@dvir001
Copy link
Contributor

dvir001 commented Sep 25, 2024

Based

@Cheackraze
Copy link
Member

the power ramping on the back end definitely leads to this, but I see it more as a shortcoming of the underlying power ramping system not being ideal.

@dvir001
Copy link
Contributor

dvir001 commented Sep 25, 2024

Other then the comment this is alright, just need to make sure the changed lines are marked so we can keep track in case this is changed upstream.

Copy link
Contributor

@whatston3 whatston3 left a comment

Choose a reason for hiding this comment

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

Made a few changes for consistent commenting to Frontier changes.

Looks good, works fine under test.

@whatston3 whatston3 changed the title Fix artifact analzers to consume power only during scanning Fix artifact analyzers to consume power only during scanning Sep 30, 2024
@spacedwarf14
Copy link
Contributor Author

spacedwarf14 commented Oct 1, 2024

Thanks, I will try to follow the comment convention better next time.

If this stands as it is, I want to eventually address the brownout / event spam in another pr

@whatston3 whatston3 merged commit e91ab05 into new-frontiers-14:master Oct 6, 2024
12 checks passed
FrontierATC added a commit that referenced this pull request Oct 6, 2024
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.

4 participants