Saturday, March 13, 2010

Combat Mechanism

The purpose of this post is to explain how combats work in Travian. The key factors that play a role in combats are just a few, so we will focus on them and leave the others aside for now. For this reason, the following assumptions have been applied to all the examples in this chapter:

• The defender has no wall
• None of the defensive troops have been improved in the armoury
• None of the attacking troops have been improved in the blacksmith
• The attacking player and the defending player have exactly the same population


Each type of troop is described by 4 values :
• At = attack value
• Di = defense against infantry
• Dc = defense against cavalry
• Up = upkeep cost in terms of crop per hour




The result of an attack is determined by matching the Total Attacking Power (TAP) with the Total Defensive Power (TDP).
Calculating TAP is kinda straight forward since it is the sum of the At of all the troops involved in the attack.
Calculating TDP is more complex, since this is a single value that has to reflect at the same time Di and Dc. For each type of unit these two components melt together according to the composition of the attack. Hence the Defense Value (DV) of each unit is the weighted average of Di and Dc, where the weight of Di is the % of TAP proceeding from infantry and the weight of Dc is the % of TAP proceeding from cavalry.

__________________________________________________________________________________________________
→ Example ←
50 Swordsman (SM) + 20 Theutates Thunder (TT)
TAP = 50 * At(SM) + 20 * At(TT) = 50 * 65 + 20 * 90 = 3250 + 1800 = 5050
% of infantry = 3250/5050 = 64%
% of cavalry = 1800/5050 = 36%

100 Spearfighters (SF)
TDP = 100 * DV(SF) = 100 * (Di * 0,64 + Dc * 0,36) = 100 * (35 * 0,64 + 60 * 0,36) = 4391
__________________________________________________________________________________________________


The formula of casualties is unknown, but it can be described with relative accuracy (as you can simulate as many combats as you wish).
Let's take a simple set of examples, Imperians vs Praetorians, and let's see what happens by increasing the TAP as a multiple of TDP.

__________________________________________________________________________________________________
→ Example ←

(TAP = 1 x TDP) 1000 imps vs 1076 praets -> 1000 imps dead
(TAP = 2 x TDP) 2000 imps vs 1076 praets -> 727 imps dead
(TAP = 3 x TDP) 3000 imps vs 1076 praets -> 606 imps dead
(TAP = 4 x TDP) 4000 imps vs 1076 praets -> 540 imps dead
(TAP = 5 x TDP) 5000 imps vs 1076 praets -> 494 imps dead
(TAP = 6 x TDP) 6000 imps vs 1076 praets -> 460 imps dead

[...]

(TAP = 20 x TDP) 20000 imps vs 1076 praets -> 306 imps dead
(TAP = 40 x TDP) 40000 imps vs 1076 praets -> 253 imps dead
(TAP = 80 x TDP) 80000 imps vs 1076 praets -> 217 imps dead

__________________________________________________________________________________________________


The rate of decline in losses slows as the ratio of attackers to defenders gets very large.
This means it's not that really important whether you have 40 or 80k imps in this particular battle, you only lose 40 imps less with 80k imps. However, from 1k to 2k you lose 270 imps less. Having a big army --at least a couple of times bigger than the defense -- is very, very important.

It's vital in minimize your loss by having sufficient attack power against a defense. Before attacking, think about whether your army is big enough to destroy the defense without too many losses. A good rule of thumb is never split your army: attacking full forces generally delivers the best results. And let me stress a lot that "generally" doesn't mean always

Defense value works the same way, just switch TDP for TAP in those examples and we have a good illustration why more defense is always better.


Thanks to the understanding of this fundamental mechanism it has been possible to develop calculations and draw tables that can be extremely useful in many fields:
• Defending strategy
• Attacking strategy
• Reinforcement strategy

No comments:

Post a Comment