pcsx2 icon indicating copy to clipboard operation
pcsx2 copied to clipboard

King of Fighters 98 Ultimate Match and 2002 Unlimited Match Tougeki Version 3D background issue

Open IAMNOTRANA opened this issue 5 years ago • 41 comments

PCSX2 version: v1.6.0

PCSX2 options: Running on safest preset and still get weird glitch fest 3D background

Plugins used: D3D 11 Default setting with no hardware hack enabled

Description of the issue: KOF 98 UM and 2002 UM both game face issue with 3D background no matter what setting you use.

Here's some comparison of 2002 UM Tougeki Version (J) to actual PS2 machine

image

KOF 98 UM (USA) also suffer from same problems but only with 3D background (you've to turn on 3D background from option and by default game runs on 3D instead of 2D background)

How to reproduce the issue: KOF 2002 UM Tougeki Version (J Boot up game > go practice > pick greece map and start. You can compare this with screenshot.

KOF 98 UM (USA) Just boot up the game with any setting. (literally anything) then go option > graphic setting > set background to 3D (by default it should be 3D) go practice mode and pick china 1-3 to see obvious shadow glitching and hills missing parts

Last known version to work: uh I tried googling and it seems like this problem exist since bloody 2015 lol but never fixed.

PC specifications: Laptop i5 7200U GTX 940mx 4gb 8GB ram

IAMNOTRANA avatar Jun 25 '20 12:06 IAMNOTRANA

Is the issue present on latest dev build too?

lightningterror avatar Jun 25 '20 12:06 lightningterror

Screenshot only works if you copy it in discord. I reuploaded it. image

RedDevilus avatar Jun 25 '20 12:06 RedDevilus

You can add King of Fighters '94 Rebout to this list too, and IIRC the 3D backgrounds in KoF XI, though admittedly I haven't tested it lately. Some of the backgrounds in Rebout are a complete mess, and the health bar appears to have a priority problem.

https://forums.pcsx2.net/Thread-Bug-Report-The-King-of-Fighters-94-Re-Bout-NTSC-J?highlight=king+of+fighters

Silanda avatar Jun 25 '20 13:06 Silanda

Is the issue present on latest dev build too?

Yeah I checked. Glitch is also present in dev build

Screenshot only works if you copy it in discord. I reuploaded it.

Thank you. I've updated the main thread.

You can add King of Fighters '94 Rebout to this list too, and IIRC the 3D backgrounds in KoF XI, though admittedly I haven't tested it lately. Some of the backgrounds in Rebout are a complete mess, and the health bar appears to have a priority problem.

https://forums.pcsx2.net/Thread-Bug-Report-The-King-of-Fighters-94-Re-Bout-NTSC-J?highlight=king+of+fighters

I guess all King of Fighters games are buggy mess. Bit sad cuz those 3D background were fully removed from future release of KoF 98 and 2002 UM, while XI never was released for PC. PS2 version remain definitive version but buggy.

IAMNOTRANA avatar Jun 27 '20 13:06 IAMNOTRANA

Yes there are problems with textures on 3D with those games.

KOF XI option menu also has this problem.

Immersion95 avatar Jul 01 '20 14:07 Immersion95

Yes there are problems with textures on 3D with those games.

KOF XI option menu also has this problem.

Just wanted to add that this is not an hardware rendering issue. It is present in the software renderer which should be accurate. I'm specifying as it wasn't clear in the title.

Immersion95 avatar Jan 03 '21 08:01 Immersion95

Yes, this is also an issue on Dobiestation, not sure on the cause right now.

refractionpcsx2 avatar Jan 03 '21 08:01 refractionpcsx2

Yes, this is also an issue on Dobiestation, not sure on the cause right now.

:(

I suppose that you guys already have it but i can send gs dumps if needed ?

Immersion95 avatar Jan 03 '21 08:01 Immersion95

I don't think it's a GS issue, but I'm not sure. I mean you could provide one if you want, I'm not sure how much it will help though, i guess we can see if the geometry exists on the GS side at least.

refractionpcsx2 avatar Jan 03 '21 08:01 refractionpcsx2

This is a GS Dump for 94 Rebout, which IMO exhibits this issue the most severely out of all the affected games (though not in this dump necessarily). It also displays the priority issue this game has with the health bar though I'm not sure if that's related (the circles on the ends of the bars are supposed to be behind the character portraits, not in front).

KoF94BadBackground.gs.zip

gsdx_20210103134602

As you can see, there's something with a little resemblance to severe Z-fighting where buildings in the background overlap and join to others. I also found this youtube video which appears to have been captured from real hardware. The pictured stage is shown around the 9 minute mark: https://www.youtube.com/watch?v=eIb7zRFCyYM

Silanda avatar Jan 03 '21 14:01 Silanda

The geometry is there: 006363

tadanokojin avatar Jan 03 '21 15:01 tadanokojin

So this game is a bit odd (at least for the dump provided by @Silanda). They only use 8 bits of a 32 bit depth buffer.

In the upper 16 bits they write 0xFFFF and in the lower 8 bits they write 0. They use the upper 8 bits of the lower 16 bits for the actual depth information. The error seems to be about a difference of 1 for the actual depth value which is causing some pixels to fail. I can sort it by forcing the depth test from >= to >.

Has anyone tried rounding/clamping settings?

tadanokojin avatar Jan 03 '21 16:01 tadanokojin

I've tried messing with the rounding/clamping settings but I'm not seeing much difference (if any) unless the settings have to be changed before the stage loads. That's something I haven't tested.

Silanda avatar Jan 03 '21 16:01 Silanda

So this game is a bit odd (at least for the dump provided by @Silanda). They only use 8 bits of a 32 bit depth buffer.

In the upper 16 bits they write 0xFFFF and in the lower 8 bits they write 0. They use the upper 8 bits of the lower 16 bits for the actual depth information. The error seems to be about a difference of 1 for the actual depth value which is causing some pixels to fail. I can sort it by forcing the depth test from >= to >.

Has anyone tried rounding/clamping settings?

Tried every possible combinaison to no avail.

Immersion95 avatar Jan 03 '21 17:01 Immersion95

Okay, I have an idea what it might be. Problem is I'm not sure I can fix it without making the sw renderer slower.

tadanokojin avatar Jan 04 '21 08:01 tadanokojin

Okay, I have an idea what it might be. Problem is I'm not sure I can fix it without making the sw renderer slower.

Thanks a lot, what you do is voodoo to me :p.

What would be the impact on SW renderer ? It currently is very fast with 2 extra threads (default settings), would it impact every games or only these KOF games ?

Immersion95 avatar Jan 04 '21 10:01 Immersion95

What would be the impact on SW renderer ? It currently is very fast with 2 extra threads (default settings), would it impact every games or only these KOF games ?

It's one of those things I can't really give a definitive answer on without actually trying it and profiling it. Potentially the impact is small and we have greater accuracy across the board or potentially impact is significant and we add an option to the SW renderer.

There is another (not KoF) game that has this same issue and fixing KoF will improve that. Originally we were going to take a something of a shortcut for that game but given it won't improve KoF I think it's better to go for the solution that will fix both.

In any case I think it will be some time yet before the bug can be addressed. It requires some big changes to the SW renderer and it might be a good idea to wait for x64 SW renderer on Windows. I don't have any ideas for the HW renderer at this time.

tadanokojin avatar Jan 06 '21 12:01 tadanokojin

HW is a big no. The GPU depth unit is float.

gregory38 avatar Jan 06 '21 13:01 gregory38

Thanks a lot for your help @tadanokojin !

Accuracy is an important aspect of emulation for me and solving this issue would help me get rid of my noisy PS2 as it's the only remaining issue affecting the SW renderer in PS2 fighting games.

I do think that PCSX2 doesn't get enough credit regarding its accuracy state, I would say that it is 99% there.

Immersion95 avatar Jan 06 '21 13:01 Immersion95

So this game is a bit odd (at least for the dump provided by @Silanda). They only use 8 bits of a 32 bit depth buffer.

In the upper 16 bits they write 0xFFFF and in the lower 8 bits they write 0. They use the upper 8 bits of the lower 16 bits for the actual depth information. The error seems to be about a difference of 1 for the actual depth value which is causing some pixels to fail. I can sort it by forcing the depth test from >= to >.

Has anyone tried rounding/clamping settings?

This seems to be some emulation bug, bad mask or something. Because i found where they send packets (i think), and lower 8 bits of lower 16 bits are not 0 when they send it. It looks like something is masked at some point accidentally, or something like that. Nowy Obraz JPEG (16)

I patched game just to make sure i'm looking at correct packets, and this seems to be it. (patched upper 0xFFFF to 0x00FF on EE just for test). I can fix all KOF games like that, but it seems like some simple bug on GIF/GS side that i can't figure out. Nowy Obraz JPEG (12) Nowy Obraz JPEG (13)

ghost avatar Jan 27 '21 08:01 ghost

@kozarovv it's the depth, the reason it doesn't work on PCSX2 is because it loses precision because they are only using the lower 8 bits of the 32bit depth and we convert that to floats which are not precise enough.

It's possible your patch (which will be needed for all the KoF games I imagine) may be the only solution

refractionpcsx2 avatar Jan 27 '21 09:01 refractionpcsx2

My point is they send Z as 0xFFFFxxxx (look at my pic), but GS dump have 0xFFFFxx00 according to kojin. So until last byte is masked for FOG or something, this is wrong. This look like game expect that lower 16 bits will be used, not only upper 8 bits of lower 16 bits. But last bits are 0 when reach GS for some reason.

Edit: Like XYZ2F behavior is used instead of XYZ2, or something.

ghost avatar Jan 27 '21 09:01 ghost

That would make sense then, with XYZ2F, I believe depth is sent as 24bit, so they purposefully kill off the lower 8 bits.

Edit: Hmm no that would be the UPPER 8 bits...

Maybe if you appeared on Discord once in a while we could discuss this stuff ;)

refractionpcsx2 avatar Jan 27 '21 09:01 refractionpcsx2

The newest commits almost fix everything, there are still some missing NTSC-J games though. The US & PAL versions seem to be covered.

  1. KOF 2002 (not very obvious but still is affected like Stage D1)
  2. KOF 2003
  3. KOF '94 Re-Bout
  4. NeoGeo Battle Coliseum

The patch for KOF '94, The - Rebout [Special Pack] is there, a shameful copypasta with the correct CRC works for the standard edition :

SLPS-25449: name: "King of Fighters '94, The - Rebout" region: "NTSC-J" patches: E64F90E5: content: |- author=kozarovv // Fix for Depth precision. // Game fills upper 16bits of depth with 0xFFFF. // This results in a really high 32 bit value which is then converted to float // because both hw and sw renderers lack double precision the lower 16 bits of the initial 32 bit value lose precision. patch=1,EE,000ffc00,word,f88a0000 patch=1,EE,000ffc04,word,a080000b patch=1,EE,000ffc08,word,080836b3 patch=1,EE,0020dac4,word,0803ff00 patch=1,EE,0020dac8,word,4bea497d

Thanks a lot to @kozarovv !

Immersion95 avatar Feb 26 '21 09:02 Immersion95

Thanks for fixing this issue I am testing the other SNK games which have the same problems

KOF '94 Re-Bout (Backgrounds OK, health bar broken) KOF '98 Ultimate Match (Backgrounds OK but few textures have flickering problems) 98um2 98um1

KOF '99 Evolution (Backgrounds OK) KOF '02 (Backgrounds OK but some foreground elements appear behind the characters) [with OpenGL the menus disappear]

gsdx_20210310233847 KOF Neowave (same as '02 Backgrounds OK, foreground elements behind characters) nw1

KOF '02 Unlimited Match (Backgrounds OK) KOF '03 (broken backgrounds) KOF XI (Backgrounds OK but very few textures have flickering problems) NeoGeo Battle Coliseum (Backgrounds OK)

ATRyoSakazaki avatar Mar 10 '21 23:03 ATRyoSakazaki

Can you specify what version/region of the game you are running ?

The patch doesn't exist for kof2003 (jap) for example.

Immersion95 avatar Mar 11 '21 07:03 Immersion95

sure: SLPS-25448 (Special Edition) name: "King of Fighters '94, The - Rebout" region: "NTSC-J"

sles-55280 name: "The King of Fighters '98 Ultimate Match" region: "PAL"

slps-25661 name: "The King of Fighters NESTS Collection" <This is the collection with KOF99 Region: "NTSC-J/C/K"

slus-20995 name: "The King of Fighters 2002" Region NTSC-U"

sles-53999 name: "The King of Fighters NeoWave" Region: "PAL"

slps-25983 (Tougeki Ver.) name: "The King of Fighters 2002: Unlimited Match" (Tougeki Ver.) Region: "NTSC-J/C/K"

sles-53382 name: "The King of Fighters 2003" Region: "PAL"

slus-21687 name: "The King of Fighters XI" Region: "NTSC-U"

slus-21708 name: "NeoGeo Battle Coliseum" Region: "NTSC-U"

ATRyoSakazaki avatar Mar 11 '21 13:03 ATRyoSakazaki

sure: SLPS-25448 (Special Edition) name: "King of Fighters '94, The - Rebout" region: "NTSC-J"

sles-55280 name: "The King of Fighters '98 Ultimate Match" region: "PAL"

slps-25661 name: "The King of Fighters NESTS Collection" <This is the collection with KOF99 Region: "NTSC-J/C/K"

slus-20995 name: "The King of Fighters 2002" Region NTSC-U"

sles-53999 name: "The King of Fighters NeoWave" Region: "PAL"

slps-25983 (Tougeki Ver.) name: "The King of Fighters 2002: Unlimited Match" (Tougeki Ver.) Region: "NTSC-J/C/K"

sles-53382 name: "The King of Fighters 2003" Region: "PAL"

slus-21687 name: "The King of Fighters XI" Region: "NTSC-U"

slus-21708 name: "NeoGeo Battle Coliseum" Region: "NTSC-U"

From the list that you gave, only KOF 2003 hasn't a patch, can you try with the latest PCSX2 build ?

I think the missing games from the patches are those at the moment :

  • KOF 2002 (JAP/PAL)
  • KOF 2003 (JAP/PAL)
  • NeoGeo Battle Coliseum (JAP)

Edit : Your comments are true, those games exhibits a lot of corruption

Immersion95 avatar Apr 11 '21 07:04 Immersion95

From the list that you gave, only KOF 2003 hasn't a patch, can you try with the latest PCSX2 build ?

I think the missing games from the patches are those at the moment :

* KOF 2002 (JAP) (not very obvious but still is affected like Stage D1)

* KOF 2003 (JAP/PAL)

* NeoGeo Battle Coliseum (JAP)

Yes, in the last build "v1.7.0-dev-1187-g6cc969a89" still broken gsdx_20210411233046 gsdx_20210411233330 gsdx_20210411233402

ATRyoSakazaki avatar Apr 11 '21 21:04 ATRyoSakazaki

Yes, as I said it's expected as Kof 2003 is from the 4 remaining Kof games that don't have a patch. Can you please try the other games from your list ?

Edit : You are correct

Immersion95 avatar Apr 12 '21 06:04 Immersion95