Skip to content

Posts from A program for determining luck/morality in Heroes 3!

4.8 (4 ratings)
In reply to Dirty_Player
User Avatar
Auto-translated
DARK_DRAGON;188985
By the way, I think using a "hero finder" is cheating, and I think it should be banned.
And spending nights repeatedly reloading the game manually, waiting for the desired hero to appear... It's just that players have too much free time... Or should they just play with the first hero they get? What's the point of playing then?
Сначала было слово...
FizMiG v.2.0 *** Очередное обновление справочника! *** http://vk.com/fizmig

In reply to Dirty_Player
User Avatar
Auto-translated
Dirty_Player;189003

On the 5th floor of the Mage Guild, there is a flight spell!!! Using it, you can fly into the Castle, bypassing the border guards!!!
I tried to fly through – it didn’t work; the guards interfered. I was surprised, as I previously thought that with flight, you could get anywhere.
In reply to Dirty_Player
User Avatar
Auto-translated
About morale in Heroes.

Yesterday, I analyzed the disassembled executable hmm2pl.exe (v2.1, Gold edition by Buka). Here are the results:

1) At the beginning of the battle, a certain pseudo-random number is generated (it likely 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 at the same address throughout the battle! Furthermore, 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 pattern will always be the same, which allows you to record a "notation" of the game (similar to chess).

2) If the morale (m) is greater than zero, then whether it triggers for a specific stack depends on the condition: mod(R, 24) + 1 <= m, where R is the aforementioned pseudo-random number (it can be found using a debugger or special programs). If this condition is met, morale triggers; otherwise, it does not. I haven't yet analyzed the mechanics of "bad" morale triggering.

3) Conclusions: a) if a unit does not trigger morale on one tile, it will not trigger on any of the other tiles (and vice versa; provided that the unit is not attacking; thus, the hypothesis about "morale tiles" is incorrect); b) if morale triggers/does not trigger during an attack, it doesn't matter which tile the attack was launched from: morale will trigger/not trigger on all other tiles as well (here, the number R is calculated after the retaliation); c) by attacking different enemy stacks, we get different R values and, accordingly, different morale.

In the third game, the mechanics may be the same. But R is calculated before the battle and DEPENDS on the timer, but still ONLY before the battle. That is, I want to say that if two players have the same R number, then no matter how they adjust the delays, the morale pattern will also be the same.

I would like to know your opinion on this. And any counterexamples (I haven't found any yet).
In reply to AlexSpl
User Avatar
Auto-translated
2AlexSpl: Very interesting information! But this is for the second game, although some of it is also true for the third!
The formula is most likely the same, but the dependence on time definitely exists in the third game!
Conclusion: It is clear that the hypothesis about moral cells is complete nonsense. But I would argue with point c). Recently, I conducted a battle in which, at the beginning, attacking absolutely any stack gave luck, but if you wait a little, there is no luck!
if two players have the same number R, then no matter how they choose the delays, the moral picture will be the same.
And I didn't understand this phrase at all. That is, there will be no difference between waiting 2 seconds and 2 hours??? Come on.... I don't believe it!!! (c) Stanislavsky

2wolf64: To get there, you need to direct the turn through the castle gate and, while flying over it, press SPACE! It works, I checked!

2AmberSoler: I don't completely agree with you about morale and wait!
In reply to Dirty_Player
User Avatar
Auto-translated
Dirty_Player;189008
I would argue with point (c). Recently, I conducted a battle where attacking absolutely any stack at the beginning gave a luck bonus, but if you wait a bit, there is no luck bonus!

And I didn't understand this phrase at all. So, there will be no difference between waiting 2 seconds and 2 hours??? Come on... I don't believe it!!! (c) Stanislavsky

Regarding the last phrase. You and I start the same battle. For example, I generated R1 = BD76h (48 502), and you generated R2 = 9FF0h (40 944). Then, these numbers change only in arithmetic and logical operations and do not depend on the timer. Let's say that after the attack, my Archangel didn't get morale, but yours did. We start the same battle again, and let's say we are lucky enough that R1 for me and R2 for you are exactly the same as the first time! So, no delays will help me get morale, and you will not get it.

I haven't looked at the luck yet...
In reply to AlexSpl
User Avatar
Auto-translated
AlexSpl;189007
About morality in Heroes.

2) If morality (m) is greater than zero, whether it drops or not for a specific stack depends on the condition: mod(R, 24) + 1 <= m, where R is the aforementioned pseudo-random number (it can be found using a debugger or special programs). If this condition is met, morality drops; otherwise, it does not. I haven't yet analyzed the mechanics of "bad" morality dropping.

3) Conclusions: a) if a unit does not receive morality on one tile, it will not receive it on any of the others (and vice versa; provided that the unit is not attacking; thus, the hypothesis about "morality tiles" is incorrect);

Regarding point 2... I don't know much about assembly language... but I would like to know how the conclusion was made that mod(R, 24) + 1 <= m is the desired formula.

Regarding point 3... the conclusions were made by analyzing the executable file from the second Heroes game... but in the third, it might not be the same... so it cannot be stated definitively... I believe what I see... I stand by what I say ;)

