ALT key Roll-Over Combat Calc Bug

Giving the Cannon combat I (+10%) works as expected based off Apolyton, -50% + 10%, 12/1.4 giving a combat of 18 vs 8.6

About time something worked like I expected it to.
 
OK, a guess as to why it's happening this way....

Attacker's strength is calculated. It can't be known what type of unit it will attack, so its strength is calculated purely on what is known -- base strength increase, whether it's attacking a city or not, etc. Then, attacker strength is fixed.

Then, the AI has to choose the defender. It then uses the attacker's specialized bonuses. All units in the stack have their strength evaluated, including subtracting if the attacker has a bonus against their unit type. Then, the highest value can be chosen.

With only one unit in the stack, naturally it's chosen, but the defenders' strength has to be adjusted, not the attacker's, because the attacker's strength is fixed at the time of the attack declaration.

It could be done to make each unit determine complete odds, and it doesn't seem like it would be very computationally expensive. But I'm guessing they went the route I outlined above.

Arathorn
 
I leaning towards it being by design, though I believe it to be a bit counter-intuitive. Not to mention that it has the potential to reduce the effectiveness of a unit's bonuses, which is a bit silly.
 
Here we have a Cossack attacking a plot with a pikeman (6 +100% v Mounted) and a Musketman (9).
 
Here we have a Pikeman attacking a plot with a Knight and a Musketman. Notice the Musketman is the best defender.
 
Arathorn said:
Does that pike happen to have Combat I? If so, it makes perfect sense to me, now.

Arathorn

Yes, because he's Japanese and they get it automatically.
 
Arathorn said:
...Then, the AI has to choose the defender. It then uses the attacker's specialized bonuses. All units in the stack have their strength evaluated, including subtracting if the attacker has a bonus against their unit type. Then, the highest value can be chosen...

This is confirmed here.

A Pikeman (6 +100% v Mounted) is attacking a plot with a Horse Archer (6) and a Warrior (2).

Shows as 6.0 v 3.0. The Horse Archer is the best defender.
 
For the city raider promotion, does that show as a plus strength or a minus strength? At one point, I thought it'd be a plus, since it can be known independent of defender, but now I'm thinking it's probably a minus, because the program won't know where you're attacking yet. Can someone verify? Is it indeed a minus to the defender?

Arathorn
 
Arathorn said:
OK, a guess as to why it's happening this way....

Attacker's strength is calculated. It can't be known what type of unit it will attack, so its strength is calculated purely on what is known -- base strength increase, whether it's attacking a city or not, etc. Then, attacker strength is fixed.

Then, the AI has to choose the defender. It then uses the attacker's specialized bonuses. All units in the stack have their strength evaluated, including subtracting if the attacker has a bonus against their unit type. Then, the highest value can be chosen.

With only one unit in the stack, naturally it's chosen, but the defenders' strength has to be adjusted, not the attacker's, because the attacker's strength is fixed at the time of the attack declaration.

It could be done to make each unit determine complete odds, and it doesn't seem like it would be very computationally expensive. But I'm guessing they went the route I outlined above.

Arathorn


I see it programatically like this...

The attacker enters the defenders plot.
The program determines what defenders are in the plot and their bonuses
It then adjusts the attacker value accordingly for each possible encounter.

For example... Pikeman (6 +100% v. Mounted) enters a plot with a Horse Archer (6), Archer (3), and a Spearman (4)

Modified values are 12.0 v 6.0; 6.0 v 3.0; 6.0 v 4.0

12/6 = 2
6/3 = 2
6/4 = 1.5

The lowest number is the best defender (Spearman in this case) and the correct numbers are used in the calculations, and all is well.
 
Now the question. Is this combat calculation controlled through Python and/or XML? If so, changes could be made as noted.
 
<Shrug> I've not looked at the Python at all. I can just about guarantee it's not in the XML. I'd be surprised if it's in the Python code. But I'd also be surprised if it were too hard to do once the SDK comes out next year.

Arathorn
 
Back
Top Bottom