Auto-translated
2Andrey44_44: Yeah, a familiar situation, you know that victory is yours, but it just won't come... But when it does, you call yourself a genius and don't doubt it at all :)
About morale in Heroes III...
I conducted an analysis. Here's what I found:
1) The condition for morale to trigger is the same: mod(R, 24) + 1 <= m (in this case, m is the morale of the unit);
2) R is a pseudo-random number - it doesn't directly depend on the timer, but the "delay" theory IS TRUE! Let me explain: the number R is constantly changing in a certain cycle, even if the player does nothing. Furthermore, R changes quite quickly, but unevenly, in jerks. An interesting observation: the rate of change of the number R drops to one per second (approximately, of course) when viewing information about the unit (another confirmation that this number changes in the animation cycle). Sometimes, R doesn't change at all for a second or two...
3) Conclusion: predicting the morale trigger in Heroes 3, IMHO, is practically impossible.
4) The __rand() function calls operating system kernel functions, so there is still a difference depending on which OS you play on.
I confirmed that R does indeed change in the animation cycle of idle units. That is, the more orcs swing their axes, the faster R changes, and when viewing information about the hero, the number R does not change at all (note that in this case, the animation of all units is paused!).
I'll also add that it is practically possible to create a program that would read R from RAM and predict the remainder (if you set the animation speed to the minimum, the rate of change of R is not very large). For example, when the remainder satisfies the condition for morale to trigger, a green "morale traffic light" lights up :) and the player simply clicks the mouse. I have no doubt that he will be able to do this. Therefore, it is quite possible to achieve morale (and possibly luck) for each of your units without changing the structure of the game. There is much to think about...