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
128 stars 163 forks source link

Scenario Resolution: Destroyed enemy Panther disappears from assigned kill list #2412

Open JonhyBurner opened 3 years ago

JonhyBurner commented 3 years ago

MekHQ 0.47.16 Open JDK 11

During a scenario I killed 2 enemy Panthers, one directly, one by pilot ejection due to missing a leg. At the end of battle report, they both appear as destroyed. But on the scenario resolution they have a weird behaviour.

They show up on the salvage list: ScenarioResolution_salvage

One disappears from the kill list (the one killed by ejection): ScenarioResolution_kills

They both appear again on the objectives screen: ScenarioResolution_objective

Files: megameklog.zip mekhqlog.zip

Grand Campaign Breafing2.cpnx.gz customs.zip autosave.sav.gz

BullseyeSmith commented 3 years ago

MHQ 47.17 I was about to report this same issue, but thought it best to review all currently reported bugs first. :) I've played half a dozen scenarios over the past week and routinely cross this problem. If there are more than one of the same unit, the second unit does not receive the "#2" designation at the end of it. If there are more than 2, the third one does receive the "#2" designation. Because kills are not tracked by unique IDs, the system only recognizes the first kill of the duplicates. Just to keep it interesting, it does not appear to forget the #2 every time, just some times. Below is a list of units generated on my resent games:

Harasser Laser Platform (Standard) (Draconis Combine) Pegasus Scout Hover Tank (Standard) (Draconis Combine) Skulker Wheeled Scout Tank (Standard) (Draconis Combine) Vedette Medium Tank (AC2) (Draconis Combine) Vedette Medium Tank (Standard) (Draconis Combine) Vedette Medium Tank (Standard) (Draconis Combine) Vedette Medium Tank (Standard) #2 (Draconis Combine) Vedette Medium Tank (Standard) #3 (Draconis Combine)

The second Vedette (the duplicate first) did not register for the salvage screen or the kill screen.

Condor Heavy Hover Tank (Standard) (Draconis Combine) Hunter Light Support Tank (Standard) (Draconis Combine) Jenner JR7-D (Draconis Combine) Ostscout OTT-7J (Draconis Combine) Pegasus Scout Hover Tank (Standard) (Draconis Combine) Peregrine Attack VTOL (Standard) (Draconis Combine) Saladin Assault Hover Tank (Standard) (Draconis Combine) Saladin Assault Hover Tank (Standard) (Draconis Combine) Saladin Assault Hover Tank (Standard) #2 (Draconis Combine) Scorpion Light Tank (Standard) (Draconis Combine) Shadow Hawk SHD-2K (Draconis Combine) UrbanMech UM-R60 (Draconis Combine) Warrior Attack Helicopter H-7A (Draconis Combine) Warrior Attack Helicopter H-7C (Draconis Combine) Wasp WSP-1A (Draconis Combine) Wyvern WVE-6N (Draconis Combine)

The duplicate Saladin did not show up for salvage or kill.

This Base Attack list shows that sometimes it worked, and sometimes it didn't:

Centurion CN9-A (Draconis Combine) Dragon DRG-1N (Draconis Combine) Grasshopper GHR-5H (Draconis Combine) Ostscout OTT-7J (Draconis Combine) Panther PNT-9R (Draconis Combine) Sabaku Kaze Heavy Scout Hover Tank (Standard) (Draconis Combine) UrbanMech UM-R60 (Draconis Combine) Vedette Medium Tank (Standard) (Draconis Combine) Vedette Medium Tank (Standard) #2 (Draconis Combine) Vedette Medium Tank (Standard) #3 (Draconis Combine) Wasp WSP-1A (Draconis Combine) Wasp WSP-1A (Draconis Combine)

