Skip to content

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

4.8 (4 ratings)
User Avatar
#572
Auto-translated
2Dirty Player: To build the skill tree, select the depth in the "Settings" menu (it's best not to choose 20 - it takes a long time to load), and double-click on the HERO NUMBER in the list, then wait a bit. The tree will appear in a separate window.

And the "Traffic Light" shouldn't appear yet. I removed the scan. Although, you can try testing it: in some cases, when Heroes is launched (with R in the first thread), it might work. Today, diamond from wasm.ru helped solve the problem. Tomorrow or the day after, everything will work reliably, and not just occasionally :)
In reply to AlexSpl
User Avatar
#573
Auto-translated
Everything works perfectly!!! And please, for the sake of help, restore the old version so that anyone can understand it.
User Avatar
#574
Auto-translated
2VDV_forever: The traffic light for HoMM I 1.1 will probably be ready by the end of the week. Here's some interesting information: The probability of luck occurring (both positive and negative) is 1/12 (+1/-1), 2/12 (+2/-2), 3/12 (+3/-3), which is twice as high as the probability of morale! The probability of negative morale occurring is -n/12 (n=-1, -2, -3), but in some cases, there is still a 25% chance of avoiding negative morale, even if it should have occurred. R does not change when skipping a turn, casting a spell, or during the turn of enemy units if they are not attacking. R changes when attacking (either your unit or the enemy, the number of changes depends on the level and the number of units on both the attacking and defending sides), as well as after the turn (not an attack) of your unit. It is impossible to repeat the battle based on the description (I tested battles without a Hero on the enemy side).
User Avatar
#575
Auto-translated
R does not change when skipping a turn, casting a spell, or during enemy unit turns, unless they attack.
Apparently, this isn't all the information? Because in practice, it IS possible to achieve a morale drop, for example, for archers against neutral units, in the first round with all other actions being the same.
It is impossible to repeat the battle exactly as described (I checked battles without a Hero on the enemy side).
If there is no enemy hero, then I agree. But when there is one, it becomes much more interesting, because there have been cases of almost 100% reproducibility of complex battles, although even there, differences were possible after a few rounds.
In reply to Fireball
User Avatar
#576
Auto-translated
Fireball;199544
If there is no enemy hero, then I agree. But when there is one, it becomes much more interesting, because there have been cases of almost 100% reproducibility of complex battles, although even there, differences were possible after a few rounds.

And indeed, they are very interesting... the repeatability is almost complete, but the damage dealt is not constant:smile32:

Индивидуальный и клановый рейтинги Heroes World
Handmade
User Avatar
#577
Auto-translated
And indeed, they are very interesting... the repetition is almost complete, but the damage dealt is not constant.
Sometimes the damage is also repeated. In a memorable battle against a Warlock, after the dragons' counterattack, the same number of Peasants always survived. And in the next 2 rounds, I didn't notice any particular differences, at least not in the number of units killed. Real variations were observed first when breaking through the walls, and then chaos ensued.
User Avatar
#578
Auto-translated
2Fireball: At the beginning of the battle, a pseudo-random R is generated, which turns out to be different for the same battle, even on the same save. In general, the situation is very interesting: for example, with fairies against dwarves, it is possible to achieve that the fairies get lucky and gain morale. That is, we fly around, wait for the signal for luck and morale. We hit the dwarves (double damage), morale increases - we fly away. And so on. However, in many games, you can do something similar, so there's no escaping it. For example, in chess, there are rules for three and fifty moves. Maybe introduce something similar for Heroes?

The Birth of the Barbarian. In the Third, there are indeed cases where individual Heroes develop differently than all the others. The new version of the tree will take this fact into account. Also, now the program will always find the addresses.
If there is no enemy hero, then I agree. But when there is one, it becomes much more interesting, because there were cases of almost 100% reproducibility of complex battles, although there were still differences after a few rounds.
Almost 100% means, in essence, complete randomness :) Today I will conduct tests of battles with Heroes. By the way, have you seen the animation of failure? ;)
User Avatar
#579
Auto-translated
posted by VDV_Forever
You're mistaken...

