Is win_chance correct ?
Posted: Thu Apr 25, 2013 10:57 pm
Hello,
I was reading the online documentation when I found this page: "Maths of Freeciv". As a physics student I couldn't resist and I began reading.
I found that the win_chance function does not handle the following case correctly (looking at the source code confirmed that) :
Suppose we have a combat between an ultra-weak defender and an ultra-strong attacker. I mean att_P_lose1 = 0 (the attacker will win every single round). It is obvious such an attacker will win.
But, because each term is multiplied by att_P_lose1 = 0, the function concludes the attacker has no chance at all of winning (because 0 + 0 + ... + 0 = 0
).
Am I wrong ?
Thank you for making such a good piece of software, and for using it ! (and also for reading me)
Louis
Edit : win_chance is at common/combat.c: 230
I was reading the online documentation when I found this page: "Maths of Freeciv". As a physics student I couldn't resist and I began reading.
I found that the win_chance function does not handle the following case correctly (looking at the source code confirmed that) :
Suppose we have a combat between an ultra-weak defender and an ultra-strong attacker. I mean att_P_lose1 = 0 (the attacker will win every single round). It is obvious such an attacker will win.
But, because each term is multiplied by att_P_lose1 = 0, the function concludes the attacker has no chance at all of winning (because 0 + 0 + ... + 0 = 0

Am I wrong ?
Thank you for making such a good piece of software, and for using it ! (and also for reading me)
Louis
Edit : win_chance is at common/combat.c: 230