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

[SLUS-20318] King's Field: The Ancient City / IV Graphical Issues #3811

Closed
TheStolenBattenberg opened this issue Oct 10, 2020 · 20 comments · Fixed by #9938
Closed

[SLUS-20318] King's Field: The Ancient City / IV Graphical Issues #3811

TheStolenBattenberg opened this issue Oct 10, 2020 · 20 comments · Fixed by #9938
Assignees

Comments

@TheStolenBattenberg
Copy link

PCSX2 version: v1.7.0-dev-433

PCSX2 options: Safest Preset

Plugins used:
GSdx-AVX2:
OpenGL, Bilinear (Forced), Large Framebuffer, 3x Native, 16x, Scaled, Full (Slow), Partial (OpenGL), Full (Slow), Ultra (Ultra Slow) HW Hacks: Trilinear Filtering: Trilinear (Ultra/Slow)

LillyPad 0.12.1

Description of the issue:
This game has many graphical issues present on both hardware and software.

Z Fighting (Hardware):
Most areas of the game (You can see it on the door in the opening cinematic, and pretty much everywhere) have terrible Z Fighting. The game file format for maps actually does contain overlapping geometry where the ZFighting occurs, which I believe is used to blend textures into the terrain, but the issue isn't present on actual PS2 hardware.

No Volume in Lava (Hardware/Software):
Lava looked like it had volume on actual hardware, but with PCSX2 it seems like the volume is missing and the lava texture is simply put over what ever geometry is below it. This isn't so bad at the start (although a bit odd looking), but in later areas like the Refinery it looks quite bad.

Menu Background Texture Garbage (Hardware)
Sometimes when you open up the in game menu or use a save point, the background will be filled with part of VRAM instead of the game background or background image.

How to reproduce the issue:
These issues are always present during play, other than the menu background which happens randomly it seems.

Last known version to work:
N/A

PC specifications:
CPU: AMD Ryzen 1700, GPU: GTX 1070, MB: Some MSI one

@m-7761

This comment was marked as abuse.

@TheStolenBattenberg
Copy link
Author

TheStolenBattenberg commented Mar 19, 2022

As requested on discord, here is a full GS dump of an in game scene. A menu dump may be also needed for the garbage'd background and I can provide one if requested.

https://mega.nz/file/bXJkmI4a#D-bJnSmzB3FhS5xPXeCStzG704ZYbNfXxOAdrzoCA5w

@Desmondchaser27
Copy link

Desmondchaser27 commented May 26, 2022

@TheStolenBattenberg

Do you also experience the white bars in lava, water and the skybox/clouds on anything above native resolution? If not, how did you manage to fix these? I've tried everything I can think of from the available options in all menus. I even tried skip draw 1:1 and beyond up to like 50. I even upscaled, morphed textures and none of that worked. The only thing that mildly effects it for me is the "Align Sprite" which makes one of the lines flicker constantly. If you the pause the emulator and go frame by frame there is one frame every like 6 frames where that line disappears but then comes back. The other perpendicular line on these textures is unaffected by the change and remains. It seems clear to me that it's part of a vector or texture map border being enabled somehow, but I don't know how or why, as it's not actually a part of any of the textures themselves.

EDIT: Oh, and on your menu garbage thing, I'd like to add that either the PS2, the game or the emulator must be creating a texture out of the effect on the fly because periodically when the effect happens it will actually generate a new texture map for this same effect. This is evidenced if you use the "dump textures" option and watch the folder in a separate window, sorting the files by "date created". You'll watch as the same junk texture will be re-dumped under a new hash name every so often while roaming around. It's REALLY bizarre.

@TheStolenBattenberg
Copy link
Author

@Desmondchaser27
I do indeed experience the issue but the PCSX2 compatibility wiki already had it noted, so the information felt pointless to input again.

Over the past few months I actually found a fix for the whitelines, but it requires extensive modification to the game files and thus is impracticle for PCSX2. For any devs who might read this, the bug is caused by floating point values used for the scrolling textures. One adding a small increase in value to the scroll parameters in the map files fixes it.

The value(s) is only looked at by one subroutine, so I imagine someone more skilled with ps2 mips asm could make a patch pretty easily. The FPU scares me too much to look into it myself.

@Desmondchaser27
Copy link

@TheStolenBattenberg
Out of curiosity, who figured this out? Was it you personally? Or did someone else solve this?

@TheStolenBattenberg
Copy link
Author

@Desmondchaser27
I figured it out. I'm one of few working on modding/hacking these games.

@Desmondchaser27
Copy link