Just now, I made three attempts to attack with a Warlock against a Barbarian; 17 Gargoyles attacked Goblins:
1 - 57
2 - 54
3 - 53
damage, respectively!

Индивидуальный и клановый рейтинги Heroes World
Handmade
User Avatar
#580
Auto-translated
LMOracle 3.3

Supported versions:
HoMM III 3.2 EN (heroes3.exe)
HoMM III 4.0 EN (heroes3.exe)
HoMM III 4.0 RU (heroes3.exe)
HoMM II 2.1 RU (hmm2pl.exe)
HoMM I 1.1 RU (heroes.exe)

Contents:
1) Morale and Luck Indicator (HoMM III 3.2 EN, HoMM III 4.0 EN, HoMM III 4.0 RU, HoMM I 1.1 RU);
2) Movement Points Monitor (all supported versions);
3) Development Planner (HoMM III 3.2 EN, HoMM III 4.0 EN, HoMM III 4.0 RU, HoMM II 2.1 RU).

Instructions:
1) Launch your copy of HoMM, which is supported by this program;
2) Launch this program;
3) In the "Settings/Version" menu, select your HoMM version;
4) Click "Start".

Morale and Luck Indicator.
HoMM III 3.2 EN, HoMM III 4.0 EN, HoMM III 4.0 RU
1) Start a battle;
2) Select the morale and luck of the current unit in the "Settings/Morale, Luck" menu;
3) Select the luck of the attacking enemy unit in the "Settings/Enemy's Luck" menu;
4) Select additional conditions: "Without retaliation", "With retaliation", "Without attack", "Will die" (the enemy unit will die as a result of the attack), "Double attack";
5) If you have selected the "Without retaliation" mode, specify the number of warriors in the attacking unit (Attacker);
6) If your unit and/or the enemy unit deals constant damage (mages, angels/archangels, blessed or cursed units, etc.), check the corresponding boxes next to "const";
7) If you have selected the "With retaliation" mode, also specify the number of warriors in the enemy unit after the first attack of your unit (Defender).

The indicator will show, signaling with a green color, at what moments in time morale and/or luck may occur.
The program can perform an automatic click on the indicator signal.
Press and hold the key:
"1" - if you want to catch only morale;
"2" - if you want to catch only luck;
"3" - if you want to catch both morale and luck.

For the "Double attack" mode:
"4" - luck only on the second attack, no morale;
"5" - luck on both attacks, no morale;
"6" - luck only on the second attack and morale;
"7" - luck on both attacks and morale.

Note that the "Will die" + "Double attack" mode assumes that the unit will die after the second attack. The program incorrectly predicts morale if more than one enemy unit dies as a result of your attack (hydras, for example).

HoMM I 1.1 RU
The program predicts luck in all cases; morale is calculated for the case when the unit does not attack.

Movement Points Monitor
The program displays the current and maximum movement points of one or more Heroes in real time.
To find a specific Hero, use the search by name:
1) Enter the Hero's name in the "Hero's Name" box;
2) Click "Find".

To find all Heroes or Heroes belonging to a specific class, call up the context menu of the Hero list (right-click) and select "Find All" or "Find" + "Hero class".

To remove a specific Hero from the list, click on its entry and click "Delete". By default, the last Hero is removed from the list.

To remove all Heroes from the list, call up the context menu of the Hero list (right-click) and select "Clear List".

If, for some reason, the wrong Hero is found (for example, Dragon (Fortress) and Dragon from the "Dragon Slayer" campaign), continue the search by double-clicking on the Hero's name in the list.

Development Planner
HoMM III 3.2 EN, HoMM III 4.0 EN, HoMM III 4.0 RU, HoMM II 2.1 RU
After you have found the desired Hero, you can build a development tree for him.
To do this, select the calculation depth in the "Settings/Depth of calculation" menu (default +5 levels) and double-click on the Hero's number in the list. The development tree will appear in another window.
Note: do not select a calculation depth of +20 levels if you do not have ~30 free minutes (HoMM III), ~10 free minutes (HoMM II) :) Building the development tree in other cases takes a maximum of one minute (+15 levels).

