Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug version and the original get the different result in battle #7965

Closed
2 tasks done
fheroes2bugs opened this issue Oct 19, 2023 · 4 comments
Closed
2 tasks done
Labels
bug Something doesn't work

Comments

@fheroes2bugs
Copy link

fheroes2bugs commented Oct 19, 2023

Preliminary checks

Platform

Windows

Describe the bug

In autobattle I got different result in autobattle in debug version (debug = 5460) and the original one.

In original I don't lose unit(also my archers get morale):

dont.lose.units.in.original.version.mp4

In debug version I loose unit:

lose.unit.in.debug.version.mp4

Sure I understand that lose of units is caused by random damage of units, but in original one I can play it 100 times and never get my unit killed, and in the second one (in debug version, when archers get luck) I always get my unit killed.

The bug is in different luck in original fheroes and debug version.
In debug version I don't get luck.

Save file

autobattle - morale.zip

Additional info

version 1.09

@fheroes2bugs fheroes2bugs added the bug Something doesn't work label Oct 19, 2023
@oleg-derevenetz
Copy link
Collaborator

oleg-derevenetz commented Oct 20, 2023

The bug is in different luck in original fheroes and debug version.

What do you mean by "original fheroes"? If the "original fheroes" is the binary from our Releases section and "debug version" is the one that you built yourself from our sources, then it is inevitable for two reasons:

  1. The logic of AI operation in newer sources may differ. AI makes different decisions during the battle, and it affects everything, including random events (including damage, luck and morale);
  2. The operation of the random number generator may be different depending on the flavor and version of the compiler. That is, MSVC 2019, MSVC 2022, Clang and GCC all may give different chains of pseudo-random numbers for the same seed.

@ihhub
Copy link
Owner

ihhub commented Nov 19, 2023

Hi @oleg-derevenetz , I assume nothing we can do here as you correctly described the root of the problem, can't we?

@oleg-derevenetz
Copy link
Collaborator

Hi @ihhub if debug and release versions are built from the different set of sources (or using different compilers) then this is inevitable due to reasons described above.

@ihhub
Copy link
Owner

ihhub commented Nov 19, 2023

Closing this issue as nothing we can do.

@ihhub ihhub closed this as completed Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something doesn't work
Projects
None yet
Development

No branches or pull requests

3 participants