Closed LeHerosInconnu closed 1 year ago
It it a bug though? I tried the basic necromancy in the original game, and it seams to always to round down, never up. 21 peasants gave 2 skeletons, 29 gave 2 skeletons, 30 gave 3.
@Mr-Bajs yeah, I also remember that number of skeletons is rounded down. This should be additionally checked.
Hello @Mr-Bajs and @oleg-derevenetz,
It it a bug though? I tried the basic necromancy in the original game, and it seams to always to round down, never up. 21 peasants gave 2 skeletons, 29 gave 2 skeletons, 30 gave 3.
@Mr-Bajs yeah, I also remember that number of skeletons is rounded down. This should be additionally checked.
This is rounded down in the original game. It was made rounded up in fheroes2, because in the original game the necromancy always gives at least 1 skeleton (10% of 1 peasant (0.1) raises 1 skeleton) while in fheroes2 it was given 0 skeleton (10% of 1 peasant (0.1) raises 0 skeleton).
Related closed issue: https://github.com/ihhub/fheroes2/issues/1496.
@LeHerosInconnu
This is rounded down in the original game. It was made rounded up in fheroes2, because in the original game the necromancy always gives at least 1 skeleton (10% of 1 peasant (0.1) raises 1 skeleton) while in fheroes2 it was given 0 skeleton (10% of 1 peasant (0.1) raises 0 skeleton).
But that's not the case. In fheroes2 there also will be 1 skeleton even from 1 peasant. Just checked this in the Battle Only mode.
@oleg-derevenetz.
@LeHerosInconnu
This is rounded down in the original game. It was made rounded up in fheroes2, because in the original game the necromancy always gives at least 1 skeleton (10% of 1 peasant (0.1) raises 1 skeleton) while in fheroes2 it was given 0 skeleton (10% of 1 peasant (0.1) raises 0 skeleton).
But that's not the case. In fheroes2 there also will be 1 skeleton even from 1 peasant. Just checked this in the Battle Only mode.
Yes, the problem has been solved and the issue closed. :)
@Mr-Bajs yeah, I also remember that number of skeletons is rounded down.
@oleg-derevenetz, in this case raising of 3 skeletons from 23 units is incorrect, right?
@LeHerosInconnu
Yes, the problem has been solved and the issue closed. :)
So currently this logic behave (mostly) just like in the OG, right? The only exception is 3 skeletons from 23 peasants, which is incorrect.
@undef21
in this case raising of 3 skeletons from 23 units is incorrect, right?
Yes, this case seems incorrect.
@Mr-Bajs yeah, I also remember that number of skeletons is rounded down.
@oleg-derevenetz, in this case raising of 3 skeletons from 23 units is incorrect, right?
Yes incorrect.
OG: 23 peasants gives 2 skeletons Fheroes2 1.0.2: 23 peasants gives 3 skeletons, which is incorrect. It should give 2 skeletons not 3. So something is wrong.
@oleg-derevenetz could you look at this place?
Is a correct formula just raiseCount = enemyTroopsKilled * necromancyPercent / 100
?
@oleg-derevenetz.
@LeHerosInconnu
Yes, the problem has been solved and the issue closed. :)
So currently this logic behave (mostly) just like in the OG, right? The only exception is 3 skeletons from 23 peasants, which is incorrect.
I assumed that it was simpler to round up as this would take all cases into account, without needing a special case to have at least one skeleton raised, but this does not seem to be the case.
It is the same from 23 to 29. Everything must be 3 skeletons from 21 to 29 creatures decimated (rounded up), or everything must be 2 skeletons from 21 to 29 creatures decimated (rounded down).
@undef21
Is a correct formula just
raiseCount = enemyTroopsKilled * necromancyPercent / 100
?
I'm not sure about the correct formula. Need to make some inquiries.
Is a correct formula just
raiseCount = enemyTroopsKilled * necromancyPercent / 100
?
Yes, it seems so. In HoMM3 the efficiency of Necromancy depends on the health of dead stacks, while in HoMM2 it seems to depend only on the number of killed units (although I haven't found the exact formula anywhere).
Preliminary checks
Platform
Windows
Describe the bug
In fheroes2, the number of skeletons raised is not rounded up correctly.
In fheroes2:
In the example, for 10% of 21 decimated peasants (2.1), 2 skeletons are raised instead of 3 (standard and instant combat):
In the example, for 10% of 22 decimated peasants (2.2), 2 skeletons are raised instead of 3 (standard and instant combat):
In the example, for 10% of 23 decimated peasants (2.3) and then up to 30 decimated peasants, 3 skeletons are raised (standard and instant combat), so from there to 30, it is correct:
Save file
Here is the test scenario file: 0 9924d.zip
Additional info
No response