You must be logged in to post messages.
Please login or register

Strategy Discussion

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Units Effective Counterness: AOM Numerical Analysis I
posted 24 May 2004 10:43 PM EDT (US)   
Download Center: 2988

Perhaps the most widely misunderstood aspect of AOM is the unit counter system. For example, standard thought dictates that infantry counters cavalry, yet in a 1v1 fight a hippikon always trumps a hoplite. With this in mind, how can we possibly say that one unit is superior to another? The answer to this question depends on a lot of factors, especially in a game like AOM. Consider the case of 1v1 combat; whoever survives longer obviously wins. There must be rules governing this process, and the purpose of this article is to find them. A little bit of math will be involved. You can read the conclusions first if you are not interested in the details.

Basics
When selecting a unit, we look for desirable qualities such as high hit points (hp), decent attack and armor, low cost and population, and fast build time. When the unit gets hurt in combat, his hit points decrease by
damage * (1- armor %) ,
where damage is determined by the opponent’s attack rating, either hack, pierce or crush, and is reduced by the corresponding armor rating in decimal form (ie, 62% = 0.62). We can reduce the number of raw statistics that need to be considered by defining “effective” hit points as
hit points / (1 – armor %).
This is the hit-points value that can be compared directly to the opponent’s attack numbers. For example, a hoplite has 115 hp, but his hack effective hp actually is 177 and pierce effective hp is 135. If this hoplite is attacked by an opponent with a raw attack rating of 10 hack per second, the opponent would require 17.7 seconds to kill the unit. Comparing two units by their effective hp is better than hp itself, if you need to do it.

For simplicity, we define the following quantities,
Attack = attack * bonus
HP = hp / (1- armor %)
where attack is the total damage the unit is capable of doing or supposed to do to his opponent. “Bonus” stands for the hidden counter multiplier, e.g. a spearman has a 1.1 bonus hack damage against cavalry.

Raw Counterness of 1v1 and Nv1 Battles
For one unit of a kind against one unit of another kind, whoever survives longer wins. Let’s calculate the unit survival times and take their ratio.
STime_1 = HP_1 / Attack_2;
STime_2 = HP_2 / Attack_1;
RC = STime_1 / STime_2.
If this ratio is greater than 1, unit 1 wins and if this ratio is less than 1, unit 2 should survive. It’s that simple and straightforward. We name this ratio the raw counterness (RC) of one unit of one kind against one unit of another kind (1v1).

For example, the RC value for 1 spearman against 1 hippikon is 117/167*(7*1.1/10) = 0.54. When calculating RC, don’t forget to use the effective hit points and attack damage. It is no surprise that hippikons always slaughter spearmen when the number of units is identical. If anybody disagrees with this, please be patient or jump to the effective counterness section.

The only assumption used to get the above formula is that both units attack at the same rate. Attack rate data has not been published anywhere; here we assume a constant attack rate of one hit per second. There are some exceptions: Siege weapons do not attack at the same speed as hoplites do, nor does the Petsuchos. Let us know if you find any other exceptions in AOM.

Other than attack rate, the calculated RC of a 1v1 battle is 100% accurate. This idea can be extended to N units of one kind against 1 unit of another kind by simply multiplying the 1v1 RC by N. For example, if we take 2 spearmen vs 1 hippikon, 0.54*2=1.08, and the spearmen win.

Raw Counterness of NvM Battles
Raw counterness (RC) values for 1v1 and Nv1 battles are easy to calculate, but don’t take for granted that you can generalize to N units of one kind vs M units of another kind. Theoretically, it is not impossible to calculate an RC for this battle. However, simulated battles in AOM show large variations in the RC depending on the way that the battle is fought. Even worse, the outcome can fluctuate between winning and losing. Obviously, the result of a battle can be changed by micromanagement from the players involved. Fortunately, we can use the knowledge that we gained from 1v1 and Nv1 RC predictions to show us how to maximize the NvM RC, which is essentially to win the battle.

It is straightforward to see that two hoplites will beat one hippikon. Consider the case of two hoplites matched against two hippikons. If the match breaks down into two simultaneous 1v1 battles, then the result will be exactly same as the 1v1 prediction. If instead the two hoplites team up and fight against just one of the hippikons, but each hippikon fights against a different hoplite, the results change. One hippkon takes double damage and will fall in half the usual time. After the first hippikon dies, the two hoplites attack the remaining hippikon. Simulations run under these conditions show that the two hippikons still win, but at a cost of one hippikon lost and the other seriously wounded. This is the most favorable case for the hoplites. If the two hippikons initially choose to focus on just one of the hoplites, they would do better. In the best case scenario for the hippikons, each hoplite fights a different hippikon, but the hippikons fight cooperatively and win the battle with little effort.

We hope you’ve already got what we’re trying to say. There are a lot of possibilities. For the 2v2 case, there are only four, but as more units become involved the number of possibilities grows quickly. Statistically speaking, none of these possibilities is favored over any other one if the battle is left to the computer (unless the computer does not fight the battle randomly). But a good player knows that units can be micromanaged, allowing him to manipulate half of the possibilities. The other half are controlled by his opponent. This idea is commonly called level of skills, but in math it is called statistical bias.

So how is this going to help? The trick comes from the Nv1 analysis. In the case of an NvM battle, we found that the best outcome was obtained by creating several Nv1 battles. Through micromanagement, you should be able to do this easily. The rule of thumb is that the more quickly an enemy unit is removed from battlefield, the better your chances are to win. One straightforward way is to attack enemy units one-by-one (if feasible). There are drawbacks to this technique, which will be mentioned in the conclusions section.

Interestingly, you have probably already used this technique and not even noticed. For example, when starting a large battle, have you ever right clicked your entire army and selected one target? Right-click, bingo, and it only takes 1-2 seconds for the first target die. But after that we usually just let the battle go unless we want to do some bonus attack arrangement, such as hero vs myth, or infantry vs cavalry. Next time, try directing all of your archers to attack units in the front line, one by one, by holding the shift button. At the front line, group 3,4 or 5 units to attack one nearby unit. Since both you and your opponent will lose units, you will need to repeat this periodically in order to get optimal result. But even if you only have time to micromanage the first round of combat (before any unit dies), your chances for winning will be improved. Another example of a strategy that naturally reduces an NvM battle into several Nv1 battles is the idea of using a chokepoint. By forcing your opponent to move an army through a small gap, he exposes his units to your army one or a few at a time.

Effective Counterness of NvM Battles
There are still many factors left to be considered before we can judge that one unit counters another one, such as resource cost or build time. Suppose we only have a certain amount of resources to spend on both units, who will win? Or what if we only have a certain amount of time to build them?

To answer this question, it is necessary to estimate the RC of an NvM battle. This is difficult because we know that it cannot be calculated exactly. Therefore an assumption is required. The following analysis and calculations will be based on the (large) assumption that we can treat N individual units of one kind as a single unit with N times as many hit points and attack. In a word, we’ll treat each army as a superman. Each superman has combined hit points and will take combined damage from another superman. The assumption quickly breaks down when any unit dies, which means that the superman will start to lose hit points and attack power. However, the advantage of this model is that it simplifies a large battle to a 1v1 case, allowing us to make RC-type formulas with one small modification (outlined below).

For an NvM battle, we have
STime_1 = (N * HP_1) / (M * Attack_2);
STime_2 = (M * HP_2) / (N * Attack_1);
EC = STime_1 / STime_2 = RC * square of (N / M)
Here, the effective counterness (EC) is defined as the raw counterness (RC) multiplied by a modifier, the square of (N/M).

From this model, it is possible to introduce additional factors that originate from the imbalance between the different unit costs. For example, suppose that it is desired to compare the effectiveness of the units based on their resource cost. In this case, the multiplier should be the square of
N / M = Cost_2 / Cost_1
In the case of build time
N / M = BTime_2 / BTime_1
For a battle consisting of spearmen matched against hippikons, the EC (resource cost) =1.6 and the EC (build time) =2.7. Here the resource cost is the sum of all of the resources required, for example a single spearman costs 70 resources (50F, 20G). We know spearmen are significantly cheaper and quicker to build; they will counter the hippikons if both sides spend the same amount resources or (and) build time. Caution: This doesn’t mean that spearmen are 100% guaranteed to counter hippikons in general; it only says that for the first hit, spearmen are most likely to counter hippikons in the above resource and build time situations.

