Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HRP in Sfall #43

Open
FakelsHub opened this issue Sep 17, 2020 · 57 comments
Open

HRP in Sfall #43

FakelsHub opened this issue Sep 17, 2020 · 57 comments
Labels
HRP Связаное с патчем высокого разрешения.
Milestone

Comments

@FakelsHub
Copy link
Collaborator

FakelsHub commented Sep 17, 2020

В связи с недоступностью исходных кодов HRP, и его частичного устаревания, необходимо полностью перенести функционал HRP (или его наиболее важные компоненты) в отдельный модуль в sfall, чтобы весь контроль над движком осуществлялся из одного контролируемого проекта.

При этом основная библиотека HRP может использоваться как доступ к некоторым особо большим функциям (как к экспортируемым).

@FakelsHub
Copy link
Collaborator Author

На сегодня 200 функций приобрели имена в дизассемблированном коде HRP, осталось разобрать 800.

Все же наверное это будет новый проект объеденный одном решении с sfall.
На выходе будет получатся две библиотеки ddraw.dll и новая f2_res.dll

@NovaRain
Copy link

It will be like recreate a new HRP from the disassembled code, except the new one depends on sfall instead of working standalone?

@FakelsHub
Copy link
Collaborator Author

Not from disassembled code, I just study what is done and how to repeat it.
Probably Yes, it will not work separately from sfall, simply because there will be no functions for creating a game window and other DirectX functions, only everything that is necessary to increase the map scale and other HRP capabilities.
Why run a game without sfall? there are a lot of bugs.

@burner1024
Copy link

Don't know if useful, but just in case - noticed some offsets in mapper's HRP: res_m2.ini.txt

@FakelsHub
Copy link
Collaborator Author

На данный момент осталось реализовать опции ALTERNATE_AMMO_METRE и NumPathNodes.
На этом интеграция будет считаться законченной.
Реализация HRP меню будет отложено (нужно будет подготовить новый интерфейс к нему).

