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.8.13 (Troubling Times) active on Google Play
Useful links
Source code of the game - Contribution guide - ATCS Editor - Translate the game on Weblate - Example walkthrough - Andor's Trail Directory - Join the Discord
Get the game (v0.8.13) from Google, Github, F-Droid, our server, or itch.io
Useful links
Source code of the game - Contribution guide - ATCS Editor - Translate the game on Weblate - Example walkthrough - Andor's Trail Directory - Join the Discord
Get the game (v0.8.13) from Google, Github, F-Droid, our server, or itch.io
Miscalculations in enemy difficulty
-
- Posts: 65
- Joined: Sat Dec 21, 2019 4:33 am
- android_version: 10 - Android 10
Re: Miscalculations in enemy difficulty
You do not have the required permissions to view the files attached to this post.
-
- Posts: 192
- Joined: Mon Mar 04, 2019 8:45 pm
- android_version: 8.1 - Oreo
Re: Miscalculations in enemy difficulty
Currently the code uses floats for the relevant parts. So there should be only minimal rounding issues.
-
- Posts: 192
- 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: 4524
- Joined: Tue Aug 20, 2013 2:04 am
- android_version: 10 - Android 10
- Location: Somewhere in Dhayavar
- Contact:
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 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:75, XP:7656192, PV:866, FQ:105
HP:226, AC:255, AD:47-61, AP:3, ECC:23%, CM:3.0, BC:192, DR:3
Gold: 241432 | RoLS:1, RoL:1, GoW:1, VSH:1, RoFLS:1, WoB:1
HH:1, WA:1, D:1, CS:2, Cl:1, IF:4, Ev:3, Re:2, WP:DA:1, WP:1S:1, WP:B:1, AP:L:1, FS:DW:2, S:DW:1
HP:226, AC:255, AD:47-61, AP:3, ECC:23%, CM:3.0, BC:192, DR:3
Gold: 241432 | RoLS:1, RoL:1, GoW:1, VSH:1, RoFLS:1, WoB:1
HH:1, WA:1, D:1, CS:2, Cl:1, IF:4, Ev:3, Re:2, WP:DA:1, WP:1S:1, WP:B:1, AP:L:1, FS:DW:2, S:DW:1
-
- Posts: 20
- 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 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 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: 45
- Joined: Mon Dec 23, 2019 10:59 pm
- android_version: 6.0 - Marshmallow
- Location: in Leta's basement
-
- Posts: 192
- 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 pm The floor function in dc is necessary to allow for non-integer 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 pm Getting 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: 4524
- Joined: Tue Aug 20, 2013 2:04 am
- android_version: 10 - Android 10
- Location: Somewhere in Dhayavar
- Contact:
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:75, XP:7656192, PV:866, FQ:105
HP:226, AC:255, AD:47-61, AP:3, ECC:23%, CM:3.0, BC:192, DR:3
Gold: 241432 | RoLS:1, RoL:1, GoW:1, VSH:1, RoFLS:1, WoB:1
HH:1, WA:1, D:1, CS:2, Cl:1, IF:4, Ev:3, Re:2, WP:DA:1, WP:1S:1, WP:B:1, AP:L:1, FS:DW:2, S:DW:1
HP:226, AC:255, AD:47-61, AP:3, ECC:23%, CM:3.0, BC:192, DR:3
Gold: 241432 | RoLS:1, RoL:1, GoW:1, VSH:1, RoFLS:1, WoB:1
HH:1, WA:1, D:1, CS:2, Cl:1, IF:4, Ev:3, Re:2, WP:DA:1, WP:1S:1, WP:B:1, AP:L:1, FS:DW:2, S:DW:1
-
- Posts: 192
- 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/andors-trail ... difficulty
https://github.com/Chriz76/andors-trail ... difficulty
-
- Posts: 192
- Joined: Mon Mar 04, 2019 8:45 pm
- android_version: 8.1 - Oreo
Re: Miscalculations in enemy difficulty
The fix is part of the current beta: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.
viewtopic.php?f=5&t=6758