Skip to content

Change overall progress to be the minimum rather than average - #120

Open
coopermor wants to merge 1 commit into
hex-agon:masterfrom
coopermor:change-progress-percentage
Open

Change overall progress to be the minimum rather than average#120
coopermor wants to merge 1 commit into
hex-agon:masterfrom
coopermor:change-progress-percentage

Conversation

@coopermor

Copy link
Copy Markdown
Contributor

No description provided.

@hex-agon

hex-agon commented Oct 5, 2025

Copy link
Copy Markdown
Owner

I don't think this is right but i also don't think the current one is correct.

Let's take the example you sent me on discord:

Goal: 666x Aldarium

Total mox required = 80 * 666 = 53280
Total aga required = 60 * 666 = 39960
Total lye required = 90 * 666 = 59940
Total res required = 153180

Current mox = 7600
Current aga = 10200
Current lye = 15500
Current total res = 33300

The overall progress to the goal should be = 33300 / 153180 -> 0.2173 (21.73%)

@coopermor

Copy link
Copy Markdown
Contributor Author

I guess it depends how you view the problem, but I disagree with your progress. Take an extreme example:

Current mox = 77,000
Current aga = 0
Current lye = 77,000
Current total res = 154,000

With your math 154,000 / 153,180 = 1.005 (100.5%)

In this scenario I think it is misleading to say you are 100% finished with the goal rather than 0%.

The way I think is your progress towards the goal is always the least progressed resin as there is no way to convert other resins.

@hex-agon

hex-agon commented Oct 5, 2025

Copy link
Copy Markdown
Owner

You have to cap the current value to the max you need for the goal. If you use the min value out of the 3 you can have a scenario where you're done with two resins and have almost 0 of another and show almost 0% progress when in reality you're pretty much 66% done.

@coopermor

Copy link
Copy Markdown
Contributor Author

I feel like you are at 0% progress though because you can't target farm only one resin without making progress in the other two.

@raiyni

raiyni commented Oct 5, 2025

Copy link
Copy Markdown
Collaborator

Fwiw, this situation is already fixed

this.percentageToGoal = Math.min((double) currentAmount / goalAmount, 1.0);

Current mox = 77,000
Current aga = 0
Current lye = 77,000
Current total res = 154,000

With your math 154,000 / 153,180 = 1.005 (100.5%)

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