The program also allows you to search for the desired skill and shows all possible ways to obtain it. By default, the "Min. Level-Ups" checkbox is checked, which allows you to find all ways to obtain the desired skill in the minimum number of level-ups.

Thank you to everyone who contributed to the development of this project!
User Avatar
#581
Auto-translated
Thank you very much!
Is it possible to create a less universal program? To be more precise, how feasible is it to create a program specifically for the Russian version of the second Heroes game, which would include, in addition to the map editor, a Heroesopedia adapted for Vista and widescreen displays (this post is the most poorly written of all the posts I've made on forums - I apologize...).

Орден Фениксахаризматический :) лидер
In reply to AlexSpl
User Avatar
#582
Auto-translated
AlexSpl;199770
LMOracle 3.3

Supported versions:
HoMM I 1.1 RU (heroes.exe)

Contents:
1) Morality and luck predictor (HoMM III 3.2 EN, HoMM III 4.0 EN, HoMM III 4.0 RU, HoMM I 1.1 RU);

HoMM I 1.1 RU
The program predicts luck in all cases; morality is calculated for the case when the unit does not attack.

For Heroes 1, the program works correctly and accurately predicts luck and morality.
Is there an idea on how to implement morality prediction (not detection, but actual prediction, like for luck) after an attack, or is this task not feasible for Heroes 1?

Sincerely, VDV_forever
Единый справочник по Героям Меча и Магии

ТУРНИРЫ ПО ГЕРОЯМ 1!:smile13:
User Avatar
#583
Auto-translated
2Qwerty: All I can do is set the default version to HoMM II 2.1 RU. And the hero editor is a completely different kind of program, and integrating it into the launcher is undesirable.

2VDV_forever: It is possible to implement, but you will have to specify two more parameters (monster levels) before the attack.
In reply to AlexSpl
User Avatar
#584
Auto-translated
AlexSpl;200439


2VDV_forever: It is possible to implement, but you will have to specify two more parameters before the attack (monster levels).

If it won't be too much trouble for you, could you implement this feature: o (even if it involves adding extra parameters to the program)? It would be extremely interesting to see and try out this product.

Perhaps, with the introduction of such an improvement, it will be possible to thoroughly study the morale drop in Heroes 1, which, in my opinion, is a very important aspect of the game!

Sincerely, VDV_forever
Единый справочник по Героям Меча и Магии

ТУРНИРЫ ПО ГЕРОЯМ 1!:smile13:
User Avatar
#585
Auto-translated
2VDV_forever: I’ll try to implement it, but I don’t know yet how much time it will take. Here are a couple of screenshots for now:
User Avatar
#586
Auto-translated
.:: LMOracle 3.4 ::.

:: What's New? ::
1) Added a nearly full morale and luck indicator for HoMM I 1.1 RU version;
2) Added a damage monitor for HoMM I 1.1 RU version;
3) Fixed minor bugs.

:: Instructions ::
1) Start a battle;

2) Set the morale and luck values in the "Settings" menu (Morale, Luck, Enemy's Luck);
Note: this step is very important, as an incorrect luck value will result in incorrect damage calculations.

3) Select the mode "Without retaliation", "With retaliation", or "Without attack";

4) Set an additional condition (there is only one for HoMM I), if necessary: "Double attack" (elves, paladins, etc.);

5a) "Without retaliation" mode:
Double-click on the "Defender" label and enter the defense of the attacked unit in the window that appears (you won't miss where to put it). If the attacking unit is a shooter and is blocked, check the "Blocked" box (halves damage for shooters, ignored by all others).

5b) "With retaliation" mode:
Here you need to enter the following parameters (from top to bottom, left to right):
1) The exact number of warriors in the attacked unit who WILL be able to retaliate after the (first) strike of the attacker (the damage monitor can help determine this number, see below);
2) Minimum damage of a warrior in the attacked unit;
3) Maximum damage of a warrior in the attacked unit;
4) [Already set] Attack of the warriors in your current unit;
5) Defense of the warriors in the attacked unit.