Sincerely, K0Lb@zzeR.
:smile13: [ТУРНИР] "Гонка за Лидером" :smile13:
:smile28: [M] "Я и моя тень" - "I am and my shadow" :smile28:
:smile16: "Быстрая смерть" - "Fast Death" :smile16:
In reply to AlexSpl
User Avatar
Auto-translated
AlexSpl;189012
Regarding the last statement. You and I start the same battle. For example, I generated R1 = BD76h (48,502), and you generated R2 = 9FF0h (40,944). Then, these numbers change only in arithmetic and logical operations and do not depend on the timer. Let's say that after the attack, my Archangel didn't get morale, but yours did. We start the same battle again, and let's assume we're lucky enough that R1 for me and R2 for you are exactly the same as the first time! So, no delays will help me get morale, and you won't get it either.
But what about the fact that you can get morale in the first round and get it 10 times in a row, and on the 11th time, you might not get it? This happens, and you can't argue with that! Could it be that the first 10 times, it was one R, and on the 11th time, it was a different one?

Added 2 minutes later
K0Lb@zzeR;189013
Regarding point 3... the conclusions were drawn by analyzing the executable file from the second Heroes game... but in the third, things might be different...
The second and third Heroes games were created by the same company and probably by the same programmers, and I don't think that the formulas and principles would have changed drastically!
User Avatar
Auto-translated
Dirty_Player;189014

The second and third installments were created by the same company and, most likely, by the same programmers, and I don't think the formulas and principles would have changed drastically!

That made me smile... it's true... one programmer... that's definitely nonsense... he just didn't live to see the third game (he probably got fired)... believe me, I'm a programmer :)

And all subsequent versions should be better... the program's core is completely different... definitely...
:smile13: [ТУРНИР] "Гонка за Лидером" :smile13:
:smile28: [M] "Я и моя тень" - "I am and my shadow" :smile28:
:smile16: "Быстрая смерть" - "Fast Death" :smile16:
In reply to K0Lb@zzeR
User Avatar
Auto-translated
2Dirty Player: Where is the misunderstanding? :) To run 11 tests, you need to start the battle from the beginning 11 times. Right? And 11 times the value of R (which depends on the "seed") will be different! This means that 10 times, the values of R resulted in the remainder being the same (more precisely, [remainder + 1] was not greater than the morale), and on the 11th time, everything happened the other way around. I repeat, this is just an assumption, and the morale mechanism in Heroes 3 is more complex than in Heroes 2.

2K0Lb@zzeR: IDA Pro v5.02. The conclusion is unambiguous; if needed, I can send you a code snippet in a private message.

P. S. In general, I started all this in the hope of learning how to predict morale and luck, but it seems that due to their pseudo-random nature, you can't do it with just your brain... Although, of course, you can try to write a program that would read the value of R from the RAM and "predict" the occurrence of morale and luck. By the way, thanks to this mini-research, I finally saw the animation of bad luck (a thundercloud and lightning) :)
In reply to AlexSpl
User Avatar
Auto-translated
AlexSpl;189028
I repeat, this is just an assumption, and the morality mechanism in the third game is more complex than in the second. 2K0Lb@zzeR: IDA Pro v5.02. The conclusion is unambiguous; if needed, I can send you a code snippet in a private message.

1. Definitely more complex if there is room for intervals... but I still want to test my hypothesis about the morality cells...

2. Send it in a private message... we'll try to figure it out too. :)

Sincerely, K0Lb@zzeR.
:smile13: [ТУРНИР] "Гонка за Лидером" :smile13:
:smile28: [M] "Я и моя тень" - "I am and my shadow" :smile28:
:smile16: "Быстрая смерть" - "Fast Death" :smile16:
In reply to K0Lb@zzeR
User Avatar
Auto-translated
2K0Lb@zzeR: Okay, that's enough off-topic chatter. I'll send it no earlier than tomorrow (I don't have internet access at home). Regarding the "delays": I stand by my opinion (morality doesn't depend on time intervals, which I will try to disprove or confirm).
In reply to K0Lb@zzeR
Auto-translated
Dirty_Player;189008
2wolf64: To get there, you need to direct the movement through the Castle gates and, while flying over them, press SPACE! It works, I've checked!
This is a well-known bug, especially annoying because it is directly prohibited on most Heroes resources, therefore, IMHO, many players here also consciously avoided using it.

And doublecast also works. Checked!

P. S. There are many bugs related to flight in general. Flight can be interrupted not only by pressing SPACE or other keys, but also by an event, a battle, or picking up an item (when a hero, after picking something up from the map, stops near the item. For example, at a garrison, without fighting it. Or directly on an artifact). Therefore, on HeroSortale, this is directly prohibited; the wording is approximately: "It is forbidden to artificially interrupt flight, for example, by pressing keys." The latter means, in particular, that the cell on which the hero lands at the end of the flight must be free. And that makes sense.
In reply to K0Lb@zzeR
User Avatar
Auto-translated
Dirty_Player;189008
2AlexSpl: To get in there, you need to direct the movement through the castle gates and, while flying over them, press SPACE! It works, I've checked!
In certain hero circles, this is considered a bug and is prohibited by the rules :smile01:

Added 5 minutes later
AlexSpl;189028
By the way, thanks to this mini-investigation, I finally saw the failure animation (a thundercloud and lightning) :)
This is in Heroes II. After visiting the looted pyramid, this thing appears. -2 to luck.
In Heroes III, there is no such thing as "anti-luck." And as for what was written here about the uselessness of the devils' ability and the "bad luck" spell, it depends on how you look at it. If the opponent has +1 to luck, devils will be useful; with more luck, "bad luck" will work on everyone.
In reply to Catch
User Avatar
Auto-translated
Catch;189048
In certain Heroes circles, this is considered a bug and is prohibited by the rules :smile01:
.
Therefore, it needs to be clearly stated and included in the list of prohibitions, or, conversely, allowed.

Statistics

Welcome our newest member: Emil