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
133 stars 171 forks source link

Auto munitions always applies the same ammo order #4798

Open TenkawaBC opened 2 months ago

TenkawaBC commented 2 months ago

Environment

What version of MekHQ does your issue apply to? v0.50.0 What operating system are you using? Windows, Mac, or Linux? Windows What java version are you using? 17

Description

The new auto munitions generation for alternate munitions, once it generates the preferred weighted order, it always applies the same order to all units that carry ammunition.

In an experimental tech, 3083 game, this gave every single SRM carrying unit Tandem-Charge warheads. (Including an SRM carrier). This was tested multiple times.

In my opinion, while it should provide a weighting for the ammunition, it should still be randomized and weighted for the bins. So there isn't a 100% chance of them always carrying the first ammunition. Additionally, some ammo types should be decreased in weight (TC, Swarm-I) due to their potentially deadly nature.

In Campaign Operations, page 200-201 it talks about needing the right availability for parts. part availability is in Tech Manual p 345 for ammo. Tac ops advanced equipment p 228 for ammo

Code File

megamek/src/megamek/client/generator/TeamLoadoutGenerator.java

Files

Output of ADF files

Test 1: IS General Crusader:CRD-7L:Panut Prawiranega::Streak SRM 4:Standard::LRM 15:LRM 15 Heat-Seeking:LRM 15 Follow The Leader:LRM 15 Dead-Fire:Standard Plainsman Medium Hovertank:(Scout):Randy MacFadden::SRM 6:SRM 6 Tandem-Charge:SRM 6 Heat-Seeking SRM Carrier::Cedomil Lugoboy::SRM 6:SRM 6 Tandem-Charge:SRM 6 Heat-Seeking:SRM 6 Dead-Fire:Standard Brutus Assault Tank::Catriona Lyle::LRM 20:LRM 20 Heat-Seeking:LRM 20 Follow The Leader:LRM 20 Dead-Fire::SRM 2:SRM 2 Tandem-Charge::SRM 6:SRM 6 Tandem-Charge Rhino Fire Support Tank::Animaisa Kulakov::LRM 20:LRM 20 Heat-Seeking:LRM 20 Follow The Leader:LRM 20 Dead-Fire::LRM 10:LRM 10 Heat-Seeking Condor Heavy Hover Tank:(Upgrade) (Laser):Bernard Massengill::LRM 15:LRM 15 Heat-Seeking:LRM 15 Follow The Leader::MG Ammo:Standard::AMS Ammo:Standard Hi-Scout Drone Carrier::Harta Villegas::SRM 2:SRM 2 Tandem-Charge Hi-Scout Drone Carrier::Leon Sazhinov::SRM 2:SRM 2 Tandem-Charge Griffin:GRF-1N:Liberat Malyusov::LRM 10:LRM 10 Heat-Seeking:LRM 10 Follow The Leader JagerMech:JM6-S:Flawiusz Cerkivica::AC/5:Precision AC/5:Armor-Piercing AC/5::AC/2:Precision AC/2 Blizzard Hover Transport::Mary Chieu::LRM 5:LRM 5 Heat-Seeking BattleMaster:BLR-1G:Valdemar Koblitz::SRM 6:SRM 6 Tandem-Charge:SRM 6 Heat-Seeking::MG Ammo:Standard

Test 2: Capellan Confederation Crusader:CRD-7L:Panut Prawiranega::Streak SRM 4:Standard::LRM 15:LRM 15 Heat-Seeking:LRM 15 Follow The Leader:LRM 15 Dead-Fire:Standard Plainsman Medium Hovertank:(Scout):Randy MacFadden::SRM 6:SRM 6 Inferno:SRM 6 Tandem-Charge SRM Carrier::Cedomil Lugoboy::SRM 6:SRM 6 Inferno:SRM 6 Tandem-Charge:SRM 6 Heat-Seeking:SRM 6 Dead-Fire Brutus Assault Tank::Catriona Lyle::LRM 20:LRM 20 Heat-Seeking:LRM 20 Follow The Leader:LRM 20 Dead-Fire::SRM 2:SRM 2 Inferno::SRM 6:SRM 6 Inferno Rhino Fire Support Tank::Animaisa Kulakov::LRM 20:LRM 20 Heat-Seeking:LRM 20 Follow The Leader:LRM 20 Dead-Fire::LRM 10:LRM 10 Heat-Seeking Condor Heavy Hover Tank:(Upgrade) (Laser):Bernard Massengill::LRM 15:LRM 15 Heat-Seeking:LRM 15 Follow The Leader::MG Ammo:Standard::AMS Ammo:Standard Hi-Scout Drone Carrier::Harta Villegas::SRM 2:SRM 2 Inferno Hi-Scout Drone Carrier::Leon Sazhinov::SRM 2:SRM 2 Inferno Griffin:GRF-1N:Liberat Malyusov::LRM 10:LRM 10 Heat-Seeking:LRM 10 Follow The Leader JagerMech:JM6-S:Flawiusz Cerkivica::AC/5:Precision AC/5:Tracer AC/5::AC/2:Precision AC/2 Blizzard Hover Transport::Mary Chieu::LRM 5:LRM 5 Heat-Seeking BattleMaster:BLR-1G:Valdemar Koblitz::SRM 6:SRM 6 Inferno:SRM 6 Tandem-Charge::MG Ammo:Standard Heavy Tracked APC::Lao-che Folena::MG Ammo:Standard

Test 2: Output the Capellan configuration config pre-units. any:any:any::AC:Precision:Tracer:Armor-Piercing:Standard:Caseless:Flak:Flechette::LRM:Heat-Seeking:Follow The Leader:Dead-Fire:Standard:Thunder-Augmented:Thunder-Inferno:Thunder-Vibrabomb:Thunder-Active::SRM:Inferno:Tandem-Charge:Heat-Seeking:Dead-Fire:Standard:Acid:Mine Clearance:Anti-TSM

TenkawaBC commented 2 months ago

Notes on availability (Note: A= easy to get, F = hard):

Missiles: Smoke LRM/SRMs IS: C/D-D-D, clan: D/D-D-D Swarm LRMs is: E/E-X-D clan: F/E-X-D Swarm-I: E/X-X-D Tandem-Charge SRMs E/X-X-E Thunder LRMs (IS) E/D-X-D Thunder LRMs Clan F/D-X-D Acid SRMs: E/X-X-F ARAD SRMs/LRMs: E/X-X-E FTL LRMs E/F-X-E Mag-pulse SRM/LRM: E/X-X-F Standard SRMs C Standard LRMs C

ACs: Caseless D/X-X-E Flak C/D-F-E Tracer B/D-E-F Standard: C

TenkawaBC commented 2 months ago

Proposed change: Allow for the passing parameter of the contract enemy experience and rating. Note: rating is reversed (F=bad, A=good). In the absence of this, use Regular / D.

For available ammo (after checking for year), use above data with the rules from Campaign Ops to check for availability.

Regular tech team (base 7) (green=8, veteran 6, elite 5), modified by rating (A=-3, D=0, F=+2), and then modified by availability modifier (P.201 camp ops) for the ammo.

Then roll for each munition to see if it is available to that force, for each unit.

Could also use the planet values to set max equipment availability too.