Notes (5b):
1) Attack and defense parameters should be entered taking into account all bonuses (the numbers in parentheses in the information window);
2) The "Blocked" checkbox in this mode is checked because if shooters hit with retaliation, it means they are blocked, while other units ignore this flag.

The program signals with a green color before the turn of any unit the possibility of morale and/or luck occurring under the given conditions.

:: Damage Monitor ::

Introduction.
It turns out that the formula k = (1 + 0.1*sign(A1-D2))^|A1-D2| is not exact, although it approximates the damage coefficient quite well within some limits (see below).

In reality, the game calculates damage as follows:
1) The following sum is calculated:
base_dmg = sum[i = 1, n] (int_rand(min_dmg, max_dmg)).

Example:
Suppose n = 10 wolves (min_dmg = 3, max_dmg = 5, A1 = 6, D1 = 2) attack n' = 50 fairies (min_dmg' = 1, max_dmg' = 2, A2 = 4, D2 = 2), then the mentioned sum will look approximately like this:
base_dmg = 4 + 4 + 3 + 5 + 3 + 4 + 3 + 3 + 3 + 5 = 37 (which corresponds to 3.7 * 10 in classical theory, but the number 3.7 is not generated anywhere; it is provided here only for comparison);

2) The resulting sum is multiplied by coefficient k (the first number is the difference between the attacker's attack and the defender's defense (A1-D2), the second is the coefficient k):

0: 1.00

1: 1.10; 2: 1.21; 3: 1.33; 4: 1.46; 5: 1.61; 6: 1.77; 7: 1.95; 8: 2.14; 9: 2.36; 10: 2.59,
11: 2.85; 12: 3.14; 13: 3.45; 14: 3.80; 15: 4.18, 16: 4.59; 17 and above(!): 5.00

-1: 0.90; -2: 0.81; -3: 0.73; -4: 0.66; -5: 0.59; -6: 0.53; -7: 0.48; -8: 0.43; -9: 0.39; -10: 0.35;
-11: 0.31; -12: 0.28; -13: 0.25; -14: 0.23; -15: 0.21; -16 and below(!): 0.20 = 1/5

Thus, maximum damage is observed when the difference A1-D2 >= 17 and is five times the base; minimum is when the difference A1-D2 <= -16 and is five times less than the base.

The figures provided are stored in the game's executable file and are values of the expression (1 + 0.1*sign(A1-D2))^|A1-D2| rounded to the hundredths for various differences of A1-D2. The power is not calculated directly!

Returning to the example. almost_right_dmg = k * base_dmg = 1.46 * 37 = 54.02
This value is either divided by two (blocked shooters, etc.) or multiplied by two (luck).
(almost_right_dmg:=almost_right_dmg/2; almost_right_dmg:=almost_right_dmg*2)

And, the final touch, right_dmg = floor(almost_right_dmg + 0.5)

For our case (let's say, for example, the wolves hit with luck), right_dmg = floor(54.02 * 2 + 0.5) = floor(108.54) = 108.

:: Damage Monitor ::
If all parameters are set correctly, you will see the exact damage in the status bar. For shooters with a double attack, you can see the damage for the first and second shots: with the "Double attack" box unchecked — damage for the first shot, otherwise — for the second).

:: Limitations ::
Morale and damage will generally be predicted incorrectly if:
a) "With retaliation" mode + "Double attack": the enemy's retaliation kills at least one warrior in the attacking unit (as well as variations on this theme with double retaliation against a double attack);

b) You selected "Double attack" mode, but your unit killed the enemy with the first strike (uncheck the "Double attack" box before such attacks).

Please report cases of incorrect morale or damage prediction!

P.S. Units behind Fortress walls receive a +4 defense bonus against shooter attacks! Keep this in mind. The bonus disappears if the unit crosses the wall line or is on it, as well as if your shooters are on the same horizontal as the enemy unit and the wall on that horizontal is completely destroyed.

Download