Project

General

Profile

Actions

Emulator Issues #13356

closed

Mystery Case Files The Malgrave Incident - graphically glitched case book / journal

Added by bigbot89 10 months ago. Updated 8 months ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:
5.0-20186

Description

Game Name?

Mystery Case Files The Malgrave Incident

Game ID? (right click the game in the game list, Properties, Info tab)

SFIE01

MD5 Hash? (right click the game in the game list, Properties, Verify tab, Verify Integrity button)

8b16562e5496d53c8755b3bbf004394b

What's the problem? Describe what went wrong.

The journal in the game does not display text correctly. Text is offset to the right. The same text repeats for each journal page.
When setting SafeTextureCacheColorSamples to 0 or 128, the text completely disappears. SafeTextureCacheColorSamples = 512 is the only way to render half of the text.

What steps will reproduce the problem?

Just open the journal on the bottom left once some clues are added to it.

Is the issue present in the latest development version? For future reference, please also write down the version number of the latest development version.
Yes it is.
5.0-20126

Is the issue present in the latest stable version?

Yes. 5.0-19870

If the issue isn't present in the latest stable version, which is the first broken version? (You can find the first broken version by bisecting. Windows users can use the tool https://forums.dolphin-emu.org/Thread-green-notice-development-thread-unofficial-dolphin-bisection-tool-for-finding-broken-builds and anyone who is building Dolphin on their own can use git bisect.)

[First broken version number here (if applicable)]

If your issue is a graphical issue, please attach screenshots and record a three frame fifolog of the issue if possible. Screenshots showing what it is supposed to look like from either console or older builds of Dolphin will help too. For more information on how to use the fifoplayer, please check here: https://wiki.dolphin-emu.org/index.php?title=FifoPlayer

[Attach any fifologs if possible, write a description of fifologs and screenshots here to assist people unfamiliar with the game.]
![](Dolphin Emulator Screenshot 2023.09.18 - 13.40.10.07.png)
![](mcf-malgrave-journal-case book.PNG)

What are your PC specifications? (CPU, GPU, Operating System, more)

AMD Ryzen 5 5600X
Nvidia GTX 1650
Windows 10
16GB Ram
Dolphin v5.0-19870
wbfs file format

Is there anything else that can help developers narrow down the issue? (e.g. logs, screenshots,
configuration files, savefiles, savestates)

[Anything else here]


Files

Dolphin Emulator Screenshot 2023.09.18 - 13.40.10.07.png (2.02 MB) Dolphin Emulator Screenshot 2023.09.18 - 13.40.10.07.png Mystery Case Files Malgrave Incident Journal glitch bigbot89, 09/18/2023 06:55 PM
mcf-malgrave-journal-case book.PNG (2.27 MB) mcf-malgrave-journal-case book.PNG bigbot89, 09/18/2023 07:10 PM
SafeTextureCacheColorSamples 512.7z (1.33 MB) SafeTextureCacheColorSamples 512.7z 512 bigbot89, 09/19/2023 03:44 AM
SafeTextureCacheColorSamples 0.7z (1.47 MB) SafeTextureCacheColorSamples 0.7z 0 bigbot89, 09/19/2023 03:44 AM
mcf-malgrave-journal-case book no text.PNG (1.62 MB) mcf-malgrave-journal-case book no text.PNG SafeTextureCacheColorSamples to 0 or 128 bigbot89, 09/19/2023 03:48 AM
MCF-Malgrave_SafeTextureCacheColorSamples_0.mp4 (3.44 MB) MCF-Malgrave_SafeTextureCacheColorSamples_0.mp4 SafeTextureCacheColorSamples 0 bigbot89, 09/19/2023 04:53 PM
MCF-Malgrave_SafeTextureCacheColorSamples_512.mp4 (3.68 MB) MCF-Malgrave_SafeTextureCacheColorSamples_512.mp4 SafeTextureCacheColorSamples 512 bigbot89, 09/19/2023 04:53 PM
Actions #1

Updated by pokechu22 10 months ago

