0% battle outcome

If you find a bug please report it here

0% battle outcome

Postby LPhillips » Sun Apr 01, 2012 4:13 am

Hi,
(Yes, back, internet fixed)
There was a bug that has bugged me and was never reported as far as I know. Outcomes in the outer 10% are not allowed, right?

However, outcomes of 0% are not forbidden by the code. If the outcome did not occur in the pre-battle roll used to determine statistical likelihood of outcomes, then it can occur without invoking the code meant to restrict it. An example is a crow attacking a city with +15 and 20 spiders in it, and killing 15 of the spiders. If you run enough battles this eventually happens. In fact, in playing the tedious scenario Final Stand (Yes I made it, but surely it's tedious to play), such outcomes will occur quite frequently if you observe some the hundreds of defensive battles closely.

My memory is a bit foggy, but I believe it's possible for you to win a battle you have a "0% chance" of winning via this glitch. Battle outcome: 0%.
LPhillips
 
Posts: 965
Joined: Mon Jan 24, 2011 3:25 am

Re: 0% battle outcome

Postby KGB » Sun Apr 01, 2012 4:40 pm

LPhillips,

There is a difference between 0% winning chance and 0% battle outcome.

The winning % is the chance you win the battle (this is obvious)
The battle outcome % is the chance the battle ends EXACTLY with those units left on both sides (ie that specific outcome).

So the battle outcome can be 0%. Here's an example. You attack an enemy city full of units (doesn't matter what they are) with 4 spiders, 1 crow and 3 dragons (in that order). The chance the battle outcome ends with you having crow, 3 dragons is very low because the crow normally dies very fast so it can easily be a 0% outcome because it's much more likely the battle ends with 3 dragons or 3 dragons, 1 crow, 1 spider type thing.

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

Re: 0% battle outcome

Postby LPhillips » Tue Apr 03, 2012 4:06 am

KGB,
I believe I was witnessing 0% outcomes within the outer 10% range. I'm sorry if my post was not clear on that point. This is vastly different from the mistaken idea that an outcome must be 10% likely or greater to occur. Refer to my example for clarification.

22 units vs 8 units

22 unit side wins, outcome percentages:
1 left: 0%
2 left: 0%
etc down to
9 left: 0%
10 left: <1%
11 left: <1%
12 left: 2%
13 left: 6%
14 left: 3%
etc.

Now I believe the outcomes eliminated should be 13 left or less, correct? But it appears that the outcomes eliminated are restricted to the outcomes actually produced in the test battles, so the outcome where 3 units are remaining is still allowed, simply because it has no value assigned and is not restricted. This is not a common problem, but if I'm correct then it is a very important one (on the very unusual instances it occurs).
LPhillips
 
Posts: 965
Joined: Mon Jan 24, 2011 3:25 am

Re: 0% battle outcome

Postby KGB » Tue Apr 03, 2012 4:26 am

LPhillips,

There is a slight mistake in how you've grouped the results which may explain what you saw.

When you go to prune the results, you line the outcomes up next to each other with the '1 unit left' in the middle since that's the transition point from win-to-loss. So it looks like this:

SideA: 22,21,20,...2,1 | 1,2,3,4,5,6,7,8 :SideB

Then you prune in from the left and right sides until you accumulate 10% on each side.

So in your example you need to start with the entire winning % of the other side before you start adding up the 1,2,3... units left. If for example that accumulated total was 5-6% it simply means you *potentially* reach the 10% number sooner than the 13 units left on the other side.

I hope when you see it like this its a bit clearer.

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

Re: 0% battle outcome

Postby LPhillips » Fri Apr 06, 2012 1:21 pm

KGB,

I think we're on the same page. You didn't realize that in my proposed the example, the attacker never wins. In fact, I expect you realize that a 0% outcome never occurs in the stats unless it is a no-win scenario for one side or the other. The battles where this absurdity was occurring were battles like "12 spiders, red dragon, devil, 7 ghosts, lvl 14 hero, in a maxed out city; vs 8 level 1 units". The outcomes I began with are indeed the "far right" side of your graph. The eliminated groups look like this for the battle proposed:

22 defending units left to 21 defending units left >>>>, <<<< any victory by attacker to 13 defending units left. The only possible outcomes should be 14-20 defending units left, yet outcomes of 0% (on the ends of the spectrum, which is the only place 0% outcomes can occur) such as 10 defenders left are still allowed.

The 0% outcomes cited should never occur, unless it is a question of enough outcomes that rolled less than 1% of the time, display as 0%, and yet add up to 10% (say 15 of them, as is possible in the example given).
LPhillips
 
Posts: 965
Joined: Mon Jan 24, 2011 3:25 am

Re: 0% battle outcome

Postby KGB » Fri Apr 06, 2012 5:04 pm

LPhillips,

Still not sure I quite follow you. How do you know what the individual outcomes were since the game only shows 2 numbers, the winning % and the outcome it selected.

In your 22 unit defending, 8 attacking example with the spiders, dragons, heroes etc it should look like percentage wise (defender on the left)

Defender: 95,4,0,0,.....,00,0, | 0,0,0,0,0,0,0,0 :Attacker

The 95 means that 95% of the time the battle end with the defender having all his men left, 5% of the time with having 21 left and everything else too small to register. In this battle the ONLY result possible is the defender wins without losing a man.

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

Re: 0% battle outcome

Postby LPhillips » Sat Apr 07, 2012 5:44 am

Well, let's move forward with your statistically precise example.

In my experience, KGB, the game sometimes shows a winning percentage of 100, and sometimes permits an actual battle outcome of 0%. I realize that a supposed 0% likelihood is not a reason for disallowing an outcome, but consider that I am witnessing outcomes from the example other than the only allowed outcome. Outcomes where the defender in our example loses 4 or more units may occur. It appears that outcomes of 0% are not affected by the restrictions. So outcomes outside the inner middle 80% are allowed if they never occurred in the test rolls, as is apparent by their assigned probability of 0%.

In simplest terms: according to the example stats as you've given them, any outcomes never encountered in the tests (probably 19 or less defenders remaining) are allowed, apparently because they are not even registered when the restriction is performed. My guess is that the code works by establishing forbidden outcomes and comparing the battle outcome to them, which does not include the outcomes it never encountered when testing. Instead perhaps allowed outcomes should be compiled, and then the final outcome would be compared to them.

It's probably a 1/1000 or less common error, but it can be rather major when it occurs. It should be simple to verify on the code side, but reproducing it in practice would be painful. Willing to do so if it's required :cry:
LPhillips
 
Posts: 965
Joined: Mon Jan 24, 2011 3:25 am

Re: 0% battle outcome

Postby KGB » Sat Apr 07, 2012 8:27 pm

LPhillips,

Piranha can comment on if that's possible. I don't think it is but it may be.

As I said, 0% battle outcomes are possible and legitimate in the 80% middle range especially when there are large numbers of units (>16) involved.

So keep an eye out and mention it if you see it again.

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

Re: 0% battle outcome

Postby LPhillips » Mon Apr 09, 2012 6:05 am

I'll do my best. 100% win scenarios with that volume of units are not common (what human player attacks like that?). The only scenario where this was a recurring problem is Final Stand. I made it, it's not terrible for a one-time playthrough, but I have no trouble with honestly saying that replaying it would be like chewing nails. In short: I'm not eager to try and produce an example, but maybe it will happen in the future.
LPhillips
 
Posts: 965
Joined: Mon Jan 24, 2011 3:25 am

Re: 0% battle outcome

Postby piranha » Mon Apr 09, 2012 7:01 am

Its like KGB says.

The units are aligned in an array and then cut from each side until it reaches 10% removed on both sides.
Whats left are accepted results and if any of those happen it will be okay.
User avatar
piranha
Site Admin
 
Posts: 1189
Joined: Fri Feb 12, 2010 9:44 pm

Next

Return to Bug reports

Who is online

Users browsing this forum: No registered users and 6 guests

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