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

Improve module calculation #282

Merged
merged 1 commit into from
Sep 17, 2024
Merged

Conversation

zzh8829
Copy link

@zzh8829 zzh8829 commented Sep 13, 2024

This PR adds speed-related module calculation into the module autofill.
The main motivation is that previously bio/alien modules did not work with autofill because they only provide speed stats and have no effect on productivity or energy.

This PR uses the cost of buildings as a way to model the benefit of using speed-related modules.
From my testing, it works well with pY and vanilla.

In vanilla, a speed module is preferred only when the payback time is less then an hour. After that, the Efficiency Modules are preferred, which is similar to the behavior before this PR.

Screenshot 2024-09-12 at 7 28 25 PM Screenshot 2024-09-12 at 7 25 10 PM

@shpaass
Copy link
Owner

shpaass commented Sep 13, 2024

Updated wording of the PR

Copy link
Collaborator

@DaleStan DaleStan left a comment

Choose a reason for hiding this comment

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

It's unfortunate, IMO, that this still has the behavior where the best module for a vanilla automation pack is efficiency, not prod, but that's not a regression.
It also has unexpected behavior with Bob's modules (Excluding god modules: project, game), where it upgrades from speed 7 to pure speed 5.

I can't immediately come up with a rigorous way to prevent either of these, but I'm tossing them out there to see if you have any ideas.

Requesting changes for the 0 => NegativeInfinity change and the whitespace, unless someone has good ideas on fixing the above problems.

Also, please add a line to the changelog.

Yafc.Model/Model/ModuleFillerParameters.cs Outdated Show resolved Hide resolved
Yafc.Model/Model/ModuleFillerParameters.cs Outdated Show resolved Hide resolved
Yafc.Model/Model/ModuleFillerParameters.cs Outdated Show resolved Hide resolved
@shpaass
Copy link
Owner

shpaass commented Sep 14, 2024

Rebased on fresh master and added a prefix to the commit message.

@zzh8829 zzh8829 force-pushed the zz/module-autofill branch 2 times, most recently from 1a89d5c to 15aa6ed Compare September 15, 2024 18:00
@zzh8829 zzh8829 requested a review from DaleStan September 15, 2024 18:01
@shpaass shpaass self-requested a review as a code owner September 15, 2024 19:48
@shpaass
Copy link
Owner

shpaass commented Sep 15, 2024

Rebased on fresh master

Add speed as a factor, so the autofiller does not discard
pY-AE modules.
@shpaass
Copy link
Owner

shpaass commented Sep 17, 2024

Squashed fixes and applied dotnet format. Then rebased on fresh master.

@shpaass shpaass merged commit b1fe1c1 into shpaass:master Sep 17, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants