Current time: 22.11.2024, 21:51 Hello There, Guest! (LoginRegister)
Language: english | russian  

Post Reply 
Threaded Mode | Linear Mode
Ошибки, баги и недочёты ERA
» crash logs / errors / bugs of era
Author Message
Archer30 Offline
Moderators

Posts: 1175
Post: #841

But useful garbage? As I understand, it is part of the seed still?


Latest ERA mods and scripts in development - My GitHub
29.08.2024 16:15
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16657
Post: #842

No, garbage means not useful. Era does not use C native PRNG state and the address original code used. So garbage is garbage ) And you don't need it at all. You want VR:T, something not predictable on reloading. Exactly the case. Just be sure, that this event will not influence multiplayer.


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
29.08.2024 20:02
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1175
Post: #843

Berserker, no, I want it reproducible (possible to repeat result with Save & Load)
Check out the report, with a video. The issue we experience here without seed management is that every random specialty generated after a hero's defeat is the same when you spam battles (initiate the battle, defeat, recruit a new hero in the tavern and repeat) in the same location.

According to you, what I did is that I fetch garbage and set seed. However, for some reason, this satisfies what I need:
- When you spam battles in the same location, you get different specialties every time
- These results are reproducible when you Save & Load before the first battle you spam

VR:T doesn't have the second feature of my method.


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 30.08.2024 02:16 by Archer30.)
30.08.2024 00:56
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16657
Post: #844

I still do not understand the source of the issue. Better enable random generator tracking in heroes3.ini (console mode) or insert VR:R checks in onafterbattle. The solution seems to be "hacky" and "lucky". Normally VR:R shout be random in OnAfterBattleUniversal. We should report it as bug it it's not so.

For deterministic but quite random results you can use coordinates, current day and attacking hero ID and attacking hero move points to generate seed and then use it in script.



Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
30.08.2024 16:25
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1175
Post: #845

I have something working at the moment so I won't complain, we can leave it later Rolleyes

Critical issue: Interaction between !!EA (use on negative stack id) and Battle Replay

This is a critical issue in scripting that if a stack is set with !!EA and kill and transform into another stack, its stats will remain the ones after its transformation after battle replay.

Ok I understand this doesn't sound understandable. Let me show you my testing script:

And my testing video

In this video, I used raw ERA + GEM (for battle replay) + my testing script (see above). I picked a random fight and ran my script.

As you can see in the video,
- The gnoll had a standard HP stats initially
- It got killed with script, with (MON_FLAG_SUMMONED) added
- An Azure Dragon was summoned, due to the vacancy left by the Gnoll, it occupied the killed Gnoll's stack Id
- Set any !!EA on the summoned Azure Dragon
- Killed the Azure and Summoned again (optional)
- Ended the battle and replayed
- Found the Gnolls had 1000 HP

My guess is that !!EA for stack id has some cache that needs to be reset on Battle Replay. However, I don't know where to find them. I don't know how to fix.

Currently, the mechanism corrupts "Metamorph" script's behaviour.


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 05.09.2024 04:08 by Archer30.)
04.09.2024 08:14
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16657
Post: #846

Archer30, thanks for perfect detailed bug report. Seems like BattleReplay does not call CrExpoSet::StartAllBF(G2B_MArrA,G2B_MArrD) on replay.
It's inside Monsters.cpp (function G2B_Prepare)


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
04.09.2024 21:23
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1175
Post: #847

Berserker, I've got the temporary solution thanks!

I want to know that when you restart ERA and launch the code above, does your speaker makes some funny noise when the stack is killed by pressing "K"? It happens to me and I don't know what to do except for temporarily setting the volume of H3 to 0. Like

____

Btw, any chance of releasing 3.9.16 in the near future?


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 14.09.2024 14:37 by Archer30.)
14.09.2024 12:10
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1175
Post: #848

Quote:Berserker, I've got the temporary solution thanks!
!?FU(OnBeforeBattleReplay);
!!SN:E7500058/(CALLCONV_CDECL)/42229972/42149936;

This is incorrect. The "solution" leads to a crash on battle replay. A new solution is still being researched....


Latest ERA mods and scripts in development - My GitHub
14.10.2024 21:26
Find all posts by this user Quote this message in a reply
XEPOMAHT Offline
Moderators

Posts: 2356
Post: #849

(14.10.2024 21:26)Archer30 Wrote:  
Quote:Berserker, I've got the temporary solution thanks!
!?FU(OnBeforeBattleReplay);
!!SN:E7500058/(CALLCONV_CDECL)/42229972/42149936;

This is incorrect. The "solution" leads to a crash on battle replay. A new solution is still being researched....

1. Содержимое переменных для начала стоит извлечь, т.к. на функцию подаётся их содержимое, а не адреса.
2. При рестарте битвы адреса структур атакующих и защищающихся армий надёжнее всего брать из структуры баттлменеджера, т.к. при перезагрузке менеджера данные тоже перезагружаются в памяти, при этом содержимое воговских переменных может устареть и не соотвестствовать действительности.
15.10.2024 10:35
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1175
Post: #850

XEPOMAHT, thanks, so
Looks good?

I assume igrik has put correct attacking/defending heroes' pointers into the 2 addresses (28460D4 and 2832830) upon battle replay.


Latest ERA mods and scripts in development - My GitHub
22.10.2024 02:02
Find all posts by this user Quote this message in a reply
XEPOMAHT Offline
Moderators

Posts: 2356
Post: #851

(22.10.2024 02:02)Archer30 Wrote:  I assume igrik has put correct attacking/defending heroes' pointers into the 2 addresses (28460D4 and 2832830) upon battle replay.

Туда подаются стартовые армии, вне зависимости, пренадлежат они герою или нет. Получать адреса стартовых армий надёжнее всего из менеджера битвы:

Code:
+54C4  dd -> монстры, если нет первого героя
+54C8  dd -> монстры, если нет второго героя

Сама структура менеджера битвы хранится в 699420h.
(This post was last modified: 22.10.2024 05:57 by XEPOMAHT.)
22.10.2024 05:54
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1175
Post: #852

So the safest way would be
Thanks, XEPOMAHT.


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 13.11.2024 05:22 by Archer30.)
22.10.2024 15:00
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16657
Post: #853

Archer30, does it fix the issue?


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
22.10.2024 16:42
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1175
Post: #854

It does


Latest ERA mods and scripts in development - My GitHub
22.10.2024 17:29
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1175
Post: #855

(22.10.2024 15:00)Archer30 Wrote:  So the safest way would be
Thanks, XEPOMAHT.

Updated. It is required to check i^battle_isVisible^.
A battle replay after quick combat corrupts stack exp data with this script. Checking i^battle_isVisible^ (making sure the battle was visible) avoids this situation.
Alternatively, you can use !?FU(OnBattleReplay). But I suspect we need to fix stack exp data at an earlier timing like !?FU(OnBeforeBattleReplay) so scripters can do their jobs with ease.


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 13.11.2024 05:29 by Archer30.)
13.11.2024 05:28
Find all posts by this user Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Forum Jump:

Powered by MyBB Copyright © 2002-2024 MyBB Group