Combat Result bug

If you find a bug please report it here

Combat Result bug

Postby KGB » Tue Jan 07, 2014 11:18 pm

Game 45453 (Test Europa)

This turn I attacked an enemy stack containing an Eagle, Gryphon and Barb (70 str, 4 hits). I had a Lt Inf, Giant, 2 Hv Calv, Barb (65 str, 4 hits) and Assassin (16 Grp Ambush). This attack happened on a razed city.

1) The Gryphon was getting the city bonus. I was surprised by this as I thought razed cities were not giving that terrain bonus??? I attempted to search for this in the forums which led to my other post about the search feature being broken. So do razed cities given city terrain bonus still?

2) I lost the 75-25 battle with only the enemy Barb surviving. When I look at the combat results it says the battle outcome was 0.4%. That's impossible. There is no way that with a 25% chance to win the battle, just surviving with the Barb is going to be 0.4%. that particular combat result should be something like 24.6% as there is no chance to win that combat with anything else but the Barb as the Eagle/Gryphon are killed easily.

I won't end my my turn until you have a chance to look.

KGB
KGB
 
Posts: 3030
Joined: Tue Feb 16, 2010 12:06 am

Re: Combat Result bug

Postby Moonknight » Tue Jan 07, 2014 11:42 pm

The city bonus has been in place on razed cities for a long time now. They did get taken away from ruins and from towers.

I'd rather have it in towers than on razed cities myself.
Moonknight
 
Posts: 784
Joined: Tue Dec 07, 2010 2:57 am

Re: Combat Result bug

Postby SnotlinG » Thu Jan 09, 2014 11:50 am

KGB wrote:Game 45453 (Test Europa)
2) I lost the 75-25 battle with only the enemy Barb surviving. When I look at the combat results it says the battle outcome was 0.4%. That's impossible. There is no way that with a 25% chance to win the battle, just surviving with the Barb is going to be 0.4%. that particular combat result should be something like 24.6% as there is no chance to win that combat with anything else but the Barb as the Eagle/Gryphon are killed easily.

I won't end my my turn until you have a chance to look.

KGB


Hello KGB,

Im digging into the code, and it looks like there is an issue with how the outcome % is calculated. So the battle-result looks valid and I have extracted all info I need, so feel free to continue/end your turn.
Ill continue to analyze the code, but looks like probably the issue in calculating the % depends on one ambush attack in this battle. I´ll let you know what I find out.
SnotlinG
 
Posts: 2148
Joined: Sat Feb 13, 2010 12:42 am

Re: Combat Result bug

Postby SnotlinG » Thu Jan 09, 2014 1:41 pm

Ok, I have analyzed the code in more detail now and found and fixed a bug.
The bug was that when presenting the % result it didnt add units killed in ambush during the "lookup".
So in this example, the outcome % was presented as if only one defender had died (one died via ambush).
So the % outcome for the defender to win with only 1 unit loss was 0.4% (and looking at the units involved that sounds reasonable).
SnotlinG
 
Posts: 2148
Joined: Sat Feb 13, 2010 12:42 am

Re: Combat Result bug

Postby KGB » Thu Jan 09, 2014 5:27 pm

SnotlinG,

I guess the fix won't apply to the already completed battle because I just looked and it's still reporting the same numbers?

In any case, I've continued on with my turn.

KGB
KGB
 
Posts: 3030
Joined: Tue Feb 16, 2010 12:06 am

Re: Combat Result bug

Postby SnotlinG » Fri Jan 10, 2014 8:20 am

Yes it wont affect already calculated battles, since the % number is stored during the combat.
But since surviving with 2 units for the defender was 0.4% its pretty safe to assume that surviving with one unit for him is about ~25% since that was his chance of winning the battle.
SnotlinG
 
Posts: 2148
Joined: Sat Feb 13, 2010 12:42 am


Return to Bug reports

Who is online

Users browsing this forum: No registered users and 32 guests

cron
Not able to open ./cache/data_global.php