Alya-N / C-Hero-Calc

PvE Solver for Cosmos Quest (Last Update: Archers and the Eternals)
10 stars 6 forks source link

Bug with version 3.2.2.0b #5

Closed aurril closed 5 years ago

aurril commented 5 years ago

I have a solution for Quest 140-3 which in fact is a draw.

Solution for [quest140-3 | Followers: 1,876,425,000 | a27 e27 a30 f28 e30 f27 <==]: [Followers: 0 | leprechaun:99 aathos:99 guy:39 aauri:64 <==]

39244 Fights simulated. Total Calculation Time: 0 Calc Version: 3.2.2.0b

Battle Replay (Use on Ingame Tournament Page): eyJ3aW5uZXIiOiJVbmtub3duIiwibGVmdCI6IlNvbHV0aW9uIiwicmlnaHQiOiJJbnN0YW5jZSIsImRhdGUiOjE1NDQ0MzcxOTEsInRpdGxlIjoiUHJvcG9zZWQgU29sdXRpb24iLCJzZXR1cCI6Wy05OCwtNjgsLTEzMiwtNzAsLTEsLTEsLTk4LC02OCwtMTMyLC03MCwtMSwtMSwtOTgsLTY4LC0xMzIsLTcwLC0xLC0xLC05OCwtNjgsLTEzMiwtNzAsLTEsLTEsLTk4LC02OCwtMTMyLC03MCwtMSwtMV0sInNoZXJvIjpbMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsOTksMCw2NCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCw5OSwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwzOSwwXSwicGxheWVyIjpbMTA0LDEwNSwxMTYsMTEwLDExNywxMDYsMTA0LDEwNSwxMTYsMTEwLDExNywxMDYsMTA0LDEwNSwxMTYsMTEwLDExNywxMDYsMTA0LDEwNSwxMTYsMTEwLDExNywxMDYsMTA0LDEwNSwxMTYsMTEwLDExNywxMDZdLCJwaGVybyI6WzAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwXX0=

I hope this helps to reproduce the problem.

Alya-N commented 5 years ago

Apparently calc decided to target e27 instead of a27. I've made a quick fix here, but I haven't tested it yet to push it to master branch: https://github.com/Alya-N/C-Hero-Calc/tree/AnotherGuyTargetingFix

EDIT: I guess I can tell you in detail what happened. When code was checking for alive units (I assume to account for Guy targeting before attack, which was moved to after attack), it was checking whether the number of alive units counted so far was equal to the Guy's target's relative index (which was 4 for a27 (since absolute index of a27=5 and e30=1)). Since the amount of alive units was less than 4 at that point, it defaulted to using counter_target as an absolute index (which happened to be e27). I removed that part of code, assuming that findMaxHP() function can figure out what to target without counting alive units. Still, it doesn't feel right to remove chunks of code to make something work, which is why I'm not pushing it to master branch yet.

EDIT2: It has been merged to the master branch. Change to the code can be seen here: https://github.com/Alya-N/C-Hero-Calc/commit/9ab1d5537efd5846ec43e369081c858d749b9c27

aurril commented 5 years ago

It seems to fix it, since now it has no solution anymore and with one additional lee level it finds a solution, which works.