MegaMek / mekhq

MekHQ is a java helper program for the MegaMek game that allows users to load a list of entities from an XML file, perform repairs and customizations, and then save the new entities to another XML file that can be loaded into MegaMek.
http://megamek.org
131 stars 168 forks source link

[49.18] Used Parts Value Multipliers set to 0 #3993

Closed gsparks3 closed 3 months ago

gsparks3 commented 5 months ago

Recently, we have been seeing multiple reports of users suddenly seeing units worth 0 C-bills, which invariably turns out to be due to all of the Used Parts Value Multipliers having been set to 0 in Campaign Options (Finances tab). I have at least one confirmed case of this in version 49.18 specifically, hence the version tag, which also agrees with the issue only cropping up recently.

In these cases, the users never deliberately set the Used Parts Value Multipliers to 0. The cause of this change is currently unknown; the purpose of this report is to record the issue and any testing that has been done. Current results from some quick testing of actions reported by a user experiencing the issue:

Further testing and/or reports from users experiencing this issue are welcomed. For the latter, please record as much as possible of what you did with the program immediately prior to spotting the issue.

Sleet01 commented 5 months ago

It looks like if the user presses the "OK" button or the "Save" action occurs in the Campaign Options dialog before the presets are loaded, these values will be set to 0 (the default spinner values) instead of being set to the campaign preset's value array. I'm checking to see how easy that situation is to create...

Sleet01 commented 5 months ago

It looks like the trigger might be:

  1. load a game,
  2. save the game (explicitly or via auto-save) without ever opening Campaign Settings.

as this causes the financials tab to be instantiated with default values of 0.0 for all Used Parts Value Multipliers, but not set to the values loaded from the campaign file, and then may save the values from the spinners themselves (all 0.0) into the next save file.

I'll confirm tonight.

Sleet01 commented 5 months ago

Nope, that's not it >_<

gsparks3 commented 5 months ago

49.19 user report:

1.)Booted MekHq 2.) Chose Stratcon Alpha 3.) Played with date, settled on Jan 1 3039 4.) Changed Name 5.)Altered some settings(Can't tell you exactly which ones sorry). Increased xp gain substantially across the board. 5a.) I did notice that when I initially booted mekhq and loaded stratcon alpha the finances tab had no options to pay for anything checked and the used parts multipliers were all 0, didn't know exactly what the used parts multipliers affected so didn't mess with those. 6.) Rolled starting units 7.) Proceeded to start refitting my units using the built in mekhq meklab 8.)Noticed that the cbill cost for all of my still stock units was 0, there was a small cost for one of my refitted units, a refitted LGB-0W. 9.)Reloaded my new save in mekhq to see if restarting fixed it, noticed that the LGB that previously showed a small cost was now at 0 cbills. That's about the most I remember. The settings I changed besides xp gain were mostly just to check boxes for pay for repairs etc that were mysteriously unchecked when I first loaded stratcon.

Seems that it may actually be an issue with loading a preset, but there is something else going on as well, such that it doesn't happen every time.

Daishi-5 commented 4 months ago

I seem to be able to recreate the issue by changing the campaign setting in "repair and maintenance" for "reverse quality names" Here are my testing steps so far.

First I tried changing barely anything. open campaign options, save campaign options, open options, no change. Open campaign options, close campaign options, open options, no change. Open Campaign options, change setting to "reverse quality names", save campaign options, open campaign options, numbers set to 0 Reload

Then I tried just changing something in other options. Open mekhq options, save mekhq options, close mekhq options, open campaign options, no change. Open mekhq options, change "command center mass repair/mass salvage button", save, no change. Open campaign options, change "reverse quality names", save campaign options, open campaign options, numbers set to 0 reload

Then I tried changing various settings. open campaign options, save as preset, no change.

I tried changing a few options under maintenance and repair to see if anything else caused it. open campaign options, change "usa era mod for repair rolls", save, no change open campaign options, change "user era mod for repair rolls" back, save, no change open campaign options, change "log maintenance rolls in log file", save, no change open campaign options, change "log maintenance rolls in log file" back, save, no change

Then I tried a few other settings in different tabs just to be sure it didn't happen again. open campaign options, change "variable tech level", save, no change open campaign options, change "variable tech level" back, save, no change open campaign options, change "use individual initiative bonus", save, no change open campaign options, change "use individual initiative bonus" back, save, no change

Then I repeated the steps to recreate several times to make sure it reliably happened for me. Open Campaign options, change setting to "reverse quality names", save campaign options, open campaign options, numbers set to 0 Reload over and over a few times, always worked.

I also have two saves, one autosave before it happened, and one after. The one after probably isn't much use, but I confirmed I can load the save from before, change that setting, save it, and when I go to look at contracts, all my contracts are paying 0, and the setting in the options has changed.
After Bug.gz Before Bug.gz

Daishi-5 commented 4 months ago

Brief follow up, the change I made was to turn it on, or fill in the checkbox. I don't have a save where the box is already checked to see if the opposite causes the problem.

Tecmes commented 4 months ago

Yep, one thing is clear: toggling "Reverse quality name" wipes all settings in the Finance tab. Likely because it also reverse the order for the A...F used parts value. Because it's actuall changing the form, it seems it also wipes checkbox settings, and also number boxes for used parts values, reset to zero, hence the issue with selling units!

Tecmes commented 4 months ago

Also the hover tooltip on the Used Parts Value Multipliers has a cryptic comment about the fact that it doesn't change based on the Reverse quality name setting. I'm actually not clear whether the tooltip is in error (a throwback to a previous version) or exactly right and highly confusing!