Skip to content

Posts from Round table

5.0 (2 ratings)
In reply to Iamsamstan
User Avatar
Auto-translated
I sometimes read threads about offline Tournaments on HP, mostly to improve my knowledge of the game mechanics; the guys occasionally find some very non-obvious things.

Disconnects are not uncommon in online play, and sometimes upon repeating a turn transfer, the computer moves differently than it did initially. Here is a compilation of posts from a discussion among offline players on this matter:

handbookhmm.ru/1-moral-luck-ppb
Although the article was written for Heroes 1, as far as I know, the PRNG in 2 differs only by re-initialization at the start of battle depending on the armies, and in 3, dependency on in-battle animation was also added; otherwise, it's the same. As can be guessed from the posts above, I admit there might be other differences, but...

R is a pseudo-random number used for the needs of algorithms responsible for "random" events in the game (including the roll for morale and luck).

The current value of R is a four-byte value (double word, DWORD) stored in RAM at the moment the check begins.

This number generates a sequence of pseudo-random numbers according to a known algorithm, so knowing the current (or initial) value of R is enough to calculate any other.

During the check itself, a new pseudo-random number is generated, which is then used to determine the result of the check. Schematically, it looks like this: R[0] or Seed -> R[1] -> R[2] -> ... The Seed value initializes the PRNG (it may depend, for example, on the current time; it is generated during game launch, which is why restarting is so useful in many cases). Every game event requiring a die roll takes the value remaining from the previous generation as the Seed, but uses a new one obtained from the previous one via a special algorithm. An exception* is the level-up, where the previous random number is the value of a function whose arguments are the hero's level and the number of their skill tree.

The level increases identically on all machines, so if a save is loaded immediately after gaining a level, there should be no differences. However, if the player enters a town and opens the fort window or looks at the stats of some unit in their army, the value of R will change (in the creature animation cycle).

Some other events do not use the previous random value as a "starter." For example, the Seed for each battle is calculated separately and is not a random number, as the splitting of neutrals into stacks, the appearance of a upgraded stack, and the generation of obstacles on the battlefield are also not random (they depend on the coordinates of the tile where the battle takes place). By the way, this is exactly why a timer/stopwatch can be used to "catch" morale and luck.

Whether this function uses the global PRNG can be checked, for example, as follows. Before each load of the save considered in this thread, first load another, pre-prepared save (dummy), where some hero takes an experience chest and increases their level. Now load the actual tournament save and transfer the turn. Record the result and repeat the described procedure several times. Between loading the dummy save and transferring the turn in the tournament save, do not exit the game, do not open the fort window or the unit information window, and do not change the game volume settings. Now try loading some other dummy save, dummy1, instead of the dummy save, in which a different hero increases their level. Sooner or later, you should find such a dummyN save after loading which the computer hero will always attack, and anyone can repeat this on any machine.

And how many different unique numbers for the seed can be generated via level-up?

Good question. We need to calculate how many different values the following function can take:
R(Level, TreeNo) = (343FDh * Level + 26497h * TreeNo + 259DFh) * 343FDh + 269EC3h
Moreover, overflow is possible here, so it is necessary to add and 0FFFFFFFFh at the end.

The order is not difficult to determine. Since TreeNo, as I understand from the description, is fixed for each specific hero, the function can take only 75 values (this is how many times a hero's level can be correctly increased, according to FizMiG).

75 must be multiplied by 255, since on the "left" save, absolutely any hero can be chosen to gain a level. Total: 75 * 255 = 19125.

Added after 6 minutes
I see a difficulty for online play here: when loading a save, a new random number is generated at least once — when choosing the monster whose animation will accompany the load. I don't know if this disrupts the PRNG settings and I don't know if it is regenerated during the animation process (like with units on the map).

Also, one could ask Baratorch to implement the seed selection for the computer's turn to be independent of R, as it is for the level-up. For example, link it to the game day number; then repeating the turn (with exact army preservation) would result in a deterministic computer move.
User Avatar
Auto-translated
I didn’t understand a thing, except for one. Ever since the beginning of 2014, something has already been tweaked regarding battles. Because even to you, Vikk, I wrote about a normal tactic for taking the Griffin Conservatory 3 with Conflux back in the TDD tournament. Now it doesn’t work at all, no matter how many times I tried — the first stack of griffins always flies somewhere else. Whatever, the losses change from decent to minus 3–4 psychs or 1 bird, but that’s not the point — the behavior algorithm of neutrals has changed, and that’s not good. Now they might even outright refuse to hit a sacrificed single unit, and instead charge at the main stack, hoping for a morale proc.
Ася 390383586

Осень-Зима 2013-14.
In reply to Vatya
User Avatar
Auto-translated
Today, while playing against Maretti, I encountered this for the first time when trying to connect.
The connection is through TV.
Has anyone encountered this before, and how can I remove it?

In reply to Redwhait
User Avatar
Auto-translated
If there’s a question mark at the end, it means it’s some kind of cheat.


In reply to Redwhait
User Avatar
Auto-translated
Redwhait HP
Today, while playing against Maretti, I encountered this issue for the first time when trying to connect.
The connection was through TV.
Has anyone encountered this before, and how can it be resolved?

The other day, Jurist was playing with a Danish player and experienced the same problem. It was resolved by changing the host – Jurist created the game. I think I remember that Tvaryna also couldn't connect with him before, and it was mutual. It even led to system reboots.
User Avatar
Auto-translated
It's his firewall causing the issue; I've encountered this when playing with him.
http://www.twitch.tv/mikevalentine/
User Avatar
Auto-translated
It’s interesting to see how people’s priorities regarding castles have changed from the beginning to the current state of the game. For me, two castles from the top of the list have moved to the bottom.
Ася 390383586

Осень-Зима 2013-14.
User Avatar
Auto-translated
Today, I tried playing on someone else's computer, and I still couldn't connect, either through TV or Hamachi. If I create the game, the same error occurs, but if he creates it, it just says that my IP address couldn't be found. He's running Windows 8, and I disabled the firewall and antivirus. We're using the Heroes version from Rutracker, uploaded by JustObserver. What other possible causes could there be for these errors?
В этом мире есть только две действительно бесконечные вещи - вселенная и глупость, при чем на счет первой я не уверен...©
icq 667277468
In reply to SP_SkyLine
Auto-translated
SP_SkyLine
Today I tried playing on someone else's computer, and I still couldn't connect, neither through TV nor through Hamachi. If I create the game, the same error occurs, but if he creates it, it just says that my IP address wasn't found. He has Windows 8, and I disabled the firewall and antivirus. The Heroes version is from Rutracker, uploaded by JustObserver. What other possible causes could there be for these errors?
Try setting compatibility mode to XP SP2 on HDMI.
Когда рестартов не осталось, обязательно ждите Гурниссона без балисты:D

Комплимент который сделал мой день:
Катя ЭПИК барышня) вы бы видели как пялились на её сиськи молодёж) я та с девушкой был) но всё равно пялился ) потому что хорошие) (с) Browser

