Auto-translated
About morale in Heroes.
Yesterday, I analyzed the disassembled executable hmm2pl.exe (v2.1, Gold edition from Buka). Here are the results:
1) At the beginning of the battle, a certain pseudo-random number is generated (it probably depends on the qualitative and quantitative composition of the army, the distribution of stacks in slots, etc.). This number does not depend on the timer and is stored in the same address throughout the battle! Then, it changes during the battle, but only as a result of arithmetic and logical operations (and, or, shl, etc.). That is, if you repeat the same moves (actions), the morale picture will always be the same, which allows you to record a "notation" of the game (similar to chess).
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 that does not directly depend on the timer, but the "delay" theory IS TRUE! Let me explain: the number R constantly changes 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) if you view information about the unit (another confirmation that this number changes in the animation cycle). Sometimes, R does not change at all for a second or two...
3) Conclusion: predicting the triggering of morale in Heroes 3, IMHO, is practically impossible.
Therefore, it is quite possible to achieve the triggering of morale (and, possibly, luck) for each of your units without changing the game structure. There is much to think about...
Could you conduct a similar analysis for Heroes 1? I would be extremely grateful.:smile24:
P.S. As I wrote above (posts #452, #454), the triggering of morale and luck is regulated (I would like to hear the opinion of a programmer), but in light of recent events, I will not be surprised by anything anymore.
Sincerely, VDV_forever