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:
The logic is similar for d_c, with a bit of special handling for the crit multiplier.
v0.7.11 released to Google Play!
Useful links
Project news  Source code of the game  Contribution guide  Documentation  ATCS Content Editor Translate the game on Weblate  Example walkthrough  Andor's Trail Directory  Join the Discord
Get the game from Google, our server, itch.io, or FDroid
Useful links
Project news  Source code of the game  Contribution guide  Documentation  ATCS Content Editor Translate the game on Weblate  Example walkthrough  Andor's Trail Directory  Join the Discord
Get the game from Google, our server, itch.io, or FDroid
Miscalculations in enemy difficulty

 Posts: 16
 Joined: Sat Dec 21, 2019 4:33 am
 android_version: 9.0  Pie
Re: Miscalculations in enemy difficulty
You do not have the required permissions to view the files attached to this post.

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

 Posts: 146
 Joined: Mon Mar 04, 2019 8:45 pm
 android_version: 8.1  Oreo
Re: Miscalculations in enemy difficulty
This should work without a sum formula using the same logic:
Edit: reasons for not using sum formulas is that it might make coding or calculations easierYou do not have the required permissions to view the files attached to this post.
 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
Actually, strictly speaking, it's this:
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).
The floor function in dc is necessary to allow for noninteger 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:4658, 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
HP:224, AC:247, AD:4658, 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

 Posts: 19
 Joined: Thu Nov 14, 2019 11:47 pm
 android_version: 4.4  Kitkat
 Location: Brasil (Brazil)
Re: Miscalculations in enemy difficulty
I agree with this version. It seems that is enough.rijackson741 wrote: ↑Sun Jan 05, 2020 11:47 pmActually, strictly speaking, it's this:
Average damage.png
The floor function in dc is necessary to allow for noninteger 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 rounding in the d_c calculation because it's like a real hit and the hits are always integers at the end.
 Fallhaven Sentinel
 Posts: 44
 Joined: Mon Dec 23, 2019 10:59 pm
 android_version: 6.0  Marshmallow
 Location: in Leta's basement

 Posts: 146
 Joined: Mon Mar 04, 2019 8:45 pm
 android_version: 8.1  Oreo
Re: Miscalculations in enemy difficulty
Good point. Yes, the floor is necessary.rijackson741 wrote: ↑Sun Jan 05, 2020 11:47 pmThe floor function in dc is necessary to allow for noninteger values of CM.
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.rijackson741 wrote: ↑Sun Jan 05, 2020 11:47 pmGetting rid of the summation for dc is harder than getting rid of it for dnc, and perhaps impossible with the floor function.
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.
 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
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:4658, 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
HP:224, AC:247, AD:4658, 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

 Posts: 146
 Joined: Mon Mar 04, 2019 8:45 pm
 android_version: 8.1  Oreo
Re: Miscalculations in enemy difficulty
Finally I found time create the code. Thanks for finding the bug and the productive discussion.
https://github.com/Chriz76/andorstrail ... difficulty
https://github.com/Chriz76/andorstrail ... difficulty

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