Project

General

Profile

Actions

Emulator Issues #11746

open

Mario Party 4 - Graphic error in the mini-game "Photo Finish"

Added by Lettendo almost 5 years ago. Updated over 2 years ago.

Status:
Accepted
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:

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?

  1. Make sure the mini-game "Photo Finish" is unlocked.
  2. Start MP4
  3. select "Minigame Mode" in the main menu.
  4. 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.
  5. 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

mario party 4 pinguine.dff (4.21 MB) mario party 4 pinguine.dff shows issue Lettendo, 06/01/2019 11:12 AM
Photo_Finish_Dolphin_copyfilter.png (341 KB) Photo_Finish_Dolphin_copyfilter.png pokechu22, 01/17/2022 06:52 PM
Photo_Finish_Dolphin.png (346 KB) Photo_Finish_Dolphin.png pokechu22, 01/17/2022 06:52 PM
Photo_Finish_Wii.png (337 KB) Photo_Finish_Wii.png pokechu22, 01/17/2022 06:52 PM
Photo_Finish_Wii_InvalidateVCache.png (337 KB) Photo_Finish_Wii_InvalidateVCache.png pokechu22, 01/17/2022 11:59 PM
Photo_Finish_Wii_NoVCacheEnhance.png (337 KB) Photo_Finish_Wii_NoVCacheEnhance.png pokechu22, 01/17/2022 11:59 PM
Actions #1

Updated by JMC4789 almost 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.

Actions #2

Updated by Lettendo almost 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.

Actions #3

Updated by Lettendo almost 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.

Actions #4

Updated by JMC4789 almost 5 years ago

Try single core?

Actions #5

Updated by Lettendo almost 5 years ago

I never use dual core...

Actions #6

Updated by JMC4789 almost 5 years ago

Haha, always worth a shot. I have a feeling this is a CPU issue.

Actions #7

Updated by Lettendo almost 5 years ago

Oh, and I have Revision 1.02 of the game, not 1.01, I just noticed.

Actions #8

Updated by Techjar almost 5 years ago

Might also be worth testing it on software renderer, though it's abominably slow.

Actions #9

Updated by Lettendo almost 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.

Actions #10

Updated by Techjar almost 5 years ago

Okay, so not a video backend issue.

Actions #11

Updated by flacs almost 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 over 2 years ago

Confirmed that that fifolog renders correctly on real hardware but renders wrong on dolphin (using the hardware fifoplayer).

Updated by pokechu22 over 2 years ago

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).

Actions #14

Updated by JMC4789 over 2 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?)

Actions

Also available in: Atom PDF