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

[0.49.20] Bug: BA c-bill cost calculation errors/mismatches #4473

Closed
Gribbly1 opened this issue Jul 23, 2024 · 7 comments
Closed

[0.49.20] Bug: BA c-bill cost calculation errors/mismatches #4473

Gribbly1 opened this issue Jul 23, 2024 · 7 comments
Assignees
Labels

Comments

@Gribbly1
Copy link

Bundled Megamek with MekHQ 0.49.20
Windows 10, Java Version: 11.0.13

Tech Manual p281 BATTLE ARMOR STRUCTURAL COSTS AND AVAILABILITY, p285 for final unit cost.

BA financial values are inconsistent across the purchase unit menu, procurement info pane, Hangar and financials tab.

BAtest.cpnx.gz

Note: parts value set to 1 for clarity.

longinus

long2

long3

long4

MML dry calc for comparison:

image

@repligator
Copy link
Collaborator

Math time:

Cost With Ammo=2548320
Dry Cost=2440320
Mystery Cost=1948320

2548320-1948320=600000

600000= the cost to train 1 Longinus Battle Armor Pilot multiplied by 4

MHQ is charging you 600,000 C-Bills less because you are only buying the suits, you have to supply your own pilots.

@Gribbly1
Copy link
Author

Math time:
1,948,320 does not equal 6,195,280

@repligator
Copy link
Collaborator

Math time: 1,948,320 does not equal 6,195,280

Apologies if I sounded glib earlier, that was not my intention.
After further investigation, it appears MHQ is using the INF_JUMP priceMultiplier (2.6) on these BA's.
2382800(the base cost of the parts according to partsValue)x2.6=6195280

This can be confirmed by setting breakpoints on lines 963 and 964 of megamek/common/Infantry.java

@repligator repligator added the Bug label Jul 23, 2024
@Gribbly1
Copy link
Author

No worries.

Is there a way to see exactly what partsValue is made up from? It doesn't seem to correspond to the dry cost or purchase cost.

Also the ammo cost should be negligible for one shot SRM2's, not the full 27k*4 for 45 shots per suit.

@repligator
Copy link
Collaborator

Is there a way to see exactly what partsValue is made up from? It doesn't seem to correspond to the dry cost or purchase cost.

These are the 29 parts that are being used for the calculation.
Screenshot_20240723_134422

The only way I know of to generate this list (in human readable format) is to run MHQ through an IDE (for example IDEA) and set a breakpoint.

@IllianiCBT IllianiCBT self-assigned this Jul 23, 2024
@repligator
Copy link
Collaborator

See also #1795

@IllianiCBT
Copy link
Collaborator

Closing as resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants