 Thread: Creature Analysis: a good way to objectively compare units! [ This thread is pages long: 1 (2) ] 
sos
Known Hero

posted October 24, 2002 02:04 PM 


whats the point in all of this? Its not like you will have to decide if you want centaurs or skellies in your nature army
the only thing that you have to decide is between the 2 level 24 creatures in each town and this depends on many factors. The only no brainers are genies and cyclops.


Daikon
Adventuring Hero
with great magic powers

posted October 24, 2002 07:06 PM 


Quote: Well, I tested the
9 Centaurs vs. 25 skeletons battle
and found that 4 skeletons were left (and even the skeletons were lucky  they got morale at precious time)
You sure your skeletons got morale? I think you are wrong. Undeads doesn't get morale.


csarmi
Supreme Hero
gets back

posted October 24, 2002 07:30 PM 


No, of course I was mistaken. Then they got to move first for some reason  I do not quite remember for what kind of  maybe bad morale of centaurs, or speed issues.


furryeifle
Tavern Dweller

posted December 10, 2002 11:44 PM 


Growth factor
I just have to start by saying I realize I'm about month and a half late for this discussion, but I was really happy to read about your comparisons, since comparisons like this are some of my favorite parts of these games. About your upper and lower limit to the growth multiplier, as I've been thinking about this a lot lately and I ran into the same situation. It's proven to be a very good estimate if I use the following eqn, and I'll explain if anyone cares enough to reply.
1/2*Att*Dam*Def*HP*#^2+1/2*Att*Dam*Def*HP*#.
I think all the variables should be self explanatory, perhaps with the exception of #, which is the number of creatures in the stack, or for weekly growth if that's your style. One interesting thing that I've noticed from testing, is that yes, 1 black dragon is ridiculously strong when compared to 1 weeks worth of most creatures, but that strength falls fairly rapidly (in a relative sense) over the course of just a few weeks. (As wub noted in that 1 Blackie will kill 2 behemoths, but 200 behemoths will kill 100 black dragons.)
The halves aren't really necessary, but were left over from the way I was thinking about the situation, and I'm still hoping to find a good way to estimate casualties from this figure and I think they'll be important then.
Another thing, is that some specialties are fairly easy to model (at least in a rough manner). For instance, double attack, due to simultaneous retaliation, this becomes 3 attacks for the dbl attacking stack to 2 attacks for the regular melee stack. So a multiplier for the stack power of 1.5 is used. A similar argument can be used to demonstrate a multiplier of 2 for a no retaliation specialty. Admittedly, these are overestimations for the case of a real battle, but for 1 on 1 stack comparisions, they seem to work quite well. Similar multipliers can be imagined for the hydra's multiattack, bind, aging, bloodlust, and the variety of blinding/blocking/etc. specials. I think I have a pretty decent way to incorporate fireshield and first strike as well, but I'd like to put some more thought into it.
Also, for spellcasters, it's really hard to say what they're usefulness is, (my pet term for what wub calls absolute power, though I have to say absolute power has quite a nice ring to it ). In my comparisons, I've generally used an average defense rating of 17.5 (total HP*def generated by all creature dwellings per week divided by the total hp generated by all creature dwellings per week). I imagine it to be a bit low as weak creatures see more attrition in early battles whereas powerful ones escape with scratches, but I couldn't think of a good way to change that. At any rate, with that avg def. rating, attack for spellcasting becomes 17.5*spell damage. Since I was using spellcasters in hand to hand combat, but attacking with their most powerful single spell(in theory) they're attack rating became the sum of they're spell damage and they're hand to hand damage (since they have a retaliation still).
Another thing is about shooters...you're right that you can't begin to effectively compare them with walkers/flyers strategically based on hand to hand combat, but it isn't that difficult to compare them vs. one another (also I would apply this argument to spellcasters as well, though shooters and spellcasters I believe could effectively be compared). This is more voodoo than statistical as shooters typically are not thrown into the fray and begin doing damage without being in harms way (directly) themselves. If anyone has a really good way, I would love to hear it.
Well, thanks to whoever managed to wade through that mess, I guess I just got excited that there were some math junkies like myself out there that liked to chart graph and calculate their way to victory .


csarmi
Supreme Hero
gets back

posted December 11, 2002 12:08 AM 