Condor Heavy Hover Tank (Standard) (Draconis Combine Force #2) Condor Heavy Hover Tank (Standard) #2 (Draconis Combine Force #2) Goblin Medium Tank (Standard) (Draconis Combine Force #2) Goblin Medium Tank (Standard) #2 (Draconis Combine Force #2) Panther PNT-9R (Draconis Combine Force #2) Sabaku Kaze Heavy Scout Hover Tank (Standard) (Draconis Combine Force #2) Scorpion SCP-1N (Draconis Combine Force #2) Vedette Medium Tank (Standard) (Draconis Combine Force #2) Vedette Medium Tank (Standard) #2 (Draconis Combine Force #2) Vedette Medium Tank (Standard) #3 (Draconis Combine Force #2) Vedette Medium Tank (Standard) #4 (Draconis Combine Force #2) Vedette Medium Tank (Standard) #5 (Draconis Combine Force #2)

LRM Carrier (Standard) (Lyran Commonwealth) LRM Carrier (Standard) (Lyran Commonwealth) LRM Carrier (Standard) #2 (Lyran Commonwealth) Manticore Heavy Tank (Standard) (Lyran Commonwealth) SRM Carrier (Standard) (Lyran Commonwealth) SRM Carrier (Standard) (Lyran Commonwealth) SRM Carrier (Standard) #2 (Lyran Commonwealth) Vedette Medium Tank (AC2) (Lyran Commonwealth)

For the Draconis Combine, it correctly numbered the Vedettes but duplicated the Wasp. For the Draconis Combine Force #2, it correctly numbered the Condors, Goblins, and Vedettes. For the Lyran Commonwealth, it duplicated the LRM & SRM Carriers.

I hope this info helps troubleshoot the issue for you fine developers.

sixlettervariables commented 3 years ago

Odd we're not using their unique ID ("external ID" under the hood).

Seems like this bumps the priority for https://github.com/MegaMek/megamek/pull/2632

BullseyeSmith commented 3 years ago

I believe the initial reason for not using the external ID of the killed is for the Kill Log. It would be difficult to manually add kills if the external ID was required. However, the external ID could be used for the killed just as the killer external ID is used for the kill within the MUL for ease of scenario resolution, then the killed unit and killer unit names can be swapped out for the plain text when added to the personnel's kill log. That way the kill log stays easily editable long after the scenario is accurately resolved.

This issue also ties into the foundation of tracking scenario and mission kills for award purposes as addressed in RFE: Save kill summary on mission completion #2433

Windchild292 commented 3 years ago

It should be using the external id to process through the dialog until the Kill is created. Kills must use the names instead of the ids for that reason @BullseyeSmith, as units may be removed and no longer tracked by MM, but the Kills should persist.

BullseyeSmith commented 3 years ago

From within a MUL:

    <kills>
        <kill killed="Hunter Light Support Tank (Standard) (Draconis Combine)" killer="None"/>
        <kill killed="Wyvern WVE-6N (Draconis Combine)" killer="8a64e2a7-7fce-4fd9-a27a-5f1b9f3a99ad"/>
    </kills>

The killer is either "None" or the External ID of the killer. If the killers external ID can be swapped out for the primary option in the killer dropdown fields, why not also use the killed's External ID on the MUL and swap out for the plain text in the killed label fields?

These are the results in another MUL:

    <kills>
        <kill killed="Pilot Brent Pula (Draconis Combine)" killer="None"/>
        <kill killed="Griffin GRF-1N (Draconis Combine)" killer="None"/>
        <kill killed="Locust LCT-1V (Draconis Combine)" killer="None"/>
        <kill killed="Jenner JR7-D (Draconis Combine)" killer="None"/>
        <kill killed="Pilot Bree Murnaghan (Draconis Combine)" killer="None"/>
        <kill killed="Wasp WSP-1A (Draconis Combine)" killer="None"/>
        <kill killed="UrbanMech UM-R60 (Draconis Combine)" killer="None"/>
    </kills>

In this game, there were two LCT-1V and two WSP-1A. In this scenario, both WSP-1A showed up on the Claim Salvage screen (one Crippled & one Inoperable), but only one LCT-1V (Salvage). The other LCT-1V might have been an ammo explosion, now that I think about it, so I misspoke earlier about this issue affecting Claim Salvage. Also, all eight MechWarriors show up on the Captured Personnel Status screen, even if ejected and not picked up, so I also misspoke on #2443. But the above six mechs and pilot are all that show up on the Assign Kills screen. Since the killed entity data is within the MUL, it should be possible to store the External ID of the killed in the MUL and transfer to plain text for the Assign Kills screen and kill log entries. That way you can use unique IDs for killed within the MUL without having to save the entity info within MHQ save files.

Windchild292 commented 3 years ago

I'm not seeing any images if you are trying to display some. As for MechWarrior handling, there are a number of open bugs for it currently.

BullseyeSmith commented 3 years ago

I removed the less than signs of the kills entries. It should be visible now.

sixlettervariables commented 3 years ago

@BullseyeSmith I edited your post to use code fences (three backticks "`") which allow you to use things that would normally need to be encoded (such as < and >).

BullseyeSmith commented 3 years ago

At first I'm like, "Cool! Now may post is better looking." Then I was like, "Wait a minute... others can put words in my mouth. Kind of creepy."
(yes, I can use the edited by dropdown to see historical posts. But you have to know to look for it.)

Windchild292 commented 3 years ago

Just verified that we internally track using the name, not the id @sixlettervariables

BullseyeSmith commented 3 years ago

image Here's where the problem starts, at the weekly generation of Scenarios. The highlighted Saladin is the second Saladin. The first Saladin is on the second line. The third Saladin is on the line below the highlighted line and has the #2 designation on it. When I see a dupe like this before the scenario starts, I know I'm going to need to make some manual kill log entries later.