At the moment, it remains to implement the 'ALTERNATE_AMMO_METRE' and `NumPathNodes' options.
At this point, the integration will be considered completed.
The implementation of the HRP menu will be postponed (will need to prepare a new art interface for it).

@NovaRain
Copy link

NovaRain commented Dec 8, 2021

Currently the main menu button text seems misaligned with the background.

@FakelsHub
Copy link
Collaborator Author

show an example.
There will be differences because the implementations are completely different.

@NovaRain
Copy link

NovaRain commented Dec 9, 2021

show an example. There will be differences because the implementations are completely different.

Here's the comparison. I use graphics mode 5 and 1280x720 for GraphicsWidth/Height and SCR_WIDTH/HEIGHT, and all main menu related options are default in ddraw.ini/f2_res.ini.

With the external HRP:
scr00000

With sfall built-in:
scr00001

@FakelsHub
Copy link
Collaborator Author

FakelsHub commented Dec 9, 2021

I'm fine with this, there is no shift.
what happened there?
scr00001

@NovaRain
Copy link

NovaRain commented Dec 9, 2021

I'm fine with this, there is no shift. what happened there?

Ah, I got it. In f2_res.ini HRP enables its USE_HIRES_IMAGES by default so MENU_BG_OFFSET_X/Y values have effect.
Disabling USE_HIRES_IMAGES and the menu position is now normal with sfall built-in.

EDIT: Oh, SCALE_BUTTONS_AND_TEXT_MENU also affects this.

@FakelsHub
Copy link
Collaborator Author

here with the English version
scr00000

@FakelsHub
Copy link
Collaborator Author

FakelsHub commented Dec 9, 2021

Ah, I got it. In f2_res.ini HRP enables its USE_HIRES_IMAGES by default so MENU_BG_OFFSET_X/Y values have effect.
Disabling USE_HIRES_IMAGES and the menu position is now normal with sfall built-in.

Show the settings
Everything should work the same without any disables.

@NovaRain
Copy link

NovaRain commented Dec 9, 2021

Show the settings

Well, it's due to I enabled SCALE_BUTTONS_AND_TEXT_MENU.

[MAINMENU]
MAIN_MENU_SIZE=1

USE_HIRES_IMAGES=1

; With default 0 it's OK, enabling both USE_HIRES_IMAGES and this will cause the shift
SCALE_BUTTONS_AND_TEXT_MENU=1

MENU_BG_OFFSET_X=-14
MENU_BG_OFFSET_Y=-4

@FakelsHub
Copy link
Collaborator Author

Well, it's due to I enabled SCALE_BUTTONS_AND_TEXT_MENU.

the last time I rewrote the main menu code, this option worked correctly. apparently something broke.

@FakelsHub
Copy link
Collaborator Author

I think it's time to merge the HRP integration branch with the main one. Only I forgot how to do it correctly :)

@NovaRain
Copy link

NovaRain commented Jan 5, 2022

Does the current DD7 mode still run slower than Mash's implementation? I didn't notice much difference on my Win7, but Lexx said the game run slow in DD7 with built-in HRP.

@FakelsHub
Copy link
Collaborator Author

On my W7 system, the built-in works faster in DX7/9 than mash modes since there is no some strange extra code/shit from mash.
mash 400fps VS 600 sfall (dx9).

@FakelsHub
Copy link
Collaborator Author

Let him show screenshots of fps hrp and sfall from the dev version.

@NovaRain
Copy link

NovaRain commented Jan 5, 2022

Isn't the FPS counter only available for DX9 mode?

@FakelsHub
Copy link
Collaborator Author

Oh, yeah.

The implementation of DX7 in the built-in sfall and mash is almost the same. except 8-bit mode.
You can also change the code and give it to him for tests.
remove all LOCK_WRITE_ONLY flags in DirectDraw.cpp

@NovaRain
Copy link

NovaRain commented Jan 5, 2022

Lexx said the "slower" isn't about the game itself (fps) but the speed of how fast interface opens and fades, etc. For example, opening the inventory takes like a second with DD7 mode on his Win10 system.

@NovaRain
Copy link

NovaRain commented Jan 6, 2022

Using both changes seems improving DD7 performance, at least the game only stutters on the first open for any game interfaces (inventory, pipboy, etc.) now.

@NovaRain
Copy link

NovaRain commented Jan 14, 2022

Just a thought. Maybe we could implement BARTER_PC_INV_DROP_FIX as a default UI fix in sfall, like other tweaks/fixes in InterfaceWindowPatch(), if the drop zone size/position is indeed incorrect?
Also the whole main menu is moved to the right side of the screen instead of on the center when MAIN_MENU_SIZE=0.

@FakelsHub
Copy link
Collaborator Author

FakelsHub commented Jan 14, 2022

MAIN_MENU_SIZE - fixed.

@FakelsHub
Copy link
Collaborator Author

BARTER_PC_INV_DROP_FIX
in fact, it is required to expand the drop zone to 80 pixels instead of 64, and also for the NPC side.

@burner1024
Copy link

anyone tested this on wine yet?

@FakelsHub
Copy link
Collaborator Author

Нет.

@burner1024
Copy link

ok, let me know when there's a build available for testing

@NovaRain
Copy link

ok, let me know when there's a build available for testing

There are already auto builds in Git Actions. Check the artifacts in them.

@burner1024
Copy link

burner1024 commented Jan 15, 2022

dev branch https://github.com/phobos2077/sfall ?

@NovaRain
Copy link

dev branch https://github.com/phobos2077/sfall ?

Yes, both master and develop have auto builds.
https://github.com/phobos2077/sfall/actions

@burner1024
Copy link

Should I delete all HRP data for this?

@NovaRain
Copy link

NovaRain commented Jan 15, 2022

Should I delete all HRP data for this?

No, by default sfall will offer to disable Mash's HRP in game exe for you. And the built-in HRP still requires f2_res.ini/dat files.

@burner1024
Copy link

OK, I disabled per suggestion:

nhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x11038fb5).
Register dump:
 CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
 EIP:11038fb5 ESP:0031f4ac EBP:0031f6a8 EFLAGS:00010246(  R- --  I  Z- -P- )
 EAX:00000000 EBX:00020001 ECX:01920ea8 EDX:ffffffff
 ESI:6ed6dbb0 EDI:110a4c11
Stack dump:
0x0031f4ac:  00000000 00000000 110a99d8 00000280
0x0031f4bc:  00000008 00020046 0000000c 00020046
0x0031f4cc:  00000001 00000500 00000320 0000003c
0x0031f4dc:  00000016 00000000 00000000 68500000
0x0031f4ec:  00000000 00000000 00000000 0031f520
0x0031f4fc:  68539000 00000000 00000000 0031f558
Backtrace:
=>0 0x11038fb5 EntryPoint+0xffffffff() in ddraw (0x0031f6a8)
  1 0x1103aa2b EntryPoint+0xffffffff() in ddraw (0x0031f6b4)
0x11038fb5 EntryPoint+0xffffffff in ddraw: movl	0x0(%eax),%ecx
Modules:
Module	Address			Debug info	Name (32 modules)
PE	  400000-  6f0000	Export          fallout2
PE	  6f0000-  b74000	Deferred        ole32
PE	 16d0000- 1917000	Deferred        msvcrt
PE	10000000-101ff000	Deferred        d3dx9_43
PE	11000000-110fe000	Export          ddraw
PE	61740000-61829000	Deferred        advapi32
PE	62b80000-62b8c000	Deferred        api-ms-win-core-localization-l1-2-1
PE	62fc0000-631f2000	Deferred        rpcrt4
PE	63480000-6349c000	Deferred        version
PE	63bc0000-63c02000	Deferred        shcore
PE	64a40000-64b5e000	Deferred        shlwapi
PE	67840000-6784e000	Deferred        psapi
PE	67c80000-67de9000	Deferred        d3d9
PE	682c0000-6844c000	Deferred        dsound
PE	68500000-6864b000	Deferred        combase
PE	6a040000-6a0a3000	Deferred        msacm32

@FakelsHub
Copy link
Collaborator Author

FakelsHub commented Jan 15, 2022

Проверяй на моей отладочной версии с PDB файлом.

@NovaRain
Copy link

Does the crash still happen if you set HiResMode=0 in [Main]? Just want to make sure it's related to built-in HRP.

@burner1024
Copy link

It doesn't.

Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x1107b60b).
Register dump:
 CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
 EIP:1107b60b ESP:0031f494 EBP:0031f6a8 EFLAGS:00010246(  R- --  I  Z- -P- )
 EAX:00000000 EBX:00020001 ECX:01a60e30 EDX:ffffffff
 ESI:6ed6dbb0 EDI:110c2e11
Stack dump:
0x0031f494:  00000000 00000000 110c9750 00000400
0x0031f4a4:  00000008 0002004a 68503c1e 00000500
0x0031f4b4:  00000320 0000003c 00000016 0031f4d8
0x0031f4c4:  0000000c 00000400 00000300 00000016
0x0031f4d4:  00000001 00000000 00000000 00000001
0x0031f4e4:  0002004a 00000000 00000000 00000000
Backtrace:
=>0 0x1107b60b sfall::ResetDevice+0x23b() [d:\a\sfall-extended\sfall-extended\sfall\modules\graphics.cpp:206] in ddraw (0x0031f6a8)
0x1107b60b sfall::ResetDevice+0x23b [d:\a\sfall-extended\sfall-extended\sfall\modules\graphics.cpp:206] in ddraw: movl	0x0(%eax),%ecx
Unable to access file 'd:\a\sfall-extended\sfall-extended\sfall\modules\graphics.cpp'
Modules:
Module	Address			Debug info	Name (32 modules)
PE	  400000-  6f0000	Deferred        fallout2
PE	  6f0000-  b74000	Deferred        ole32
PE	 1810000- 1a57000	Deferred        msvcrt
PE	10000000-101ff000	Deferred        d3dx9_43
PE	11000000-11125000	PDB             ddraw
PE	61740000-61829000	Deferred        advapi32
PE	62b80000-62b8c000	Deferred        api-ms-win-core-localization-l1-2-1
PE	62fc0000-631f2000	Deferred        rpcrt4
PE	63480000-6349c000	Deferred        version
PE	63bc0000-63c02000	Deferred        shcore
PE	64a40000-64b5e000	Deferred        shlwapi
PE	67840000-6784e000	Deferred        psapi
PE	67c80000-67de9000	Deferred        d3d9
PE	682c0000-6844c000	Deferred        dsound
PE	68500000-6864b000	Deferred        combase
PE	6a040000-6a0a3000	Deferred        msacm32
PE	6a400000-6a571000	Deferred        winmm
PE	6ac80000-6ac8b000	Deferred        api-ms-win-core-fibers-l1-1-1
PE	6bc00000-6bca1000	Deferred        sechost
PE	6bcc0000-6be9c000	Deferred        setupapi
PE	6c9c0000-6cf40000	Deferred        gdi32
PE	6de80000-6de8c000	Deferred        api-ms-win-core-synch-l1-2-0
PE	6ed00000-6f392000	Deferred        user32
PE	70b40000-70df3000	Deferred        ucrtbase
PE	71200000-71248000	Deferred        imm32
PE	7b000000-7b30c000	Deferred        kernelbase
PE	7b600000-7b928000	Deferred        kernel32
PE	7bc00000-7bedf000	Deferred        ntdll
PE	7c630000-7cf07000	Deferred        shell32
PE	7dcc0000-7dcc4000	Deferred        opengl32
PE	7de10000-7de14000	Deferred        wined3d
PE	7e340000-7e344000	Deferred        winex11

@FakelsHub
Copy link
Collaborator Author

FakelsHub commented Jan 16, 2022

Что? На русском пиши.
У тебя вообще работает режим sfall dx9 в wine? В других версиях.
В каком режиме ты обычно запускаешь игру dx7 или dx9 в hrp?

@FakelsHub
Copy link
Collaborator Author

У вас там в wine похоже отсутствует компилятор шейдеров, типа вот это: https://docs.microsoft.com/ru-ru/windows/win32/direct3dtools/fxc

@egornovivan
Copy link

У вас там в wine похоже отсутствует компилятор шейдеров, типа вот это: https://docs.microsoft.com/ru-ru/windows/win32/direct3dtools/fxc

А он там должен быть? Старый hrp и sfall вроде же работали на вайне без бубна

@FakelsHub
Copy link
Collaborator Author

FakelsHub commented Jan 16, 2022

В sfall dx9 ничего не менялось, я уже слышал где-то что lunix не имеет компилятора для HLSL шейдеров. (вроде какую-то фигную надо ставить).
HRP использует уже скопилированный шейдер.

@NovaRain
Copy link

NovaRain commented Jan 17, 2022

I tested the build in my Ubuntu 18.04 VM, and both DD7 and DX9 modes work normally.
Do you have d3dcompiler_43.dll installed in Wine?
scr

В sfall dx9 ничего не менялось, я уже слышал где-то что lunix не имеет компилятора для HLSL шейдеров. (вроде какую-то фигную надо ставить).

It's the same for Windows. If for some reason d3dcompiler_43.dll (HLSL compilation functions) is missing, the game will crash/hang at start.
https://walbourn.github.io/whats-up-with-d3dcompiler_xx-dll/
https://walbourn.github.io/hlsl-fxc-and-d3dcompile/

@burner1024
Copy link

I don't have compiler, but can install it if necessary.
Game now launches, with this message

Captura de pantalla de 2022-01-17 15-26-39

@NovaRain
Copy link

I don't have compiler, but can install it if necessary. Game now launches, with this message

Before today's commit, the game would just crash/hang at start if you're using sfall DX9 but don't have d3dcompiler_xx.dll installed. I've already updated the DLL requirement in the readme of 4.3.2, as the result from my earlier post in issue 411.

As for the warning message, it's expected for the current build. I'll include pre-compiled HLSL headers later so one shouldn't need d3dcompiler_xx.dll anymore (at least it works on Windows).

@FakelsHub
Copy link
Collaborator Author

I don't have compiler, but can install it if necessary. Game now launches, with this message

Captura de pantalla de 2022-01-17 15-26-39

У тебя без компилятора при игре с dx9 hrp, случайно не появляются какие-нибудь лог файлы с ошибкой, hrp создает лог с ошибкой, и переходит в режим сpu.

@burner1024
Copy link

Да вроде не появляются. Какое имя должно быть у файла?
Если нажать Accept то потом игра нормально запускается.

@FakelsHub
Copy link
Collaborator Author

FakelsHub commented Jan 17, 2022

Да вроде не появляются. Какое имя должно быть у файла?

а не попутал, в HRP тоже такое окошко с сообщением выскакивает.
просто NovaRain пишет что с пред компилированными шейдерами тоже требуется компилятор.
вобщем непонятная ситуация c этим.
вот попробуй с "предкомилированными".
ddraw.zip

@NovaRain
Copy link

I've already added the precompiled HLSL shader files to phobos build as well, now the new binary should work without d3dcompiler_xx.dll.

@burner1024
Copy link

With precompiled shaders, I get screwed colors in menu.
Captura de pantalla de 2022-01-17 16-13-10

@NovaRain
Copy link

NovaRain commented Jan 18, 2022

Weird, the colors are fine on my Ubuntu. I tried sfall DX9 mode 4-6 and DD7 fullscreen/windowed.
Which build you're using, and in what mode?

@burner1024
Copy link

I tried again on the latest develop, colors seem to be normal now.

@FakelsHub
Copy link
Collaborator Author

Нужно ли внутриигровое меню для настройки HRP?

@NovaRain
Copy link

NovaRain commented Jan 30, 2022

Нужно ли внутриигровое меню для настройки HRP?

Personally I don't think it's necessary. In the past it was a source of minor issues because some mods/repacks set sfall DX9 as the default, and people asked why they cannot change the graphics mode in the in-game menu (HRP disables it due to sfall DX9).
But now sfall has its own HRP, I guess that kind of conflict issues shouldn't be a problem anymore. I think it can be simply a recreation of the same setting menu so HRP's menu frm/text can be used directly (no need to make new one).

@Lexx2k
Copy link

Lexx2k commented Jan 30, 2022

Fuck the ingame menu. It's too stiff and tedious to edit in case there ever will be some new features. In worst case I'd be fine with a config.exe outside of the game, but generally I really don't mind just editing an .ini file ..

@egornovivan
Copy link

Предлагаю вообще вырезать все настройки из игры или оставить там только ванильные. Предлагаю избавиться от cfg файла и вынести все основные настройки в ddraw.ini, а все настройки влияющие на механику игры в sfall.ini. еще предлагаю добавить префиксы из Венгерской нотации к "ключам" в ini файлах

@FakelsHub
Copy link
Collaborator Author

@egornovivan
вобще непонял твое сообщение, ты сыграл какую-то венгерскую оперу?)))))) ты что там празднуешь...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HRP Связаное с патчем высокого разрешения.
Projects
None yet
Development

No branches or pull requests

5 participants