My way was something similar to yours. I also had the feeling that the number between growth and growth^2 can be estimated better.
My first though was the (don't know how it is called in english, maybe squared average)
((Gr1^2+Gr2^2)/2)^(1/2)
(it is the square root of 2.5=(1+4)/2 for Gr1=1, Gr2=2)


Wub
Responsible
Famous Hero

posted December 11, 2002 03:53 PM 

Edited By: Wub on 20 Dec 2002

My struggle with creature growth
Quote: 1/2*Att*Dam*Def*HP*#^2 +1/2*Att*Dam*Def*HP*#
Hey, that formula looks quite familiar to me . In fact, not long ago I used exactly the same formula to include creature growth! It’s real good to read that someone indepently came to the same conclusion. So I guess the following reasoning must look quite familiar to you, furryeifle .
It started out by noticing that big armies take unexpectedly few losses when engaging smaller armies. When 200 units fight 150 units, you will (usually) win with a lot more than 50 units left. Two units that have teamed up can beat three units that have not teamed up. I concluded that unit effectivity increases according as army size grows.
The next step was to get an idea of how much this increased unit effectivity was. So I ran tests in which I let a number of teamed up units fight ‘loose’ units to see how much they could handle. I found the following results.
Number of teamed up units Number of loose units that can be handled
1...................................1
2...................................3
3...................................6
4...................................10
5...................................15
6...................................21
7...................................28
I noticed that these numbers had a logical connexion, because 15 = 5+4+3+2+1 and 28 = 7+6+5+4+3+2+1. Meanwhile, I also theoriticized the reason for this and I came to the same conclusions. After all, when 7 units fight 1, the stack will do 7 times more damage than the single unit, so when the single unit dies, the damage done to the attacked unit of the stack is 1/7. Therefore, before the upper unit is killed, 7 loose units can be handled. After that, only a stack of 6 is left, which means that the upper unit now gets damaged for 1/6. And now only 6 loose units can be handled before the upper unit gives in. And thus I also came to the conclusion that 7 units that are concentrated on one spot can defeat 7+6+5+4+3+2+1=28 loose units.
Next step was to find a formula in which the numbers in the table were processed. After unleashing some maths on it, I came to the formula Y = 1/2X^2+ 1/2X, were X is the number of units in the stack and Y is the number of loose units that can be handled. By now it became possible to predict the effectivity of big stacks of, say, 200 units. According to what I knew by then, I thought that that stack equalled 20100 loose units.
When I had that formula, I wanted to test it on two stacks fighting each other. For example, 6 versus 5. According to the theory, 6 units equalled 21 loose units, while 5 units equalled 15 loose units. Therefore I expected that the biggest stack would win win with an army strength of 6 loose units. That number of 6 loose units equals a stack of 3 units. After all, the solution to the equation 6 = 1/2X^2 + 1/2X is X =3. I tested this by setting up an experimental battle and the results were positive. I also tested it by theorizing the battle. After all, 6 units will do 6/5 more damage than 5 units, so when the stack of 6 units have done 6 ‘parts’ of damage, the stack of 5 units did 5 ‘parts’ of damage. If you reason this way, the battle will be as follows:
6 vs 5
5 1/6 vs 4
5 vs 3 3/4
4 2/5 vs 3
4 vs 2 1/3
3 3/4 vs 2
3 1/4 vs 1
3 vs 0
As you see, these results were perfectly consistent with my experiments and my hypothesis. I did find some minor problems when the battle didn’t exactly end with a unit that had 100% of its health left, but that was fairly insignificant. So I thought I had found a good way to include creature growth in the creature strength formula.
I was wrong however. The formula of 1/2 X^2 + 1/2 X did have its share of problems. Unneglectable problems in fact. And that urged me to find a more valid way to include creature growth. Too bad I don’t have the time to explain that now, but I’ll do that soon in a future post. However, I find it exciting to see that the discussion is revived again and I really like to see some more thoughts on the topic, so your posts were quite appreciated, furryeifle and csarmi. . I also hope that what I posted was understandable.
____________


Wub
Responsible
Famous Hero

posted December 19, 2002 12:50 AM 

Edited By: Wub on 20 Dec 2002

My struggle with creature growth –continued
In my previous post I explained how I came up with the formula 1/2 X^2 + 1/2 X and now I will explain why I ultimately didn’t use this formula for this thread.
When I tested the formula with high numbers in a game, it appeared inaccurate. A battle of 200 units fighting 150 units could not be predicted close enough with the formula, for example. When I tried to calculate the same battle on paper, it became clear what the error was. If you write it out like I did before, you will more or less get the following:
200 vs 150
199 1/4 vs 149
199 vs 148,66
198,51 vs 149
.
.
.
132 vs 0
In other words, the formula of 1/2 X^2 + 1/2 X ‘assumes’ that all units of both stacks are killed one by one. With small numbers, this is indeed the case. But when 200 units fight 150 units, units will not die one by one . In the contrary, after the first strike 40 units of the small stack and 30 units of the big stack may die. So in the second round, the numbers are something like 160 vs 120 and not 199 1/4 vs 149. My conclusion therefore was, that the formula of 1/2 X^2 + 1/2 X was wrongly based on the assumption that all units have an (almost) infinitely big defense/attack ratio.
The defense/attack ratio of a unit represents the number of attacks that a creature must make to kill an exactly similar creature. For example, a creature with 30 hitpoints that does 6 damage has a defense/attack ratio of 30/6=5. My statement is that this defense/attack ratio is an important factor in including growth in creature strength. I’ll give an example.
100 units fight 20 similar units. The units have the following stats: hitpoints=100, damage=100.
Notice that the defense/attack ratio of this unit is 1 or in other words: it needs one attack to kill a similar creature. Now let’s make these two stacks fight each other. The big stack of 100 units will do 10.000 damage and thus easily kills the small stack. But the small stack retaliates simultaneously and does 20x100=2000 damage. They manage to take out 20 units of the big stack! So both sides suffer an equal amount of casualties, even though one army is a lot bigger than the other. This is all caused by the huge defense/attack ratio of the units. Or better put: it is the defense/attack ratio of the small stack that determines the losses of the big stack.
It is easy to see that the outcome of the mentioned battle is different for each value that the defense/attack ratio of the small stack takes. For example:
Defense attack ratio..... Number of units that big stack has left
1....................................80
2....................................90
3....................................93,33
4....................................95
5....................................96
10...................................97
(nearly) infinite............. 97.89
And now it may become clear why the formula of 1/2 X^2 + 1/2 X assumes an almost infinitely big defense/attack ratio. When 200 units fight 150, it says that after the first round only 1 creature is killed. In other words: those 200 units needed all their firepower to kill that one creature, which means an attack/defense ratio of 200...nearly infinite.
Conclusion: including creature growth depends on the defense/attack ratio of the smallest stack that is fighting.
That gives a lot of problems, since you don’t know what you are fighting. And for that very reason, it is impossible to give ONE multiplier for creature growth. You will have to design an upper and lower limit for creature growth and make it so that both high and low defense/attack ratios fall between those limits.
In this thread, I chose the multipliers of X and X^2. So a stack of 3 units is 39 times as strong as a stack of 1 unit. I explained the reasons for choosing these limits in an earlier post. The limits of X and X² cover a defense/attack variety range of respectively 1 to infinite. In other words: this way of including creature growth is always valid as long as the defense/attack ratio of a unit isn’t smaller than 1.
Are you still with me? If not, blame my (English) writing skills. If yes, I hope you are up for something more complicating. Maybe you have found out that almost all units in heroes 4 have the same defense/attack ratio. You can easily see this by taking a random creature. Multiply its hitpoints and defense skill and divide that by its attack skill and average damage. For example, a pikeman has 30 hitpoints and a defense skill of 14. 30x14=420. Now divide that number of 420 by a pikeman’s average damage of 6. 420/6=70. Now divide that number by a pikeman’s attack skill of 14. 70/14=5. Conclusion: a pikeman has an attack/defense ratio of 5. The formula is:
Defense/attack ratio = (defense skill x hitpoints)/(attack skill x damage)
Now if you make that calculation you will get that number of 5 for every creature except, magi, faerie dragons, genies, zombies and behemothes (for obvious reasons). That defense/attack ratio of 5 falls nicely between the upper and lower limit of infinite and 1. So you may say that it is time to decrease the distance between the upper and lower limit. You could say, for example, that we could take an upper limit that equals a defense/attack ratio of 6 and a lower limit that equals a defense/attack ratio of 4. Why didn’t I do that?
The problem is that there are lots of factors that influence the defense/attack ratio. Some creatures have an offensive special ability. The stone gaze of the medusa or the devouring specialty of the seamonster decrease their actual defense/attack ratio to a number below 5. On the other hand, creature specialties such as insubstantial and stone skin increase the actual defense/attack ratio of creatures. Also, spells can change the ratio as can the tactics skill. For that reason I felt the need to keep the lower and upper limit of the growth formula far from each other. But I agree with csarmi that it would be interesting to search for smaller limits. It’s just a compromise between accuracy and chance to be mistaken. My range of X and X^2 isn’t too accurate but will almost never be mistaken. Csarmi’s formula hasn’t got a range and therefore should be extremely accurate, but the actual value may differ due to various d/a ratios.
If we want to pinpoint creature growth exactly, we should look for a formula for a defense/attack ratio of 5 (if there is such a formula). It would give the most accurate and exact idea of including creature growth, even though the actual value may differ now and then (since the precise defense/attack ratio often isn’t exactly 5). If we can find that formula, it will be a very valuable way to objectively include creature growth in the creature strength ratings.
____________


csarmi
Supreme Hero
gets back

posted December 19, 2002 06:48 AM 


"the formula ½ X² + ½ X"
I can't see it now and I couldn't see it in your former post. What is written here?
What I get is something like this: " X; + " X"


furryeifle
Tavern Dweller

posted December 20, 2002 02:45 AM 


that formula
the 1/2 X^2+1/2 X, for me at least came from a plot of a stacks damage inflicted vs. damage taken. If you plot the function, you'll see that it appears much like a set of stairs, where obviously the steps get larger for increasing ATT*DEF (creature power).
In playing with it further, I too found that D/A of the smaller powered stack determined losses, although when i did it I calculated it as a function of rounds to complete the conflict. If the battle lasts only one round (as the case of the 100 vs. 20 of the same or very similar creatures) the losses are equal to att*# of smaller stack/Def of a single unit of the larger stack. For battles lasting an infinite (or quasiinfinite) a the losses are nearly exactly equal to the 1/2 X^2 + 1/2 X stack power calculation. For most battles that take 4 or 5 rounds, this calculation seems to be accurate (from my work) to about 8%. In general it underestimates the strength of the smaller stack. By adding an additional coefficient to the linear term (1/2 X^2 + 1/2 B*X), I found that a B of around .6 (22^1/2) to become very acurate for determination of equality of stacks (that is how many peasants are equal to 1 black dragon?). And where the one was on the high side (w/o the coeff.), the other was on the low side (w/ the added coeff). Of course, for battles with equivalent creature power, the length of the battle is as long as possible, generally ending with near total casualties for both sides. This has been more my motivation for creating the formula anyways, as a form of power conversion. (how many imps are my hydra's worth?). At anyrate, I haven't had a chance to work on it much of late as it's finals week here, but hopefully I'll get a chance to work on it a bit over the break.
Also, about what wub was talking about, for situations where the results deviate significantly from the predicted...
things I've noticed:
D/A for the loser matters, but so does D/A for attackers...(perhaps not as much however.)
You mentioned previously that this formula does not incorporate overkill, and I think that that is where much of the problem lies. The formula (especially w/ the coeff.) gives as accurate a measure of stack power as I believe can be calculated w/o incorporating data from the stack that is being fought, but I think if a reasonable prediction of overkill could be worked into the equation, it would hold even for short battles, as overkill in those situations happens very quickly.
Last note...I don't think accurately predicting casualties is something that can really be done (w/o taking into account d/a ratio's for the opposing stack), but what this figure does say, is whether or not stack A will defeat stack B, when the units composing the stacks are different, even significantly different (most especially with the added coefficient.) It also gives some idea as to the ballpark of casualties (light or heavy).
At anyrate, sorry to throw all that in w/o thinking it through carefully first...I'm rather on a short clock, w/ my last final at 8 in the morning tomorrow and a project due by 4pm. (that I haven't started). Hopefully I'll be able to clarify anything that was muddy at a later date.


Wub
Responsible
Famous Hero

posted December 20, 2002 11:21 PM 

Edited By: Wub on 20 Dec 2002

Creature growth continued
Quote:
'"the formula ½ X² + ½ X"
I can't see it now and I couldn't see it in your former post. What is written here?'
Bummer . It says 1/2X^2 + 1/2X, but then with a little 2 above the X and 1/2 written as a fraction. I'll edit my posts about it so you can read it.
Quote:
'If you plot the function, you'll see that it appears much like a set of stairs'
Funny, that's the exact same way as I pictured it
Quote:
'If the battle lasts only one round (as the case of the 100 vs. 20 of the same or very similar creatures) the losses are equal to att*# of smaller stack/Def of a single unit of the larger stack.'
I also came to that conclusion: when you reach a certain superiority in creature numbers and strength, you don't benefit from extra creatures. Whether you are fighting 10 peasants with one hundred peasants or one thousand, the outcome will be the same.
I arrived at the formula of 1/2X^2 +1/2X for infinite d/a ratio by measuring how many similar 'loose' units a certain stack can handle (see my previous post). If I want to do likewise for a finite d/a ratio, the above indicates that
if:
number of creatures in stack is equal or bigger than d/a ratio of small stack
then:
adding one extra creature to the stack will mean that the stack will be able to kill an additional amount of loose units that is equal to the d/a ratio of the loose unit.
For example: I am using similar creatures with a d/a ratio of 5. If I write down how many loose units the stack can kill, it will looke more or less like this:
Stack..............Loose units
1.......................1
>>army effectivity increases
2.......................2,8
>>army effectivity increases
3.......................5,4
>>army effectivity increases
4.......................7,8
>>army effectivity increases
5.......................12,8
>>army effectivity does not increase anymore
6.......................17,8
>>army effectivity does not increase anymore
7.......................23,8
You see that from the point that the ratio of both armies reach the d/a ratio (which was 5), army stack effectivity does not increase anymore. Mathematically speaking, the formula will become linear from that moment on. This in contrast with the formula of infinite d/a ratio, since army effectivity will never stop increasing in that case.
Quote
'For battles lasting an infinite (or quasiinfinite) a the losses are nearly exactly equal to the 1/2 X^2 + 1/2 X stack power calculation.'
Agreed, since 'lasting a quasi infinite amount of time' indicates an infinite d/a ratio.
Quote
'For most battles that take 4 or 5 rounds, this calculation seems to be accurate (from my work) to about 8%. In general it underestimates the strength of the smaller stack.'
Agreed, though I haven't looked at that 8%. But the more the number of rounds will decrease, the less accurate the formula.
Quote
'By adding an additional coefficient to the linear term (1/2 X^2 + 1/2 B*X), I found that a B of around .6 (22^1/2) to become very acurate for determination of equality of stacks'
I'd like some more explanation on this Bvalue of 0,59. How did you arrive at the idea of putting that coefficient there and how did you determine its value?
Quote
'This has been more my motivation for creating the formula anyways, as a form of power conversion. (how many imps are my hydra's worth?).'
This is also my motivation, though I ordered myself to compare similar creatures with different growth first and after that add the factor of different creature strengths. My intended result is to give every creature a number that incorporates growth, attack skill, defense skill, damage and hitpoints. I'd hope it to be a fixed value or else it will be fairly useless. That's why I think it is best to consider solely the d/a ratio of 5, since that number will be the best predictor of any creature's d/a ratio.
Quote
'D/A for the loser matters, but so does D/A for attackers...'
Agreed, but both values center around the issue of overkill. In fact, the problem of extreme d/a ratios is the problem of overkill. With infinite d/a ratios there can never be overkill. Actually, 'infinite' in this case means: large enough to prevent overkill.
Quote
'You mentioned previously that this formula does not incorporate overkill, and I think that that is where much of the problem lies.'
My comment above indicates that if we can implement d/a ratio, overkill will be incorporated as well.
Quote
'I don't think accurately predicting casualties is something that can really be done (w/o taking into account d/a ratio's for the opposing stack).'
That's true, you can't arrive at that one value especially not when thinking about the d/a ratio. But there's another factor that prohibits including growth. That factor is that you do know a creature's growth, but not the actual numbers in which creatures become to fight. If creature A has a growth of 1 and creature B a growth of 2, the battle may be 3 vs 6 or 35 vs 70. But depending on the formula you use, the calculated outcome of both battles will be different.
For example, if you use 1/2X^2 + 1/2X, the big stack wins with 83,3% of its creatures left in the first case and with 86,3% of its creatures left in the second case. Therefore it would be perfect to find a formula that doesn't have this problem, so that a fixed value for any growth can be calculated. In fact, for that very reason I used the formula of X^2 in my upper limit and not the formula of 1/2X^2 +1/2X (actually both formulas are similar for huge creature growths).
To summarize the problems: defense/attack ratio and actual numbers for the battle are the two factors that for now prohibit finding the formula, but if that Bvalue (or an other solution) appears to be accurate, we can finally adress creature growth for every creature in a nice chart .
____________


csarmi
Supreme Hero
gets back

posted December 21, 2002 06:39 AM 


"Therefore it would be perfect to find a formula that doesn't have this problem."
I don't think it is possible, because the outcome does depend on the stack sizes. 1 vs 2 is not the same as 35 vs 70.
The best you can hope for is a formula, that gives you a good estimate for a good set of numbers.
This is what should be aimed for in general I think.
Maybe we should use some probablistic approach? Cause it starts me think that way.



