Giving attack bonus to a unit

Is it possible to give attack bonus to a unit who doesn’t normally have it?
For example let’s say I want to give camel archers attack bonus Vs buildings.

You need to edit a modded DAT file with the Genie editor, and in the attack classes area, add a new attack class (you probably want to use attack class 21 for this, which is standard buildings).

1 Like

And would it work if I make a trigger to modify attribute → attack and set 21 as type of attack for that class of units? It’s just cause until now I haven’t use genie but I’m going to learn for the next campaign.

I’m not sure. Based on what I’ve experienced, I don’t think it works to give them an attack modifier in an armor/attack class they don’t already have in the DAT file, but you could try it. See if it works.

1 Like

tested it about 1+ year ago and wont work without the class task

unless they make it a feature that work without needing the attack class

1 Like

I see, that’s unfortunate… thanks anyway!

You might as well try it, if it doesn’t work, we’ll know it’s still broken, and if it does, that’s great.

I tried in a set where it seemed to work. The set was:

Two cavalry archers of different players and a barrack of a third one.
I made a trigger using modify attack, add 10, class 21 on cavalry archers of only one player among the two.
The modified one was dealing 10 hp damage with each arrow while the other just 1.

But then I tried another set, more complex…

I have custom scenarii where I tried to transform caravels into catapult ships with stats similar to cannon galleons.
Usually I use modify attack and add 55 attack to caravels, class 0 but it doesn’t work until I don’t use change object attack and then they get 55 attack.
But when dealing damage to buildings they don’t serve well the purpose dealing only 55 hp damage…
So this time I gave them class 21 when adding 55 attack through modify attribute, it still don’t work unless I add change object attack.
Despite this however they still deal 55 hp damage to a castle I placed there…

So my doubt is do castles and stone buildings have another building class which is not 21? Or was it something else I’m missing?
Because with Barracks and cavalry archers worked fine but not with caravels and castles.


But when dealing damage to buildings they don’t serve well the purpose dealing only 55 hp damage…

Are they dealing 55 damage to buildings? If not, what’s happening and what do you intend?

Despite this however they still deal 55 hp damage to a castle I placed there…

What do you intend for damage to a castle?

1 Like

Yeah it’s pretty simple.
How do you give a specific bonus damage to a unit who doesn’t have one.
Without that my 55 attack caravels just do 55 damage circa to both buildings and units.

Anyway I did further experiments.
I wanted to give 200 bonus against buildings to caravels just like cannon galleons have.
It didn’t work when I gave them 200 attack in class 21 (standard buildings) using modify attribute, but it kinda work with class 11 which is stone buildings iirc.
My modified caravels now deal something like 200 damage to a castle age enemy’s castle.
Maybe the fact it was a castle needed class 11 instead of 21 specifically to work (building armour classes are kinda confusing to me).

Note that the bonus attack is not shown in any way in the unit card so caravels just stay at their normal attack. To increase it to the one of cannon galleons I simply used change attack without changing class (0).

Also it seems that you cannot give more than 255 bonus attack because I guess it’s a byte variable that can contain 256 values only.
In fact I tried to make elite caravels into elite cannon galleons giving them 275 bonus against buildings but the value remained 19 (275 minus 256).
So now another question: how the hell if it’s possible can you give a unit more than 255 bonus attack (like elite cannon galleons) given this limitation?

Maybe try adding bonus damage and then adding it again? The Genie editor can definitely go above 256 damage, so there might be a way to workaround in the scenario editor.

1 Like

Oh yeah that may be a solution!
Anyway I guess the problem is solved if the issue was just the class armour being 11 instead of 21. It’s definitely possible to change bonus attack in the editor.
Can others confirm?

Just looking at the wiki:
The building armor class, sometimes referred to as Class 11 armor

Wiki doesn’t say what number Stone Defense is, but of course you could just check a building that has it. Castles do not have “stone defense” armor class.

It didn’t work when I gave them 200 attack in class 21 (standard buildings) using modify attribute

So you gave them +0 against class 21 first with the data mod (I guess you have to use Genie editor like TheConqueror753 said, I’ve examined game data using it but never modified anything), and then using that data mod you used a trigger (or map script thing?) to give them +200 against class 21?

If you did the first step, try giving them a non-zero value to make sure the data mod part is working correctly. Caravels already have +8 (+9 elite) vs Class 11, so that would work without the data mod.

Edit: just making sure you understand how damage calculation works: damage against all armor classes are calculated separately, minimum zero unless attack is negative (the complicated stuff they introduced for Royal Heirs tech). Most units and all buildings have several armor classes.

I didn’t use genie editor. I just gave them +200 attack against class 11 (since 21 didn’t work) through modify attribute trigger. So what class is 11 then since 21 didn’t work (and supposedly caravels should already have bonus against buildings as you said)? Just to know if it’s possible to change armour class in the editor as that was the original question.

Now elite caravels (+250 class 11 bonus) with 75 base attack deal something like 300 damage to that castle which is good enough I guess.
In the end I decided to give +175 to caravels and +250 to elite caravels. I renamed them catapult ships and made them fire trebuchet balls. You can train the base one in castle age and upgrade in imp.

I’m still rather confused about this game’s unnecessarily complicated armour class system but what I care for is the result… I had these units in all my campaigns to replace cannon galleons but they didn’t have bonus damage against buildings so they were kinda useless since when dromons were added. Now I’m gonna update that to all scenarii!

few things u can try to go over 256 damage (not the actual value you enter in scenario)

  1. tedious, and affects other units. give negative armor to the building and then up to 256 to cannon galleon or w/e unit, then it’ll deal the damage of the difference which will be more than 256.

  2. SHOULD be doable in scenario. give the attacking unit say 250 damage to building class 11 or class 21, use a trigger in scenario to give bonus damage 150% to that unit but only apply it to class 21 or something.

1 Like

Most people don’t understand it!

The wiki explains: Armor class: Building | Age of Empires Series Wiki | Fandom

This armor class primarily relates to enabling attack bonuses from naval and siege damage. This building armor class is not to be confused with the standard building armor class, which also contains all buildings (bar the Wonder), but takes bonus damage from different units and is affected by other technologies and bonuses. The purpose of having two different armor classes for buildings is to keep Masonry, Architecture, and the base building armor Castles and Walls have from cancelling the attack bonuses infantry units hold against buildings.

I’m convinced that even the developers don’t fully understand it, because now War Elephants will do +30 bonus damage to wooden buildings, +44 damage to Stone Walls, +36 damage to Fortified Walls, +22 damage to Castles, and +60 damage to towers, in addition to their 20+4 melee damage. Why do so much to towers? Because the developers don’t know that towers are double-dipping damage.

1 Like

Since I made catapult ships weaker than cannon galleons (cause you can make them in castle age) I probably don’t need it but if I try I’ll write the results here.

Indeed I think all the issue spurns from confusion between standard building armour class (21) and the building armour class for siege (11). The latter functioned in my case because I was working with caravels I guess who already have 11 armour class.
So I guess the conclusion is that you can’t change armour class through triggers and I was just lucky to choose to make a siege ship a ship that already had that kind of class lol.