Combat has changed a bit in Warlight AI Challenge 2, as the luck factor has decreased, but still uses the same concept. The amount chosen by the bot in his attack move are the attacking armies, all the armies on the region that is attacked are the defending armies. There are two values that are calculated and averaged to calculate how much attackers and defenders are destroyed.
For the amount of defending armies destroyed: The first value is exactly 60% of the total amount of attackers. The second value is the same value as used in the first Warlight AI Challenge, namely each attacker has a 60% chance of destroying one defending army. This second value is thus dependent on luck, as it should average 60% of the attacking armies, but in actuality more or less armies might be destroyed. After these two values are calculated they are averaged with use of the luck factor which currently is 16%. So 84% of the first value is combined with 16% of the second value, this is rounded and that is the total amount of defenders destroyed.
For the amount of attacking armies destroyed, the same calculations are used, except the 60% is changed to 70%. So the first value is 70% of the defending armies and the second value is a 70% chance for each defending army to destroy one attacking army. These values are combined again with a 16% luck factor.
As you can see it is now more predictable what will happen when you attack a region, but there is still a little bit of randomness. If all the defending armies are destroyed, the remaining attacking armies are transferred to the defending region and the region is now owned by the attacking player. If not all the defending armies are destroyed or if all of the attacking armies are destroyed, the attack has failed. Both regions lose the calculated amount of armies and the regions still belong to their original owners.