Can you attach two fifologs (one with SafeTextureCacheColorSamples = 0 and one with SafeTextureCacheColorSamples = 512) to this issue, please? It'd help with checking it. (Use 7-zip to compress them if they're too big to attach.)

Updated by bigbot89 10 months ago

Here you go. Each file has been named accordingly.

Just to clarify a bit on my original post:
The image with text offset to the right is what appears with SafeTextureCacheColorSamples = 512. The image with the journal displaying correctly (with the mountain and the boat) is simply a screenshot of what it's supposed to look like when playing on the Wii. I've uploaded a screenshot of what it looks like when setting SafeTextureCacheColorSamples to 0 and 128.

Actions #3

Updated by bigbot89 10 months ago

Also

pokechu22 wrote in #note-1:

Can you attach two fifologs (one with SafeTextureCacheColorSamples = 0 and one with SafeTextureCacheColorSamples = 512) to this issue, please? It'd help with checking it. (Use 7-zip to compress them if they're too big to attach.)

In addition to the uploaded logs I'll add this: The issue occurs regardless of the internal resolution. Native and 3x Native 1080p produce the same result.

Actions #4

Updated by pokechu22 10 months ago

Hmm, the fifologs don't seem to work properly; rendering is completely broken in them. (It looks like the texture coordinate matrix is messed up; rows 60-63 should be the identity matrix but they're all zeros instead. The color swap table is also messed up, being RGRR instead of RGBA. And something else is wrong too; probably there's more state that only gets set once and isn't being captured properly in the fifolog.) Even working around those issues I can't see anything that looks like it should be drawing text, which is odd. (I might just be missing something obvious though.)

I'll buy a copy of the game and take a look at it in a few days, hopefully things will be easier to understand then.

Actions #5

Updated by bigbot89 10 months ago

pokechu22 wrote in #note-4:

Hmm, the fifologs don't seem to work properly; rendering is completely broken in them. (It looks like the texture coordinate matrix is messed up; rows 60-63 should be the identity matrix but they're all zeros instead. The color swap table is also messed up, being RGRR instead of RGBA. And something else is wrong too; probably there's more state that only gets set once and isn't being captured properly in the fifolog.) Even working around those issues I can't see anything that looks like it should be drawing text, which is odd. (I might just be missing something obvious though.)

I'll buy a copy of the game and take a look at it in a few days, hopefully things will be easier to understand then.

Is it something I did wrong in the fifolog recording? What I did was opened the journal, then went to fifoplayer, set 3 frames, record, then save.
Would it be helpful if I recorded a video of the problem?

Actions #6

Updated by pokechu22 10 months ago

Is it something I did wrong in the fifolog recording? What I did was opened the journal, then went to fifoplayer, set 3 frames, record, then save.

No, it seems like it's probably a bug with the fifolog recorder itself.

Would it be helpful if I recorded a video of the problem?

I don't know how much additional information that would give compared to the screenshot. If you think it would be helpful, go ahead, but if it's a lot of extra effort it's probably not needed. (I assume that opening the journal is something that's self-explanatory once I actually have the game.)

Updated by bigbot89 10 months ago

pokechu22 wrote in #note-6:

Is it something I did wrong in the fifolog recording? What I did was opened the journal, then went to fifoplayer, set 3 frames, record, then save.

No, it seems like it's probably a bug with the fifolog recorder itself.

Would it be helpful if I recorded a video of the problem?

I don't know how much additional information that would give compared to the screenshot. If you think it would be helpful, go ahead, but if it's a lot of extra effort it's probably not needed. (I assume that opening the journal is something that's self-explanatory once I actually have the game.)

Nah getting a screen recording is quick and easy. I just attached two videos named accordingly.

