Yakuza Kiwami 2

Yakuza Kiwami 2

View Stats:
Kaldaien May 12, 2019 @ 4:40pm
[Special K] - ATTN: QLOC - Engine Is Broken - Fix Reference Counting
For users familiar with past Special K releases, I will refer you here:

I'll try and clean this up later in the week and properly address a number of issues, this game needs a lot of work and I just finished a LOT of work getting Special K v 0.10.x ready for release, so we'll see where things go from here. Hopefully I can knock both things out at the same time ;)

To QLOC: Urgent Engine Issue
Please stop releasing reference counts by looping down to 0 on D3D11 Textures, RenderTarget and DepthStencil Views. This problem has existed in every iteration of the PC port of these games since Yakuza 0.

    The correct way to handle reference counting so that you don't
    1. Crash the game


    2. Lockup the game
    is to acquire and release the same number of references. DO NOT release references to D3D11 objects that the engine didn't acquire. Other software holds references to D3D11 memory as well and if you erase references held by other things on Windows, you're going to cause spectacular software failure (crash, lockup, demons flying out of your nose[catb.org]).

      I suspect you did this to try and release references to all render target views when going into fullscreen mode, more than likely the reference being held that you couldn't understand is an implicit reference held by anything bound using ID3D11DeviceContext::PSSetShaderResources (...). Don't zero-out the reference count manually, just clear everything bound the pipeline state object.
Last edited by Kaldaien; Jul 1, 2019 @ 8:33am
< >
Showing 1-15 of 900 comments
Kaldaien May 12, 2019 @ 4:40pm 
Important Note to Users of this Mod (pre-MemFix Versions)
Do NOT play the arcade games, or limit yourself to one play per-game session.

Playing the same arcade game twice causes crashes because the engine has deleted memory that my shader cache owns. Unlike the other types of memory bugs, I have no easy way to disable Special K's shader cache, it is a fundamental part of Special K and it is absolutely bullet proof stability wise everywhere except for this game. I will not be re-engineering the thing to compensate for this engine so you will need to exercise caution with arcade games until QLOC / SEGA fixes things.

    Avoid arcade games and be suspicious if playing any minigame more than once causes the game to crash. That will be a repeatable event that you need to steer clear of until a patch is issued.
Last edited by Kaldaien; Jun 6, 2019 @ 12:21pm
Terry May 12, 2019 @ 4:48pm 
What are the main issues with the engine Kaldaien?
Kamamura May 12, 2019 @ 4:58pm 
"Threads for Dualshock 4 controllers that keep hogging the CPU resources even if you have not Dualshock controller..." - yep, seems like some stinky programming practices right there. Someone "spagettized" the code the "old school" way, and not in a good sense.

From player's standpoint, two things are the worst:
1) Wonky ragdoll physics tied to frame rate - I have lowered the framerate by enabling SSAA to work around this bug. Basically the higher the frame rate, the lighter and more floaty ragdolls are.
2) The horrible SSAO implementation that looks like dirt smeared over the image.
Aren May 12, 2019 @ 4:58pm 
Will try the HDR profile.

Thanks for being interested in fixing this game!
Kamamura May 12, 2019 @ 4:59pm 
Originally posted by Aren:
Will try the HDR profile.

Thanks for being interested in fixing this game!

Yep, thanks a ton, man! Your work in Sekiro was spectacular!
Johnnius May 12, 2019 @ 5:10pm 
Oh my god, thank you so much!
Kaldaien May 12, 2019 @ 5:11pm 
Originally posted by Terry:
What are the main issues with the engine Kaldaien?
I, don't even know where to start. I'm speechless. I've never seen a game ship with this much not release quality. And I've seen and helped NISA fix many ... NISA PC games :) This is ... there are no words for it.

It should be a fun little puzzle. But man, what the heck happened to QLOC? This is light years from the normal (mostly bug free) products they ship. If it really comes down to it, I'm willing to offer direct assistance to QLOC to get something passable out there for the customers. I'm not exaggerating here, this game didn't cook long enough in the code repository and needs to go back for a second try at life :P

From where I stand the issues are:

  1. Non-functional Z landscape pre-fill render pass to prime the depth buffer with pixel depth needed to quickly reject complicated pixel shaders that belong to objects in the scene that are not visible.
    • That's killing performance

  2. Horrible SSAO and temporal noise needs a ton of work, the game's difficult to look at right now.

  3. Gamepad code is a tad bit overenthusiastic about hot-plugging devices and is wasting CPU time.

  4. Engine is not managing Render Targets or Texture memory correctly and will lead to frequent hard to diagnose crashing

  5. There's some pointless anti-debug code that kills the game if you try to debug it to figure out why it's not working, or do advanced stuff using Cheat Engine --- I fixed that problem though :)
Roger-6 May 12, 2019 @ 5:12pm 
is it possible to disable the Depth of Field in this game? the DOF disappears in first person view but is fixed in third person
Aerothorn May 12, 2019 @ 5:22pm 
Subscribed so fast. I have also been shocked at the state of this, and I was definitely expecting a few release issues. Really want to play Kiwami 2 but I'm putting it on the back burner until this gets sorted one way or the other.
J May 12, 2019 @ 5:27pm 
Never trust someone that tells others there's no problems with the engine/game because "works on my machine".
Thanks for actually having the experience to delve deep into the game and factually prove that the issues really are there.
aight May 12, 2019 @ 5:32pm 
I never had issues with the previous games but this one seemed really weird even though I am still enjoying it, I'll do this when I have the time
Kamamura May 12, 2019 @ 5:54pm 
Kaldaien, tried your tool, some characters (including Kiryu) are missing head textures, see the screenshot below. It will need some more of that magic touch of yours.

¥XCaliber¥ May 12, 2019 @ 5:56pm 
This game definitely doesn't have the good optimization that 0 and Kiwami/1 had. My 1080Ti was processing over 100 FPS at 4K on those games, the frames were so high I needed to enable 2.25x super sampling just to stop screen tearing and stay at 60hz. With this port however...my card is struggling to maintain a full 60 in half of the areas of the game. Definitely not at 60 in Kamurocho and this is with shadows reduced to medium setting, AA completely off, and SSAO disabled. Kiwami 2's optimization is a total 180 from that of the first two games.
puppet74 May 12, 2019 @ 6:02pm 
im getting 70fps max settings at 1440p sometimes dips to 60. seems just fine ofc not as good as the last games but its a different engine. on a 1080ti as well.
Roger-6 May 12, 2019 @ 6:05pm 
getting 60+ fps on 1080p with a gtx 1070 and i5 8600 so it's not that bad
< >
Showing 1-15 of 900 comments
Per page: 15 30 50