JOverseer / joverseer

JOverseer is a desktop application which aims to assist players of the Middle Earth PBM game.
BSD 3-Clause "New" or "Revised" License
3 stars 5 forks source link

computeNativeArmyStrength computes army strength incorrectly #745

Open dswoap opened 9 months ago

dswoap commented 9 months ago

The computeNativeArmyStrength function in org/joverseer/tools/combatCalc/Combat.class performs its computation incorrectly.

The attack strength for each troop type should be calculated by multiplying the base attack strength by the sum of: (A + B + C + D + X + Y + Z + Z) / 800 then adding each troop type's attack strength together to find the army's total attack strength.

Instead, the code is generating an attack strength for each troop type by multiplying the base attack strength by ((A + B + C + D) / 400), then adding the attack strengths of each troop type together, and then further multiplying that sum by ((X + Y + Z + Z) / 400), which generally results in a far lower attack strength than the army actually has.

where: A = Training Rank of troop type B = Weapon Rank of troop type C = Tactics Modifier for troop type D = Terrain Modifier for troop type X = Total Command Rank of army commander Y = Morale of army Z = Nation-specific Terrain/Climate Modifier