(I assume that opening the journal is something that's self-explanatory once I actually have the game.)
Yeah pretty self explanatory. Once you start a new game and get past the intro and prologue (takes all of 4 or 5 minutes) you'll get to the first hidden object area at the dock. After you complete the first hidden object search you'll be shown how to use the journal.

Oh. I also tried both rvz and wbfs formats; no change.

Any other questions I'll be sure to answer as soon as I can.

Thanks for your help in this!

Actions #8

Updated by pokechu22 10 months ago

The way the text changes when the page flipping animation ends in the 512 version is very odd.

One other thing to check is if disabling dual core changes things. Dual core is can cause lots of weird issues, though this doesn't match what I'd expect. But it'd be good to rule it out.

Disabling "Store EFB Copies to Texture Only" and "Defer EFB Copies to RAM" might also do something, but I'm not sure about that either.

Actions #9

Updated by bigbot89 10 months ago

pokechu22 wrote in #note-8:

One other thing to check is if disabling dual core changes things. Dual core is can cause lots of weird issues, though this doesn't match what I'd expect. But it'd be good to rule it out.

Disabling dual core didn't change anything.

Disabling "Store EFB Copies to Texture Only" and "Defer EFB Copies to RAM" might also do something, but I'm not sure about that either.

I disabled "Store EFB Copies to Texture Only" but left "Defer EFB Copies to RAM" and now it works! I really thought I had tried that as I was messing with tons of settings but apparently I didn't. Awesome!

I tested this on my laptop. When I get home I'll test it on my desktop where I first encountered the issue. After playing some I'll confirm if the issue is gone and ensure it didn't cause any other odd issues.

Actions #10

Updated by pokechu22 10 months ago

Alright, that makes some sense. I guess Dolphin's texture cache is getting confused by the text and thinks that two different versions of it are the same texture because it's mostly either transparent or black.

Can you test whether there are issues with the different SafeTextureCacheColorSamples values when "Store EFB Copies to Texture Only" is off (in particular when flipping between pages)? If it changes book behavior when EFB copies to texture only is on, it might cause issues when it's off too. (SafeTextureCacheColorSamples = 0 is the safest/most accurate value, with 512 the midpoint and 128 being the fastest but least accurate value.)

Actions #11

Updated by pokechu22 10 months ago

"Store EFB Copies to Texture Only" being disabled might also explain why I don't see the text in the fifologs; if the game renders the text once and then uses it as a texture later on, but that texture never gets saved into main memory, it won't be saved into the fifolog either.

(Also, as a note to myself: the fifolog renders properly if the call to LoadRegisters in FifoPlayer::AdvanceFrame() (which normally handles resetting things when looping) is commented out and then an external debugger is used to change xfmem.posMatrices[60*4+0] (0xf0), xfmem.posMatrices[61*4+1] (0xf5) and xfmem.posMatrices[62*4+2] (0xfa) to 1.0 (restoring an identity matrix starting at row 60), bpmem.tevksel.ksel[1].hex to 0xe (setting swap_rb to blue and swap_ga to alpha, so the first swap table maps RGBA to RGBA instead of RGRR), and bpmem.dispcopyyscale to 256 (so that the screen is actually the right height; this was the step I missed before). All of those values were previously 0, which makes me think the initial register values weren't saved properly. I'm not sure what would cause that though and will need to investigate.)

Actions #12

Updated by bigbot89 10 months ago

pokechu22 wrote in #note-10:

Alright, that makes some sense. I guess Dolphin's texture cache is getting confused by the text and thinks that two different versions of it are the same texture because it's mostly either transparent or black.

Can you test whether there are issues with the different SafeTextureCacheColorSamples values when "Store EFB Copies to Texture Only" is off (in particular when flipping between pages)? If it changes book behavior when EFB copies to texture only is on, it might cause issues when it's off too. (SafeTextureCacheColorSamples = 0 is the safest/most accurate value, with 512 the midpoint and 128 being the fastest but least accurate value.)

I tested this and the journal works regardless of the SafeTextureCacheColorSamples value when Store EFB Copies to Texture Only is off. This seems to have resolved the issue. I can't believe I missed this step in my own troubleshooting. Working in Information Technology for 13 years I should have known better lol.

I'm waiting to be given edit rights to the dolphin wiki so I can add these minor configs to the game's wiki page for future players. Hopefully it'll save somebody a headache.

I know this isn't a popular game so I appreciate your tenacity!

Actions #13

Updated by pokechu22 10 months ago

It's probably better to update the default gameini to force "Store EFB Copies to Texture Only" off by default - it seems like the journal is a pretty important part of the game (compared to, say, Super Mario Galaxy's ability to screenshot your progress and save it to the message board). It also seems like the gameini forces SafeTextureCacheColorSamples = 512 by default which is odd - that was added 12 years ago along with forcing proper XFB emulation to fix cutscenes (#4723), but it's not clear if the texture cache setting is actually needed. If everything works properly at 128 as well, that can probably be removed from the gameini.

Actions #14

Updated by bigbot89 10 months ago

pokechu22 wrote in #note-13:

It's probably better to update the default gameini to force "Store EFB Copies to Texture Only" off by default - it seems like the journal is a pretty important part of the game (compared to, say, Super Mario Galaxy's ability to screenshot your progress and save it to the message board). It also seems like the gameini forces SafeTextureCacheColorSamples = 512 by default which is odd - that was added 12 years ago along with forcing proper XFB emulation to fix cutscenes (#4723), but it's not clear if the texture cache setting is actually needed. If everything works properly at 128 as well, that can probably be removed from the gameini.

I assume you're referring to the "ImmediateXFBEnable" setting in the default gameini. I did notice that about 'SafeTextureCacheColorSamples' and 'ImmediateXFBEnable'. I decided to test it for you.

Leaving 'SafeTextureCacheColorSamples' at 512 and changing 'ImmediateXFBEnable = True' causes flickering when opening the journal and flipping through pages. It also causes cutscenes to not display at all as reported in bug #4723 . Changing 'SafeTextureCacheColorSamples' to any other value causes the same flicker.

Leaving 'ImmediateXFBEnable = False' and the flicker does not occur and cutscenes display properly. At this point, changing 'SafeTextureCacheColorSamples' to 0 or 128 makes no difference and the journal and cutscenes still display properly.

Perhaps 'SafeTextureCacheColorSamples = 512' was added to the default gameini 12 years ago because it caused the journal to somewhat function, though not correctly. But it seems with adding 'EFBToTextureEnable = False' the 'SafeTextureCacheColorSamples' value no longer makes a difference.

This is my current gameini as shown under the "..\Dolphin-x64\User\GameSettings\SFI.ini" file...

[Video_Settings]
# Probably not needed since Dolphin's default config is set to "fast" but I left it here anyways.
SafeTextureCacheColorSamples = 128

[Video_Hacks]
EFBToTextureEnable = False
ImmediateXFBEnable = False

... and everything works great so far.

I agree changing to default gameini in future dolphin builds would probably be the best course of action. Would that be something you do as a developer (your profile says you are so I'm just assuming) or is that something I have to do?

Actions #15

Updated by pokechu22 10 months ago

  • Status changed from New to Fix pending

Thanks for the testing! I've created a pull request at https://github.com/dolphin-emu/dolphin/pull/12189 (this kind of change is fairly easy for anyone to make, though, so if you run into a situation like this for another game feel free to create a PR yourself).

It's better to remove unneeded settings from the gameini since if they're present at all, they override the user's settings, which is good if the setting makes the game work when it wouldn't otherwise, but is less helpful if the setting doesn't actually affect anything.

Actions #16

Updated by bigbot89 10 months ago

pokechu22 wrote in #note-15:

Thanks for the testing! I've created a pull request at https://github.com/dolphin-emu/dolphin/pull/12189 (this kind of change is fairly easy for anyone to make, though, so if you run into a situation like this for another game feel free to create a PR yourself).

It's better to remove unneeded settings from the gameini since if they're present at all, they override the user's settings, which is good if the setting makes the game work when it wouldn't otherwise, but is less helpful if the setting doesn't actually affect anything.

Yeah I'll probably remove that setting.
You're welcome! I'm glad we were able to get this sorted rather easily.
Thanks again!

Actions #17

Updated by pokechu22 8 months ago

  • Status changed from Fix pending to Fixed
  • Fixed in set to 5.0-20186
Actions

Also available in: Atom PDF