I’ve posted yesterday about aoe2counters.com and I have received quite a lot of feedback and also, quite a lot of people told me that there’s some mistakes in the Strong vs. / Weak vs. information.
I will rebuild my whole database from scratch and I am trying to calculate the unit counters in a more dynamic way, rather than hard code it. For this, I am trying to understand how a unit “counter” is computed.
From what I understand from Wiki, each unit has an armour class and an attack type, which can be melee or ranged. And, most units have an attack bonus against certain armour classes. So, for example, a Halberdier has +32 attack bonus vs. Cavalry. This means that a Halberdier has his normal attack + blacksmith upgrades + 32 against any unit with a Cavalry armour type? Regardless of circumstances, as long as a unit has Cavalry, the Halberdier will ALWAYS have +32 attack bonus?
Because if so, the whole business would be really simple: find which unit has the highest attack bonus vs. Unit Y and put that down as the counter.
Please, if you know anything extra about unit counters that I could use in my project, feel free to share.
Short, yes. Longer: Yes, if attacked unit has Cavalry Armour set on “0” - what is deafult setting. And dmg equasion will be:
(Attack - Armour(meele or pierce)) + (Bonus Attack - Bonus Armour)= Dmg output. Dmg Output cannot be smaller than 1.
Also good thing will be how dmg output is realted to the max Target HP. Dmg output =% of max HP - this will give you idea how strong counter is.
For normal units its rather simple, more complicated is with the Unique Units.
Absolute legend, thank you very much. Things are more clear now.
I always thought that Damage output is substracted from HP. As in, if unit attacking causes 20 damage, then the defending unit loses 20 HP. Now I find out that damage output is actually a percentage of the target’s max. HP.
If you want to understand how damage calculations use the attack and armor classes, I have a video about that: https://youtu.be/FdBk8zGbE7U
There’s a version of the Advanced Genie Editor included along with the files for DE (select to browse local files, then look in the Tools_Builds folder. You can use this to view the information for all units. There’s a C++ library called “genieutils” you can use if you want to parse the game’s data files.
As far as what a “counter” is, though, I’m not sure if there’s a good way to generate that automatically. The attack/defense armor classes don’t tell the whole story. Timing, upgrades, and micro matter significantly. For example, Skirmishers counter Archers. But Feudal Age Skirmishers lose to Crossbowmen, since the Crossbowmen have extra range. But if those Crossbowmen wander blindly into Feudal Age Skirmishers, then the Skirms still can win. And then when the Skirmishers are themselves upgraded to Elite Skirmisher, then they counter the Crossbowmen again.
Further, sometimes “counter” units don’t beat the unit they counter in a straight-up fight, but rather work as a counter because they are more cost effective and easier/cheaper to create.