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.50.0 and on] Support Vehicles Become Invalid When Saved, BAR Level Edition #1631

Open
7 tasks done
WeaverThree opened this issue Oct 4, 2024 · 6 comments
Open
7 tasks done
Assignees
Labels
Blocker Bug Severity: High Issues described as high severity as per the new issue form

Comments

@WeaverThree
Copy link
Collaborator

WeaverThree commented Oct 4, 2024

Prerequisites and Pre-Issue Checklist

  • I'm reporting the issue to the correct repository:

  • MegaMek

  • MegaMekLab

  • MekHQ

  • I've tested the issue against at least the latest MILESTONE version

  • I've asked on the MegaMek Discord about the error

  • I've reviewed the BattleTech rules and MegaMekLab documentation, and I've confirmed that something isn't working as intended.

  • I've searched the Github tracker and haven't found the issue listed

Severity *

High (Major Disruption): A major feature is broken or incorrect, but a workaround exists.

Brief Description *

When you save a support vehicle, its armor BAR and tech ratings change such that the armor weight is larger and causes the vehicle to be overweight, and the armor is too dense to be used without the armored chassis mod. Details below.

Tested in 0.50.0 and a recent nightly.

It's likely this is related to #1596.
It's possible this is related to #1489.
This might be what's causing the Sherpa variants to be invalid, or other support vehicles.

Steps to Reproduce

  1. Start MML and hit "New Support Vehicle"
  2. First Page: Set Tonnage to 50, Cruise MP to 5, Fuel Mass to 5. Give the unit a Chassis and Model for the filename.
  3. Armor page: Select BAR 7 Armor, maximize armor, auto-allocate armor. The armor tech level will be D by default.
  4. Transport page: Click 'Use Remaining Tonnage for Cargo'
  5. Press Validate Unit - validation passed
  6. Save the file. Load the saved file. Say you don't want to save the file again.

The warning dialog will appear saying:
2024-10-04_103051

  1. Hit OK and note that the armor tonnage on the first page has jumped up.
  2. Go to the Armor Page again. Note that the armor type has changed to BAR 2, tech rating B, and the tonnage has increased.
  3. You can now only select BAR 2 or BAR 3 armor.
  4. Select 4 tons of rating B BAR 3 armor and hit Auto-Allocate
  5. The unit is now under tonnage so go to the transport page and add another ton of cargo space.
  6. Save and load the file again. It works this time, without being invalid.

These are the relevant blk files:

Broken Step By Step.zip

Operating System *

Linux

Java Version *

17.0.12

MegaMek Suite Version *

v0.50.0

Custom MegaMekLab Version

v0.50.01-SNAPSHOT 2024-10-02

Attach Files

megameklab.MegaMekLab.initializeLogging(MegaMekLab.java:81) - Starting MegaMekLab v0.50.1-SNAPSHOT
Build Date: 2024-10-03T03:24:04.067850647
Today: 2024-10-04
Origin Project: MegaMekLab
Java Vendor: Eclipse Adoptium
Java Version: 17.0.12
Platform: Linux 6.11.1-203.fsync.fc40.x86_64 (amd64)
System Locale: en_US
Total memory available to MegaMekLab: 1 GB
MM Code Revision: a53044ee0763666eba74cdeaf511e150d291b1f0
MML Code Revision: ec33845
MHQ Code Revision: 7eb17ed577293cf4fe52daeba4b0e9bf3223f902

Nothing of note appears in the log files.

Final Checklist

  • I've checked to make sure that this issue has not already been filed
  • I'm reporting only one issue in this ticket for clarity and focus
@UlyssesSockdrawer
Copy link
Collaborator

I've been able to reproduce this issue.

Steps to Reproduce
(1) - Open the Sherpa Armoured Truck in MML
(2) - Change nothing on the design. Add a variant name of whatever (I used 2).
(3) - Save the design to your customs folder somewhere. Close MML.
(4) - Reopen MML and try to load the design. Design shows as invalid for being 7 tons overweight.

@HammerGS
Copy link
Member

HammerGS commented Oct 7, 2024

Here is a screen shot of the failed unit.

image

@HammerGS HammerGS added Bug Blocker Severity: High Issues described as high severity as per the new issue form labels Oct 7, 2024
@UlyssesSockdrawer
Copy link
Collaborator

UlyssesSockdrawer commented Oct 7, 2024

@Sleet01 - Hammer and I did some digging. We think but it's hard to confirm, that this issue might relate to this PR: https://github.com/MegaMek/megamek/pull/5634/files

Reading the lines, my suspicion is it might relate to either:

megamek/src/megamek/common/loaders/BLKFile.java

image

OR

megamek/src/megamek/common/loaders/BLKSupportTankFile.java

image

Apologies for the tag, but I have no idea how I'd debug/fix this myself.

@Sleet01
Copy link
Collaborator

Sleet01 commented Oct 7, 2024

@UlyssesSockdrawer NP, I'll take a look this evening.

@Sleet01 Sleet01 self-assigned this Oct 7, 2024
@Sleet01
Copy link
Collaborator

Sleet01 commented Oct 8, 2024

It appears that this is more fallout of the armor / equipment updates, as I see similar but not identical issues in 0.49.19.1.

Interestingly, loading the Sherpa in recent releases does not show BAR 10 as a valid armor, even with Armored Chassis set, but saving off a copy of the .BLK file from MML keeps BAR 10 iff no armor changes are made. So I'd guess we are seeing a UI issue here.

@UlyssesSockdrawer
Copy link
Collaborator

With the Sherpa in particular, I believe it's meant to be BAR8 rather than BAR10, so there is an issue there with save/load of that vehicle at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocker Bug Severity: High Issues described as high severity as per the new issue form
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants