PDA

View Full Version : R:TW Battle Model



blacksnail
05-08-2007, 20:52
Is there a comprehensive guide anywhere around here that explains exactly how the attack and defense stats interact with one another? IE, the battle model itself explained to the best of our knowledge? I want to know exactly what happens when one unit attacks another. If anybody has experimented with larger all-around stat attack/defense numbers as well (as in BI), I'd be interested in seeing the results. I've scoured the Scriptorium but all I ever see is "higher attack means the unit attacks better" rather than anything involving numbers.

Thanks!

blacksnail
05-14-2007, 19:44
Ping.

Is there any actual data on attack vs defense value in R:TW? Do we have any idea how this stuff works?

Kull
05-14-2007, 19:51
Probably should send a PM to Epistolary Richard, Dol Guldur, and nikolai 1962. If those guys don't know, nobody does.

Aradan
05-14-2007, 22:46
I believe a soldier's chance to kill is calculated by this formula:
chance_to_kill = dlf * const * lethality * 1.1 ^ (attack-defense)

where
dlf is the difficulty level factor (believed to be 1 for normal, 1.5 for hard, 2 for very hard)
const is some constant which's value is still a matter of debate
defense is the sum of all applicable defense values (eg only armour for rear missile attacks, armour+shield+skill for frontal melee etc)

This can tell you how much better a unit becomes when you change one of it's stats...

Consulting the big heads listed above isn't a bad idea at all... :yes:

Dol Guldur
05-15-2007, 00:06
Blacksnail,

Xerex and Aradan are working for the Fourth Age on researching all unit stats and attributes. It's been going on for some months now and they are doing a marvellous job. I've learned loads! Yep, even an old dog like me ;)

It is doubtful we will be finished for some time yet but rest assured all RTW/BI modding teams shall be the beneficiaries of such research, testing, and conclusions.

In the meanwhile feel free to open up a discourse, though our mathematician will be away for the next couple of weeks.

blacksnail
05-17-2007, 06:28
Hi folks, thanks for the feedback. Aradan, thanks for the formula, that helps. Dol Guldur, that would certainly be helpful. A few of us at EB are poking at the stat system in an attempt to see if we can make it more granular while still retaining the feel that it has now, but unfortunately we're working with too many untested assumptions.

I read something long, long ago - possibly on GameFAQs, possibly on the RTR boards, possibly here - which went into how the actual numbers interacted when units fight. I have no idea how close to accurate this is, so if I'm way off then please let me know which parts are wrong.

To my understanding, each individual character within a unit has its own stats as listed in the unit guidelines. Taking the Vanilla hastati unit with 80 men, each individual man has stats of Atk: 7 (melee)/11 (missile), Charge Bonus: 2, Defense: 14 (Armor 5, Defense Skill 4, Shield 5), HP: 1. When an individual man attacks another individual man - let's say hastati vs hastati, for an example - these stats are pitted against one another.

The three individual defense ratings are ablative - or at least some of them are. This means a hastati attacking another hastati head-on with a melee weapon pits the 7 attack vs the 14 defense. The game checks for a hit (is chance_to_hit another formula?). If the test fails, it's a miss and the unit is unaffected. If the test succeeds, the defense ratings are reduced in some manner by the total value of the attack - in this case, 7. (Is there a priority of reduction? Is it split between applicable ratings? Is shield rating inviolable and never reduced?)

As it reduces the ratings by 7, the engine checks to see if the damage exceeds the remaining armor. In the above case, the attacked man would retain a defense skill of 7 and still be okay. However, say he only had 5 left, leaving a difference of 2 "extra damage." Is this when chance_to_kill is checked? Or does it only check chance_to_kill if the current total defense value is 0? (Factoring in stuff like facing, missile weapons, etc here for the somewhat mutable "total defense.")

Anyway, upon checking of chance_to_kill (which in this case would be 1 * const * leth * 1.1^(7-11), or (const)(leth)(0.68) - if it succeeded the man would be dead, but if it failed then the man would be knocked to the ground. Or is there a separate chance_to_knockdown formula?

That's my limited understanding. How much of it is correct and how much of it is crap?

Dol Guldur
05-17-2007, 23:37
I think Xerex might need to answer that as he has the background in such things. He'll be back at the end of May.

Aradan
05-18-2007, 00:23
I believe the chance_to_hit formula is this:

chance_to_hit = dlf * const * 1.1 ^ (attack-defense)
It's essentialy the same as chance_to_kill, but not involving lethality (which makes sense).

Also, I think there is no separate chance_to_knockdown formula. The knockdown percentile is 1-lethality, so knockdowns happen only when the chance_to_hit is successful and the chance_to_kill is not. A dummy-formula, I guess, would be this:

chance_to_knockdown= dlf * const * (1-lethality) * 1.1 ^ (attack-defense)




The game checks for a hit (is chance_to_hit another formula?). If the test fails, it's a miss and the unit is unaffected. If the test succeeds, the defense ratings are reduced in some manner by the total value of the attack - in this case, 7. (Is there a priority of reduction? Is it split between applicable ratings? Is shield rating inviolable and never reduced?)

As it reduces the ratings by 7, the engine checks to see if the damage exceeds the remaining armor. In the above case, the attacked man would retain a defense skill of 7 and still be okay. However, say he only had 5 left, leaving a difference of 2 "extra damage." Is this when chance_to_kill is checked? Or does it only check chance_to_kill if the current total defense value is 0?

I am not certain of anything regarding this theory, and since I've not yet tested any of that, what follows is purely my assumption.

If what you describe above was the case, then in a battle with an attacker of attack power 63 and a defender of total defense 62 we would have crazy-fast battles, because whenever a single hit took place, the defender's defense would instantly drop to 0 (if capped there or else -1) and then the to_kill_chance would be like that: chance_to_kill = dlf * const * lethality * 1.1 ^ (63-0)
This would mean that 3 out of 4 successfuls hits would lead to a fatality and 63atk-VS-62def battles would be over in a matter of seconds. But even if the attack was 2 and the defense 1, we would still have the exact same chance_to_hit formula, the exact same result of the defender's defense droping to 0 (or -1), but we'd have a much smaller chance_to_kill (0.21%), which would lead to veeeery slow battles. But the duration of 63atk-VS-62def fights is the same or very close to that of 2atk-VS-1def fights, which leads me to conclude that what you describe above is not correct.

I hope my rumblings are semi-coherent and that I am making sense... If you spot a flaw in my rationale, plz correct me.


So, how I think things work:

It's been empirically observed that soldiers who are knocked-down tend to get killed a lot easier afterwards. So, a logical assumption about how things go is:
A) chance_to_hit checked. If it fails, then nothing happens. If it succeeds, then we have B.
B) chance_to_kill checked. If it succeeds, then defending soldier is killed. If it fails, then the defending soldier gets knocked-down and we have C.
C) defending soldier's defense is reduced by attacking soldier's attack (bonuses and stuff calculated in) each time he's knocked-down. My best guess is that there is no separate 'damage' done to skill, armour or shield, but rather a unified penalty applied to the soldier's overall defense. Defense-penalty >= 0

I must stress once again that all these are my speculations only and nothing hs been test-confirmed so far (at least by me or Xerex).


The point is:
These things are extremely interesting and sorting them out would benefit balancers enormously. Unfortunately, a very great deal of testing is involved, on an engine that is made to torture testers and even uses the same root for it's 'random' function in subsequent CBs...
If anyone has any test results or solid assumptions that could be of help here, we would all be delighted to see them! :)


Sry for the looong post...

Aradan
05-18-2007, 00:23
Double post.

Aradan
05-18-2007, 00:32
I already rushed in Pal...

Sry for the double post too, did it by accident. Btw, how can I delete it? I can't seem to find the damn button. I guess a mod will be burdened with that now...

xerex
06-01-2007, 14:42
Aradan has done as good a job here explaining what we have figured out as I could, but it may be a good idea to organize this more clearly into what is known for sure(as much as we can be sure), and what is a guess.

The to kill and to hit formulas we are very confident of.

However, what *exactly* happens when a unit is hit, but not killed (fails the lethality check) is not clear. In MTW, there was a knockback effect that temporarily reduced the enemy's defense rating by a fixed number (6 I think) until the unit recovers from the knockback. I suspect there is something similar going on in RTW, but RTW added knockdowns and also still has knockbacks.

When a unit is knocked down, it is unattackable until it gets back up. You can see this when the last man in a unit gets knocked down, his enemy's start running around randomly because they can't find a target. However, it also can't attack while on the ground. Knockbacks could still function just like in MTW, but I don't know how long the defense penalty lasts or how large it is. I would love to test it but can't fathom a reliable way of doing it.

Aradan's guess is as good as mine and definitely note what he said about the random seed. If you refight a battle by clicking the crossed swords Icon, the game uses the same random seed as in the previous battle. Different orders will create a different results, but giving the same or similar orders will produce the same or similar result.

I should also mention that there are other important factors that determine the combat effectiveness of a unit, and both of them are things that shouldn't if CA was smart.

The skeletons/animations affect combat ability.

Take two identical units and give one fs_dagger skeleton and the other fs_swordsman. The swordsman unit will win every fight. I am not entirely sure what it is about the skeletons and animations that affects the combat ability, but our best guess is that it is a combination of the number of frames per attack animation and -id parameters associated with the attacks (as in skeletons.txt).

Increasing the attack delay (second to last parameter on stat_pri line which CA set to 25 for all units) can help mitigate the effects of the differences in attack animations, but doesn't completely eliminate the problem. Aradan did a bunch of tests to figure out how much the difference is between various skeletons. What he did was take identical units with attack delay 25 and different skeletons, and adjust the unit's lethality (or compensation factor as the compiler calls it: last parameter on stat_pri line) until the two units were roughly equal. I would publish the list, but I am not yet sure if factors other than the attack delay could change the effectiveness of the skeleton. So, I can't say for sure how universal the results are.

unit radius and unit height (the extra parameters on the soldier line) also affect the combat ability of a unit, but to what extent exactly, I do not yet know. We will be testing those sometime in the next month I hope, but there are only 3 of us.

At some point in the next 2.5 months, we will try to compile a comprehensive guide that covers all our work and results, but we are too busy trying to get the new version of FATW balanced to put together a real guide. Hope that helps some.