urarthur / AoE2_Attack_Analyzer

https://aoe2-attack-analyzer.vercel.app
2 stars 0 forks source link

Not symetric results #2

Open flannerybh opened 2 days ago

flannerybh commented 2 days ago

If you choose a Aztec skirm, vs Aztec archer, it says On equal 1000 resources, 16 SKIRMISHER vs 14 ARCHER, SKIRMISHER wins with 8 units remaining

If you swap the units, it then says On equal 1000 resources, 14 ARCHER vs 16 SKIRMISHER, SKIRMISHER wins with 13 units remaining

Seems like bonus damage from the defender is not being included.

urarthur commented 1 day ago

Thank you for the report. The results are not symmetric due to the advantage of the first attacker. I have programmed a turn-based attack system to make it more realistic than merely dividing the total HP by the total attack.

I also specifically accounted for the bonus damage for the defending unit.

However, I agree that it doesn't make much sense not being symmetric. I will check how to adjust it.

flannerybh commented 1 day ago

When the archer is the attacker, the calculated totalDamage for the attacker is 1 the number of units, but when the skirm is the attacker, the calculated totalDamage for the defender is 4 the number of units. These should be the same. That's why the archer does much better when he's the defender.

urarthur commented 1 day ago

OK, I'll take a look.