@TheStolenBattenberg
Oh, very nice. Yeah, I personally just working on texture mod/overrides. But there have been some issues for sure, as the game does duplicate dump textures for some reason sometimes.

@refractionpcsx2
Copy link
Member

Just a small update, the background in the pause screens works these days now, it will corrupt again if you go in to the settings and change the background to something else, wait a second, then change it back, as it will get ejected from the texture cache, but the GS Download which processes the background in the first place now works :)

@ZandigSlaytanic
Copy link

Just a small update, the background in the pause screens works these days now, it will corrupt again if you go in to the settings and change the background to something else, wait a second, then change it back, as it will get ejected from the texture cache, but the GS Download which processes the background in the first place now works :)

Confirmed. Indeed it does, just checked it out. Thanks for the heads up.

@5PETSNAZ
Copy link

Screenshot 2023-08-21 033925

these settings helped with the white lines on the sky

@Desmondchaser27
Copy link

Desmondchaser27 commented Aug 20, 2023

Screenshot 2023-08-21 033925

these settings helped with the white lines on the sky

Are you referring specifically to "Preload Frame Data" or which ones here?
I ended up working with @TheStolenBattenberg and some people on their discord server at one point to attempt to alleviate the problems and we ended up creating this hack to fix MOST of the issues. It still leaves the one lava pool in the beginning of the game with white lines, but resolves the rest (in the sky and the water, for example). Not sure what's going on with the opening game's left lava pool that makes it so hard to fix, though.
"36E02E91.pnach" (filename)
(Internals of file):
gametitle=King's Field IV - The Ancient City (NTSC-U) //Fix White Bars On Scrolling Textures patch=1,EE,2011765C,extended,0810E5E8 patch=1,EE,20117660,extended,00003825 patch=1,EE,204397A0,extended,AFA20044 patch=1,EE,204397A4,extended,8C63003C patch=1,EE,204397A8,extended,3404000C patch=1,EE,204397AC,extended,3C1B3F81 patch=1,EE,204397B0,extended,377BB000 patch=1,EE,204397B4,extended,34180082 patch=1,EE,204397B8,extended,AC7B000C patch=1,EE,204397BC,extended,A4780014 patch=1,EE,204397C0,extended,3C1B3F81 patch=1,EE,204397C4,extended,377BB000 patch=1,EE,204397C8,extended,A4780016 patch=1,EE,204397CC,extended,AC7B0010 patch=1,EE,204397D0,extended,24630028 patch=1,EE,204397D4,extended,341B0001 patch=1,EE,204397D8,extended,009B2022 patch=1,EE,204397DC,extended,1480FFF3 patch=1,EE,204397E0,extended,3C180038 patch=1,EE,204397E4,extended,3718A180 patch=1,EE,204397E8,extended,3C030038 patch=1,EE,204397EC,extended,3463CD20 patch=1,EE,204397F0,extended,341B0000 patch=1,EE,204397F4,extended,08045D99

@5PETSNAZ
Copy link

preload frame data , Cpu Sprite Render Size & Blended Sprites/Triangles are what fixed the sky, no idea bout lava though.

@refractionpcsx2
Copy link
Member

If the lava is wrong, it's a core problem, as replaying a GS dump of the pool on a PS2 looks identical to PCSX2

@5PETSNAZ
Copy link

Screenshot 2023-08-21 044245
are the "white lines" also supposed to appear here?

@5PETSNAZ
Copy link

I havent progressed far enough to reach any "lava specific area" to check.

@5PETSNAZ
Copy link

Screenshot 2023-08-21 044610
yes, disabling CPU Sprite Render Size brings back the white lines

@5PETSNAZ
Copy link

Screenshot 2023-08-21 045012
Screenshot 2023-08-21 045035
Water (beneath the Starting Area's Shop ) also seems to be fixed

@refractionpcsx2
Copy link
Member

refractionpcsx2 commented Sep 9, 2023

Just FYI, the lava on PCSX2 is fine, this guy is playing on a PS2 and it looks identical (when using CPU Sprite so it doesn't have lines, that is) https://youtu.be/xQwYzEeMaiE?si=-b6S4VqxGnBdbGio&t=504

@TheStolenBattenberg
Copy link
Author

I don’t believe this should be closed yet - the Z fighting issues still haven’t been resolved.

@refractionpcsx2
Copy link
Member

refractionpcsx2 commented Sep 10, 2023

It potentially never will be, we're limited by 32bit depth on GPU's (which is 23 bits of precision, we need 32bits).

But this is a common problem in many games, and there is a meta for that #3692 you're welcome to mention it over there if it isn't already

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants