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

ATB, some units fail to get updated when resolving scenario #159

Closed
crazys1 opened this issue Sep 15, 2016 · 8 comments
Closed

ATB, some units fail to get updated when resolving scenario #159

crazys1 opened this issue Sep 15, 2016 · 8 comments

Comments

@crazys1
Copy link

crazys1 commented Sep 15, 2016

MekHQ 0.3.32

Description:

I have completed several ATB scenarios, and each time at least one unit (usually 2) fails to get updated based on the results of the scenario. For example, say that the affected unit is a 'Mech, the 'Mech lost its right arm during the battle (it began the battle undamaged), and the 'Mech killed 3 enemies. After you resolve the scenario in MekHQ, the 'Mech will not have any damage, and the pilot will not have credit for the 3 kills. In fact, the pilot will not have credit for being in the scenario in his personnel log. Since the pilot does not get credit for any kills and is treated as if he didn't even participate in the scenario, he does not gain any xp for the scenario.

I attached a zip file that contains:

  • A saved game just as I won a battle.
  • The MekHQ and MegaMek log files.
  • All of the custom 'Mechs that I used.
  • My MekHQ campaign file.

The files are in the standard MegaMek directory structure, so you can unzip the files directly into a MegaMek installation to test this.

How to Reproduce:

  1. Load the enclosed campaign.
  2. Go to the Briefing Room tab.
  3. Choose the last scenario (the pending one).
  4. Click "Load Saved Game" and choose the enclosed saved game file. In MegaMek, you will see the final results that led to my victory.
  5. Click "Done". The victory screen displays.
  6. In the "Save Units?" dialog, click "No".
  7. On the victory screen, you can see all 20 of my involved units. 19 are survivors and 1 is in the graveyard. 1 of the 19 was added to my player as part of the ATB scenario (the Garm). Take note of the following 2 units and pilots:

Black Hawk (Nova) S #2 (Nine-Tailed Foxes)
Pilot : Private Suzy Bae [5/7](1 hit%28s%29)
Kills : 1

Loki (Hellbringer) 9TF Prime (Nine-Tailed Foxes)
Pilot : Private First Class Krystal Jung [4/5]
Kills : 3

  1. Click "Done".
  2. In the MekHQ "In Control of Battlefield" dialog, click "Yes".
  3. In the various "Status" dialogs, click "Next" until you get to the "Pilot Status" dialog. Note that Suzy Bae and Krystal Jung are missing.
  4. Click "Next" until you get to the final dialog.
  5. Click "Finish".
  6. Go to the "Personnel" tab.
  7. Find either Suzy or Krystal and notice that neither of them show that they participated in the scenario. The entry should say, "Participated in Base Attack (Defender) during mission Defend Zollikofen" with a date of 02/13/3145. You can see this entry in any of the other 'Mech or aerospace fighter pilots. Also notice that neither have any kills on 02/13/3145, even though as seen in step 7, they had 1 and 3 kills, respectively.
  8. Go to the "Hanger" tab.
  9. Find Suzy's Mech. Notice that it does not have any armor damage. However, if you open the entitystatus.txt file that was generated when you resolved the scenario, you can see that in reality all of her Black Hawk (Nova) - S's head armor is gone, and there is minor damage to most locations. (You'll also see that in MekHQ, all internal structure except the CT and HD are showing values of "x", which is due to a different bug that I reported in a separate issue.)

Other Notes:

I tried resolving this scenario manually, and I encountered the same issue.

MekHQ_resolution_bug.zip

@crazys1
Copy link
Author

crazys1 commented Sep 15, 2016

This bug seems to be related to issue 146 (that I also reported).

#146

Using the same campaign and saved game that I attached in this issue, I was able to prevent this issue (as in, issue 159) from occurring by doing the following:

  1. In MekHQ, load the campaign.
  2. In the TO&E tab, undeploy all of the units.
  3. In the Hanger tab, select all of the units and do a "GM Mode > Restore Unit" to fix all of the internal damage that is caused by issue 146.
  4. In the TO&E tab, deploy all of the units to the one and only pending scenario.
  5. In the Briefing Room tab, load the MegaMek saved game (included in the original attachment) for the one pending scenario.
  6. Complete the battle as described above. This time, you will see that Krystal and Suzy both got credits for their kills and for participating in the scenario. Suzy's 'Mech will also have the proper damage recorded, and she as the pilot will appropriately have taken 1 damage for her 'Mech's head having been hit once.

So, if you can fix bug 146, then this bug becomes moot.

@neoancient
Copy link
Member

I fixed #146 but you did not include the campaign file so I can't test whether it resolved this issue.

@crazys1
Copy link
Author

crazys1 commented Sep 29, 2016

I provided a campaign file in both this bug (see the attached zip file) and also in #146 (see the zip file in both the original bug and my first comment). I'm not sure what you mean...

In any case, since you were able to fix the GM Mode > Restore Unit bug, this bug is probably will not occur as often, if at all.

@crazys1
Copy link
Author

crazys1 commented Sep 29, 2016

My bad. I included the campaign file in bug 146, which as per comment above, you can use that same campaign file to test this bug. For convenience, I attached it here.

Nine-Tailed.Foxes.zip

@neoancient
Copy link
Member

neoancient commented Oct 1, 2016

That campaign file does not include the scenario in your saved game.

@crazys1
Copy link
Author

crazys1 commented Oct 1, 2016

Sorry about all of the confusion. I must be losing it; I was pretty sure that the two files correlated.

In any case, I set up a new saved game and campaign file that FOR SURE works to demonstrate this bug. The attached .zip file contains the following files:

  • 9tf.sav.gz--The saved game.
  • Nine-Tailed Foxes test.cpnx--The campaign file.
  • The necessary custom 'Mech files.

To reproduce the bug:

  1. In MekHQ, load the "Nine-Tailed Foxes test.cpnx" campaign file.
  2. Go to the Briefing Room tab and choose the last (pending) scenario. It has one unit deployed--a Masakari. The Masakari currently has 10 engine hits due to the bug with "GM Mode > Restore Unit".
  3. Click Load Saved Game and choose "9tf.sav.gz".
  4. In MegaMek, complete the battle. The saved game begins with the end of the fire phase that has the one enemy unit getting destroyed. So, you just need to click Done a few times.
  5. In MekHQ during the scenario resolution, notice that the Masaraki and its pilot Bo-Young Park do not show up as surviving units or pilots. Those pages of the dialog are skipped entirely since there are no other units or pilots on my side.

MegaMek bug 159 test.zip

@neoancient
Copy link
Member

You were correct. The issues were related, but I couldn't be certain until I could verify what was happening. The scenario resolution procedure skips units that were ineligible to deploy (which is still the status in MHQ at this point in the process), so those units and their crews do not get updated. MHQ will not allow you to start a scenario with undeployable units, but if you do not complete it in a single session the GM >> Restore bug would put it back into an undeployable state and the resolution would not be applied.

I consider this fixed in [f381b30].

@crazys1
Copy link
Author

crazys1 commented Oct 1, 2016

That sounds reasonable to me. Thank you for looking into this, putting up with my confusion, and resolving the root cause of the bug (the other bug)!

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

No branches or pull requests

2 participants