You can add other factors if you want, such as pop cost or move speed. Make sure that you think about which situations these factors most closely model in the real battle. For example, a population comparison will only make sense when both sides are nearing their population cap.

Before ending the article, there is one more point worth mentioning. We define the counterness number (raw or effective) as a ratio instead of as an absolute value (such as time). It is quite straightforward to look at the absolute survival time for the 1v1 or the Nv1 case. However, when dealing with the NvM case, it is necessary to create a reference value in order to talk about the absolute survival time. A good start would be setting M=1 and then calculating N.

We have made a simple program that demonstrates this idea. Right now it’s limited to hack and slash type units, but maybe the next version will include pierce units also. You can choose the unit to model along with any desired tech improvement(s) using several mouse clicks. The program will tell you the unit RC and EC values for a 1v1 battle, NvM (cost) and NvM (build time).

Conclusions and Comments

oSimple counterness numbers (RC and EC) were found for the purpose of testing units in combat. If the value of the counterness number is greater than 1, the former unit counters the latter unit, and vice verse. The RC is 100% accurate when applied to 1v1 or Nv1 battles. All formulas were tested using AOM:TT with the X2 editor test unit.
oThe analysis presented in the article is universal for all hack vs hack, pierce vs pierce and hack vs pierce comparisons. It has been argued that archer type units are usually placed behind the front line, so hack vs hack comparisons might be more useful in general. A simple program for performing the calculations is provided.
oIt is impossible to predict the outcome of a real MvN battle (in AOM) accurately when M and N are much larger than 1. Simulation runs can at most cover only situations that are tested, making a battle with a large number of possibilities difficult or impossible to model. A single result can differ from a real battle by several orders of magnitude. The game itself generates random numbers when a unit starts to search for its nearby target.
oIn AOM battle, grouping 3-5 hack-type units to attack a single nearby target will increase the chance to win. Micro-management matters here. The reason is mentioned in the Nv1 and MvN sections.
oIn accordance with the previous point, archers are always superior units. Due to their range advantage, they get more chances to aim at the same target manually or statistically. Group all your archers, hold shift button, and right click several targets in a row. By eliminating your opponent’s units faster, your chances to win are increased.
oDon’t overkill your target, for example, by having your entire army aim at a single unit. We mentioned that it is advantageous to engage in Nv1 combat. However, there are exceptions. Consider first the case where the target unit’s effective hit points are much less than the summation of attacks. A lot of attack is then wasted because too many units move in for the kill and your army is not smart enough to pre-reject your order. Second, in order to assault a single target, your units may need to adjust their position, causing them to spend an extended amount of time moving (and therefore not attacking). This effect can be serious when using slow hack-type units, such as the Einherjar. Our advice is, use this method most of time but take caution when you mass a huge army. As a rule of thumb, most units are capable of surviving 15-25 hits by another unit, which implies that overkill is possible when more than 20 units are grouped together.
oLast but not least, remember that the result of a single battle usually won’t decide the game. Of most importance are constantly watching your economy and strategically attacking your opponent.

Acknowledgements

We want to thank our friends YimiTheBarbarian, Hugo_77 and Vile_Meat. This is our first article about games. Any suggestions will be welcomed. Please post here or email to windmaomao@hotmail. Thanks for reading all of this s*&^ through.

Windmaomao (Primary Author)
Cardinal_22 (Contributing Author)
5.23.2004


p.s check download center for the program and a DOC version of this post.
Download here

[This message has been edited by windmao (edited 05-25-2004 @ 07:49 AM).]

Replies:
posted 25 May 2004 06:43 AM EDT (US)     1 / 7  
I cant say that i read the whole damn thing but here is 1 thing that you probably dont mention. Killing rate. As some1 in some other thread said, elephants "counter" cavalry more efficient than camels. The thing is that elephants can only "counter" cavalry more efficient cause of their huge hp and not cause of their dmg. The catch is that you often interested into pure dmg cause you want enemy cavalry to die before it can kill your seige/ranged units.

So it isnt a elephant/camel vs hippikon situation, its a elephant/camel attacking hippikon which is attacking your seige situation. And camels do more dmg per cost/pop to cavalry than elephants(but they also die to cavalry faster than elephants).

PS And personally i dont give a damn about 1vs1, only cost and pop efficiency comparisons actually worth something. And you still need to take into account many variables like economy efficiency, cost of buildings and many other factors. And no, your excuse that anything more than 1vs1 has random elements isnt valid, cause in aom you will always have more than 1vs1. You can just repeat the expiriment many times and reduce the luck factor by a lot.


ESO name : Relaxing

Eisai ellinas? Tote ela sto www.noobwars.gr.

posted 25 May 2004 07:52 AM EDT (US)     2 / 7  
for elephants vs hippkon, the number is
RC(1v1)=5.0 EC(cost)=1.2 EC(build time)=5.0
for camelry vs hippkon, the number is
RC(1v1)=1.2 EC(cost)=1.2 EC(build time)=3.3

I just looked at elephant attack rate, they seems have 33% penalty in speed. But it seems this penalty has been already accounted for in terms of their damage in AOMTT.
Therefore the number is still correct. I'll double check this tonight. But it makes sense the attack rate is not published.

As for other factors, they can be all taken into account. If you treate the most limiting factor as the only factor, the result won't differ a lot as long as the second limiting factor is not pronouced in that situation.

Try our program, make sure you include the bonus attack and their corresponding improvment.

[This message has been edited by windmao (edited 05-25-2004 @ 09:09 AM).]

posted 25 May 2004 03:16 PM EDT (US)     3 / 7  
Very cool post. While NIB has points, finding out exactly how well one unit does vs another is very cool. it gives you a baseline to work from.

I was surprised you didnt get a ton of responses about this post, if anything, mathematical posts lose people, its too much like work.

For example, P3N4M4's guide to 1800 awhile back got rave reviews, but would state things like 'use Hop/Hysp/Tox vs' a certain civ. No detailed analysis, just the end result. People dont have the patience for statistical posts, it seems. Very good post.

You might want to edit it and stat more noticably that you have a program, especially since many people wont read the whole thing.

NIB, i remember i a guide i wrote months ago, you responded 'didnt read it all, but nice post'. Ive seen you reply like this to other long posts. Why do you reply, but not read them?


ESO: Orion_Zorn

Proud Member of the Orion Clan!

"makes sense because if your running a race against a monkey and you die from a heart attack i don't think it should be a draw. the monkey actaully wins by default" - Sirgrayhorn

posted 25 May 2004 03:30 PM EDT (US)     4 / 7  
Interesting program! It definitely feels like thoth elephants can defeat anything nowadays except super duper bragi ulfs.
posted 08 June 2004 08:11 AM EDT (US)     5 / 7  
I'll add it.

Theris264
former Age of Mythology Heaven and Age of Empires III Heaven forumer||former member of Ambition Designs
"An eye for an eye, and the whole world goes blind" -Gandhi
posted 08 June 2004 11:11 AM EDT (US)     6 / 7  
I recommend an english translation at the end of each equation, for the mortals among us .
posted 08 July 2004 11:03 PM EDT (US)     7 / 7  
Great Analysis, liked how you break down the Raw Counterness and prove it with a tangible formula. Also the conclusion wraps it up well with some good tips, although some are pretty obvious for anyone who has played much.

What would be really useful is a breakdown of what the average outcomes of battles are between, for instance, Hoplites and Hippikons, given having used the same amount of total resources to create both groups, and letting the computer handle the targeting/attacking.

Some trials for cost-effectiveness and pop-effectiveness between units would come in really handy. Maybe I'll try out your simulator, and let you know if I find out any surprising results.

Age of Mythology Heaven » Forums » Strategy Discussion » Units Effective Counterness: AOM Numerical Analysis I
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Mythology Heaven | HeavenGames