Слабая раздача, которую заиграл исключительно из-за колпака на 111. (с) Сатир

In reply to aka.Ward3n
User Avatar
Auto-translated
On September 14, 2014, a similar error occurred in Hamachi: "Unknown error." As a result, a connection could not be established. This is the first time I've encountered such a problem. Updating the Hamachi version didn't help. :confused:
User Avatar
Auto-translated
Hey everyone, I wanted to bring up a couple of points:

1. I recently watched a stream, and it was a two-sided one. I was concerned by the fact that people were giving advice like "don't go there, go here," "hey, you forgot to transfer artifacts," and reminding them whether they bought units on the outside. But that's not a big deal in principle... However, when I saw that they were writing to the opponent in a chat, "don't even think about rushing the main hero," it became a bit uncomfortable. In that specific situation, it was all just "blowing smoke," but who can guarantee that this advice was simply a gesture of goodwill and friendly help, and not an analysis of the real situation on the other side of the connection?
I've caught myself rushing a couple of times and it worked out well, but here an "guardian angel" is watching over :)

2. According to the rules, how should we handle this situation:
We're playing against an opponent with a chess timer. We decided to save the game. We recorded the timers. How can we restore them to their previous values when loading the game? Because, as Togana's game against Maretti yesterday showed, the timer is POWER! :)
"Одержать сто побед в ста битвах — это не вершина воинского искусства. Повергнуть врага без сражения — вот вершина.
"Сущность войны — обман. Искусный должен изображать неумелость. При готовности атаковать демонстрируй подчинение. Когда ты близок — кажись далёким, но когда ты очень далеко — притворись, будто ты рядом."
In reply to Rabe
User Avatar
Auto-translated
Rabe
We've recorded the timers. How can we revert them to their previous values when loading a game?
The player loading the game should wait for the amount of time added to the turn (e.g., 8 minutes if the game is played with n+8+1) and then pass the turn.
Нам это идеально подойдёт! (с)

"Совесть - она либо есть, либо её нет" (с) RedWhait HP
In reply to MerlinTheMagician
User Avatar
Auto-translated
MerlinTheMagician
Whoever is loading should wait for the amount of time added to the turn (e.g., 8 minutes if the game is played with n+8+1) and then pass the turn.
Pff, Dirty and I waited 24 minutes after loading a save:smile04:
I think the solution is to save at the beginning of the turn, as chess adds the amount of time for the previous turn.
In reply to Redwhait
User Avatar
Auto-translated
Redwhait HP
Pff, Dirty and I waited 24 minutes after loading the save:smile04:
I think the solution is to save at the beginning of the turn, because the chess timer adds time based on the previous turn.
Okay, I guess I don't fully understand the timer mechanic...
If hypothetically: I have 1:15:27, and my opponent has 28:15. We saved as usual at the end of the turn. The chess timer is 20+10+1. What will happen when we load the save?
"Одержать сто побед в ста битвах — это не вершина воинского искусства. Повергнуть врага без сражения — вот вершина.
"Сущность войны — обман. Искусный должен изображать неумелость. При готовности атаковать демонстрируй подчинение. Когда ты близок — кажись далёким, но когда ты очень далеко — притворись, будто ты рядом."
In reply to Rabe
User Avatar
Auto-translated
Rabe
Okay, I guess I don't fully understand the timer mechanic...
If hypothetically: I have 1:15:27, and my opponent has 28:15. We saved the game as usual at the end of the turn. The chess timer is 20+10+1. What will happen when we load the game?
The chess timer will add the amount of time you spent making your moves.
If you spent an hour, it will add an hour; if you spent a minute, it will add a minute.

Statistics

Welcome our newest member: Emil