Emulator Issues #11746
openMario Party 4 - Graphic error in the mini-game "Photo Finish"
0%
Description
Game Name?
Mario Party 4
Game ID? (right click the game in the game list, Properties, Info tab)
GMPP01 v1.01
MD5 Hash? (right click the game in the game list, Properties, Verify tab, Verify Integrity button)
f6740fc00d9818ad1f161889382c7902 (It's a .gcz file)
What's the problem? Describe what went wrong.
In the mini-game "Photo Finish" an emulation inaccuracy of the Dolphin Emulator becomes recognizable. One of the two penguins on the right side at the end of the game shows graphic errors.
This problem also occurs when all cheats, hacks and improvements are disabled.
What steps will reproduce the problem?
- Make sure the mini-game "Photo Finish" is unlocked.
- Start MP4
- select "Minigame Mode" in the main menu.
- select the mini-game "Photo Finish" and hope that the picture with the penguins is used. If another picture is used, press B and repeat step four.
- start the game and play until the end screen comes up.
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, 5.0-10121
Is the issue present in the latest stable version?
Yes.
What are your PC specifications? (CPU, GPU, Operating System, more)
CPU: Intel Core i7-8700K @ 4,3 GHz
GPU: I'm a GeForce GTX 980...
OS: Windows 10
Is there anything else that can help developers narrow down the issue? (e.g. logs, screenshots,
configuration files, savefiles, savestates)
Correct (Console): https://youtu.be/OALsWUZP86M?t=160
Wrong (Dolphin): https://youtu.be/5V2ONfBdXxI
Files
Updated by JMC4789 over 5 years ago
That looks like the animation is desynced on some of the vertices... can you try using interpreter? Load a savestate shortly before it loads the finish to save time.
Updated by Lettendo over 5 years ago
It also happens using interpreter. But I'm not sure when it loads the finish. I made a savestate right before the "Finish" lettering comes up but I'm not sure if that's too late.
Updated by Lettendo over 5 years ago
I noticed that not always the same penguin is affected. Sometimes both the left penguin and the reflection of the right penguin are affected and sometimes both the right penguin and the reflection of the left penguin are affected.. if that helps.
Updated by JMC4789 over 5 years ago
Haha, always worth a shot. I have a feeling this is a CPU issue.
Updated by Lettendo over 5 years ago
Oh, and I have Revision 1.02 of the game, not 1.01, I just noticed.
Updated by Techjar over 5 years ago
Might also be worth testing it on software renderer, though it's abominably slow.
Updated by Lettendo over 5 years ago
I tried that, creating a savestate right before the "Finish" lettering comes up and testing it from there, but the issue still occurs.
Updated by flacs over 5 years ago
- Status changed from New to Accepted
I can reproduce this with the NTSC-U version (GMPE01 revision 1) which has a handy AR code that unlocks all minigames.
Updated by pokechu22 almost 3 years ago
- File Photo_Finish_Dolphin.png Photo_Finish_Dolphin.png added
- File Photo_Finish_Dolphin_copyfilter.png Photo_Finish_Dolphin_copyfilter.png added
- File Photo_Finish_Wii.png Photo_Finish_Wii.png added
Confirmed that that fifolog renders correctly on real hardware but renders wrong on dolphin (using the hardware fifoplayer).
Updated by pokechu22 almost 3 years ago
- File Photo_Finish_Wii_InvalidateVCache.png Photo_Finish_Wii_InvalidateVCache.png added
- File Photo_Finish_Wii_NoVCacheEnhance.png Photo_Finish_Wii_NoVCacheEnhance.png added
Note that the reflection of the rightmost penguin is also affected (but the rightmost penguin itself, and the middle penguin, are both not affected). This is a bit harder to see due to the white background (if the starting object is set to 62 it's a bit easier to see).
The penguins are drawn in the order right (166-181-186), middle (187-202-207), right's reflection (208-223-228), middle's reflection (229-244-249) (the numbers are first object in penguin, first object in penguin's body, last object in penguin's body. Note that you can't just use a range of 202-207 because the game clears the screen; the easiest range to use is 202-357 for instance). The right penguin uses position data from an array at address 00930180 (set in object 181/fifo offset 0003a36d, and the fifo recorder created a memory update at offset 0003a495/the end of object 181's primitive data), but the middle penguin and both reflections use position data from 0095e020 instead. The middle penguin sets the address in object 202/offset 0003ca53, and the memory update ends up at offset 0003cb7b at the end of object 202's primitives.
The right penguin's reflection sets the address in object 223/offset 0003f139, but the corresponding memory update ends up at offset 0003d36f - the end of the primitive data for object 206 (part of the middle penguin). And the middle penguin's reflection sets the address in object 244/offset 0004181f, but the memory update ends up at offset 0003fa55, the end of the primitive data for object 227 (part of the right penguin's reflection).
The fifo recorder does do some weird things with memory updates (they're being placed at the end of the primitive data, when they should really be at the start), but this issue happens in normal gameplay. I'm pretty sure what's happening here is that the game allocated two buffers (at addresses 00930180 and 0095e020) intended for the right and middle penguins (respectively), but accidentally uses the buffer for the middle penguin for the right penguin's reflection. The code was written under the assumption that the buffer for the penguin being drawn was separate from the one being updated, so they update what is supposed to be the right penguin's buffer while the middle penguin is being drawn. But both buffers are the same, so the backing memory for the middle penguin gets changed in the middle of the drawing process. (Note that I don't own a copy of Mario Party 4, so this is entirely conjecture based on what is happening in the fifolog. But it feels plausible at least.)
One other aspect is that the game issues GX_CMD_INVL_VC at the start of each penguin's body section (objects 181, 202, 223, and 244), and doesn't issue it again until it's moved on the next penguin's head. This command is used to invalidate the vertex cache. Since all of the drawing happens in roughly the same part of memory (and, objects 184/205/226/247 use index 0x61 into the array (corresponding to addresses 0x0095E4AC-0x0095E4B7) when the maximum index used in the next 2 objects is 0x63 (0x0095E4C4-0x0095E4CF) objects 181/202/223/244 use the maximum index of 0x63, so all of the data is in the cache), on real hardware the vertex cache is hit and main memory is bypassed (until the vertex cache is invalidated). So, that the game accidentally using the wrong buffer ends up not mattering.
I was able to confirm this with the hardware fifoplayer by issuing GX_CMD_INVL_VC after every memory update, effectively disabling the vertex cache, which results in the same behavior as in Dolphin. (I also separately tried clearing CP_VAT_REG_B's top bit, currently labeled as "Enhance VCache (must always be on)". This did introduce some kind of rendering oddity on hardware, but it was a different one from the one Dolphin had.)
So, to fix this, we would either need to implement the vertex cache (likely to require a bit of research, and it would probably have a performance overhead since I don't think Dolphin would actually gain any performance by being able to cache vertex data since the video backends probably wouldn't be able to make use of this information, but this would be good for accuracy purposes), or we would need to implement a game-specific patch (which I wouldn't be able to do without buying the game).
Updated by JMC4789 almost 3 years ago
I might have a spare copy of Mario Party 4 if necessary. I would like to have the Vertex Cache implemented (perhaps optionally, like some other accuracy features?)