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

[1841] Merged value for merging minors is wrong, when the average is exactly N+0.5 #9501

Closed
physic opened this issue Aug 28, 2023 · 2 comments · Fixed by #9504
Closed

[1841] Merged value for merging minors is wrong, when the average is exactly N+0.5 #9501

physic opened this issue Aug 28, 2023 · 2 comments · Fixed by #9504
Labels
1841 rules-broken Game comes to the wrong outcome compared with the rules (fixing these will break games)

Comments

@physic
Copy link

physic commented Aug 28, 2023

https://18xx.games/game/132855?action=413

The merged price for SFLi is wrong. It merged to 127, when it should be 141. I suspect the minor merge value of 69.5 was considered by then engine to be "not greater than" 69, but the rules do not support doing integer rounding before performing this calculation.
This issue should only affect merges between minors, since major merges always result in an integer sum.

SFMA is at 68. SFLP is at 71.
Half the sum of 68 and 71 is 69.5, so the minors should merge to 69.
SSFL is at 87. 69 + 87 == 156, which is greater than 141.

4.7.4 merge steps

For minor Corporations, the new value will be the rightmost value which is less than half the sum of the market values of the old Corporations

@roseundy
Copy link
Collaborator

Good catch. A fix may require archiving games.

@roseundy roseundy added rules-broken Game comes to the wrong outcome compared with the rules (fixing these will break games) 1841 and removed needs triage labels Aug 29, 2023
@roseundy
Copy link
Collaborator

Just had to remove the superfluous rounding operating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1841 rules-broken Game comes to the wrong outcome compared with the rules (fixing these will break games)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants