Miscalculations in enemy difficulty

A place to submit bugs to the Andor's Trail Development Team.
QQkp
Posts: 16
Joined: Sat Dec 21, 2019 4:33 am
android_version: 9.0 - Pie

Re: Miscalculations in enemy difficulty

Post by QQkp »

rijackson741: Looks right to me. H46732f's logic is predicated on the same idea, I think - the termial function (triangular number) provides a way of collapsing the sums into a closed form:
2020-01-05 noncrit damage derivation.jpg
The logic is similar for d_c, with a bit of special handling for the crit multiplier.
You do not have the required permissions to view the files attached to this post.

Gonk
Posts: 146
Joined: Mon Mar 04, 2019 8:45 pm
android_version: 8.1 - Oreo

Re: Miscalculations in enemy difficulty

Post by Gonk »

H46732f wrote:
Sun Jan 05, 2020 10:18 am
Rounding can really interfere
Currently the code uses floats for the relevant parts. So there should be only minimal rounding issues.

Gonk
Posts: 146
Joined: Mon Mar 04, 2019 8:45 pm
android_version: 8.1 - Oreo

Re: Miscalculations in enemy difficulty

Post by Gonk »

This should work without a sum formula using the same logic:
formula.png
Edit: reasons for not using sum formulas is that it might make coding or calculations easier
You do not have the required permissions to view the files attached to this post.

User avatar
rijackson741
Posts: 3348
Joined: Tue Aug 20, 2013 2:04 am
android_version: 10 - Android 10
Location: Somewhere in Dhayavar

Re: Miscalculations in enemy difficulty

Post by rijackson741 »

Actually, strictly speaking, it's this:
Average damage.png
The floor function in dc is necessary to allow for non-integer values of CM.
Getting rid of the summation for dc is harder than getting rid of it for dnc, and perhaps impossible with the floor function. Anyway, to be honest I don't see the point, because the sum is just a simple loop, and N will never even get to 100, so computation time is miniscule. It's also a lot easier to understand where it come from, since it is the general formula for the mean of a discrete probability distribution (something that might be worth adding as a comment in the code).
You do not have the required permissions to view the files attached to this post.
Level:69, XP:5961483, PV:514, FQ:66
HP:224, AC:247, AD:46-58, AP:3, ECC:23%, CM:3, BC:174, DR:3
Gold: 237559 | RoLS:1, RoL:1, GoW:1, VSH:1, RoFLS:1
HH:1, WA:1, CS:2, Cl:1, IF:4, Ev:3, Re:2, WP:DA:1, WP:1S:1, AP:L:1, FS:DW:2, S:DW:1

H46732f
Posts: 19
Joined: Thu Nov 14, 2019 11:47 pm
android_version: 4.4 - Kitkat
Location: Brasil (Brazil)

Re: Miscalculations in enemy difficulty

Post by H46732f »

rijackson741 wrote:
Sun Jan 05, 2020 11:47 pm
Actually, strictly speaking, it's this:
Average damage.png
The floor function in dc is necessary to allow for non-integer values of CM.
Getting rid of the summation for dc is harder than getting rid of it for dnc, and perhaps impossible with the floor function. Anyway, to be honest I don't see the point, because the sum is just a simple loop, and N will never even get to 100, so computation time is miniscule. It's also a lot easier to understand where it come from, since it is the general formula for the mean of a discrete probability distribution (something that might be worth adding as a comment in the code).
I agree with this version. It seems that is enough.
I agree with this rounding in the d_c calculation because it's like a real hit and the hits are always integers at the end.

User avatar
Fallhaven Sentinel
Posts: 44
Joined: Mon Dec 23, 2019 10:59 pm
android_version: 6.0 - Marshmallow
Location: in Leta's basement

Re: Miscalculations in enemy difficulty

Post by Fallhaven Sentinel »

(*admires the math nerds from a distance*)
~x

Gonk
Posts: 146
Joined: Mon Mar 04, 2019 8:45 pm
android_version: 8.1 - Oreo

Re: Miscalculations in enemy difficulty

Post by Gonk »

rijackson741 wrote:
Sun Jan 05, 2020 11:47 pm
The floor function in dc is necessary to allow for non-integer values of CM.
Good point. Yes, the floor is necessary.
rijackson741 wrote:
Sun Jan 05, 2020 11:47 pm
Getting rid of the summation for dc is harder than getting rid of it for dnc, and perhaps impossible with the floor function.
I don't think it is worth trying to find a way to get rid of the summation (even though it could be a funny and challenging task). So for the coding in AT we will have to use the loop.

When I was talking about simpler calculations I thought about excel or google spreadsheet e.g. for the rebalancing calculations. Does excel support the mathematical sum function? I know there is a "sum" function but it does something different. On the other hand I don't know if the enemies DR was used in the calculations for the rebalancing at all.

User avatar
rijackson741
Posts: 3348
Joined: Tue Aug 20, 2013 2:04 am
android_version: 10 - Android 10
Location: Somewhere in Dhayavar

Re: Miscalculations in enemy difficulty

Post by rijackson741 »

I don't think you can do a sum like that in Excel unless you resort to VBA. The solution is to use a different tool, such as SMath Studio, which is free.
Level:69, XP:5961483, PV:514, FQ:66
HP:224, AC:247, AD:46-58, AP:3, ECC:23%, CM:3, BC:174, DR:3
Gold: 237559 | RoLS:1, RoL:1, GoW:1, VSH:1, RoFLS:1
HH:1, WA:1, CS:2, Cl:1, IF:4, Ev:3, Re:2, WP:DA:1, WP:1S:1, AP:L:1, FS:DW:2, S:DW:1

Gonk
Posts: 146
Joined: Mon Mar 04, 2019 8:45 pm
android_version: 8.1 - Oreo

Re: Miscalculations in enemy difficulty

Post by Gonk »

Finally I found time create the code. Thanks for finding the bug and the productive discussion.

https://github.com/Chriz76/andors-trail ... difficulty

Gonk
Posts: 146
Joined: Mon Mar 04, 2019 8:45 pm
android_version: 8.1 - Oreo

Re: Miscalculations in enemy difficulty

Post by Gonk »

QQkp wrote:
Fri Jan 03, 2020 10:25 pm
Encountered this earlier today on 0.7.7. Currently doing Colonel Lutarc, round 1 against a lizard. The lizard's difficulty is listed as "Very hard", but the battle was actually fairly easy.
The fix is part of the current beta:
viewtopic.php?f=5&t=6758

Post Reply