Wake of Gods Forum | Форум Во Имя Богов

Full Version: Ошибки, баги и недочёты ERA
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Berserker, I don't think anything is working. Tried Magic Mirror and WoG commander block
Классические диалоги текстов с прокруткой разбивают текст на строки, каждая из которых отрисовывается отдельно. Соответственно, прокрутка идёт шагами построчно. Вот функция разбивки (0x4B58F0)

ApiJack.StdSplice(Ptr($4B58F0), @New_Font_TextToLines, ApiJack.CONV_THISCALL, 4);

Модуль Эры перехватывает её, очищает строки диалога и проводит свою разбивку с учётом тегов, выравниваний и изображений в тексте. Никакого отображения в левом верхнем углу не может быть в норме.

Собственно, вот все мои перехваты без учёта правки для китайского языка:

Code:
Core.Hook(@Hook_GetCharColor, Core.HOOKTYPE_BRIDGE, 8, Ptr($4B4F74));
Core.Hook(@Hook_BeginParseText, Core.HOOKTYPE_BRIDGE, 6, Ptr($4B5255));
Core.Hook(@Hook_CountNumTextLines, Core.HOOKTYPE_CALL, 5, Ptr($4B5275));
Core.Hook(@Hook_CountNumTextLines, Core.HOOKTYPE_CALL, 5, Ptr($4B52CA));
Core.Hook(@Hook_ScrollTextDlg_CreateLineTextItem, Core.HOOKTYPE_CALL, 5, Ptr($5BA547));
ApiJack.HookCode(Ptr($4B547B), @Hook_Font_DrawTextToPcx16_DetermineLineAlignment);
ApiJack.HookCode(Ptr($4B54EF), @Hook_Font_DrawTextToPcx16_End);
ApiJack.StdSplice(Ptr($4B5580), @New_Font_CountNumTextLines, ApiJack.CONV_THISCALL, 3);
ApiJack.StdSplice(Ptr($4B5680), @New_Font_GetLineWidth, ApiJack.CONV_THISCALL, 2);
ApiJack.StdSplice(Ptr($4B56F0), @New_Font_GetMaxLineWidth, ApiJack.CONV_THISCALL, 2);
ApiJack.StdSplice(Ptr($4B5770), @New_Font_GetMaxWordWidth, ApiJack.CONV_THISCALL, 2);
ApiJack.StdSplice(Ptr($4B57E0), @New_Font_GetTextWidthForBox, ApiJack.CONV_THISCALL, 3);
ApiJack.StdSplice(Ptr($4B58F0), @New_Font_TextToLines, ApiJack.CONV_THISCALL, 4);
// Fix TransformInputKey routine to allow entering "{" and "}"
Core.p.WriteDataPatch(Ptr($5BAFB5), ['EB08']);


Archer30, interesting. Is the issue preserved without HD mod?
Berserker, the issue persists in pure era without other components.
(07.02.2024 18:19)Berserker Wrote: [ -> ]Модуль Эры перехватывает её, очищает строки диалога и проводит свою разбивку с учётом тегов, выравниваний и изображений в тексте. Никакого отображения в левом верхнем углу не может быть в норме.

ЭРА+ вызывает функцию 5BA360h в конструкторе диалога при обработке текстовика с DL и больше ничего не делает. На саму функцию не подаются никакие тэги и флаги, т.е. весь текст всегда отрисовывается одинаково, там можно задать шрифт и цвет, больше ничего. По-умолчанию, текст там отрисовывается с выравниванием слева, а не по середине, соотвественно, вставки типа "{~>ZWOGlogo.def:0:0 block}" так же отрисовывают только слева, центрирование там не работает, по крайней мере на ЭРЕ+. 105

Пример:

Image: image.jpg
{~>ZWOGlogo.def:0:0 block align=center} пробовал?
(07.02.2024 21:20)Berserker Wrote: [ -> ]{~>ZWOGlogo.def:0:0 block align=center} пробовал?

Попробовал, безрезультатно. Так же рисуется только слева.
А {~>ZWOGlogo.def:0:0 align=center} + перевод строки?
(08.02.2024 00:34)Berserker Wrote: [ -> ]А {~>ZWOGlogo.def:0:0 align=center} + перевод строки?

Там с переводом строки и написано, иначе строчка начнётся прямо за def-ом.
Berserker, it is not about the cache.

005A9626 This triggers when the bug happens (meaning ERA tries to load a new def). But whatever SN:R sets, the def name preserves the last one used in the pervious battle.

!!SN:B works here
Так же при попытке отрисовки в диалогах несуществующих кадров из def, которые ставит ЭРА, вместо пропуска отрисовки движок ЭРЫ всё равно пытается что-то отрисовывать, подавая мусор на HD_WOG.dll, которая не выдерживает такой наглости и вылетает (т.к. Бараторч поставил проверки только на несуществующие def-ы, а на несуществующие спрайты у него проверок нет, поэтому наверное такая оплошность моддеров, добавляющих def-ы в диалоги, может ложиться на плечи Берсеркера).

Dens of Thieves generate on mismatched terrains

So this happens a lot to me and I decided to improve it.
Image: qtktsXS.png
There are 3 types of Dens of Thieves in ERA. Now the first two will be generated on any terrain except for Snow, and the snowy one will only be generated on Snow.

Download fixed zaobjts.txt

I believe there are other small mistakes in zaobjts.txt. Not sure what they are but Grossmaestro should have a full list Sm
FU(OnPreTownScreen) doesn't trigger in some of the cases switching between town screens

Not necessarily a bug, but this is inconvenient and confusing. FU(OnPreTownScreen), sounds like it would trigger before any town screen shows/updates, but not for the following cases:
- Teleporting from one inferno to another with Castle Gate (Infernoe building)
- Switching among owned towns on the town screen by pressing arrow keys on the keyboard

I use a hook @005C70E5 for the replacement of FU(OnPreTownScreen) and it seems to be fine so far, without the two issues mentioned here.
It seems, that switching between towns does not involve new dialog creation. Existing dialog is updated.
Maybe 005C70E5 should be added as some OnBeforeShowTownScreen event
Loading during a battle (HD mod feature) resets AI thinking radius value (UN:J4) to 4096

If you load a save game during combat, the AI thinking radius value is reset to 4096 after finishing loading the save game. This 4096 value even persists for the ERA instance - if you start a new game after this radius buggy, the thinking radius would still be 4096.

Exiting to the main menu during battle doesn't seem to have such a bug.

Tested with no mods except for HD mod and a script to check UN:J4 value.

The problem itself is fixable with patches. But I wonder why it would happen. Could there be anything else broken by this HD feature?
Seems like the number of bugs is big enough to not use this feature or disable the button for Era.
Reference URL's