Emulator Issues #3122

Mario Kart Wii: Ghosts don't play back correctly

Added by jayork42 almost 10 years ago.

% Done:


Operating system:
Issue type:
Relates to usability:
Relates to performance:
Relates to maintainability:
Regression start:
Fixed in:


What steps will reproduce the problem?
1. Start Mario Kart Wii NTSC
2. Download a save file and watch a developer or a downloaded ghost replay

What is the expected output? What do you see instead?
The ghost is supposed to reflect the player's race experience 100%. Instead a minute or so into the race he starts crashing into walls.

Dolphin version with the problem? Other Dolphin version without the
problem? r6106

32-bit or 64-bit and any other build parameters?

OS version and versions of tools/libraries used?

Please provide any additional information below.
I'm guessing this issue has to do with the button inputs becoming out of sync with the actual progression of the race. But the nature of the problem doesn't seem like that. One moment the racer makes a few turns just fine, the next he crashes into a wall as if something suddenly went wrong in the core. To me it doesn't look like a gradual synchronization drift. This happens both with OpenGL and Direct3D, also with JitIL. I could test this with interpreter to see if recompiling is the problem but I haven't had a chance to do that yet being that interpreter is so slow. I tried changing some options in the core as well as the video plugins but I was unable to find a workaround.

An interesting detail though: On the first track of the first cup (forgot the name) after making the right turn into the open area with the sand and ramp to the left, the racers always seem to head right for the wall in that general area. They seem to be racing normally before that point.

Related issues

Has duplicate Emulator - Emulator Issues #6290: Staff ghosts on Mario Kart DD are brokenDuplicate


#1 Updated by drkIIRaziel almost 10 years ago

If i had to guess, i'd say its fpu drifting errors accumulating over time

#2 Updated by kevinx0404 almost 10 years ago

yeah, I've been getting that issue for the past 1000 or so revisions, I just always forgot to post this issue on google code.

#3 Updated by marcel.werner3 over 9 years ago

issue is still valid...I've got a feeling the ghosts have gotten a tidbit more intelligent, but they still do crazy shit xD

#4 Updated by JMC4789 over 7 years ago

I just tested this to see if it's still valid, since it's been over two years. It is, and really without any changes. It's probably the same thing as the Brawl Replays.

The guess of accumulating errors may beright, but one thing I noticed is that after a jump the Wii ghosts seem to be basically screwed. That could be because small differences in position before hand causes the jump to go differently, or something else in Dolphin may be wrong in how it handles something. It does seem pretty sudden when things do go wrong.

Dualcore doesn't make a difference, as well as idle skipping (I dunno, I was just trying stuff at that point.) or HLE/LLE Audio. It's not affected by any of those, and the ghosts always fail the same way, so at least it's consistent.

#5 Updated by Billiard26 about 7 years ago

  • Issue type set to Bug

#6 Updated by hesham1441999 about 7 years ago

Do You run it 100% speed and 60fps?

#7 Updated by rachelbryk about 7 years ago

issue 6290 has been merged into this issue.

#8 Updated by jimmyli1528 almost 7 years ago

Mario Circuit is okay-ish sometimes because it's mostly flat?
SNES Mario Circuit is OK because it's completely flat.
Correct me if I'm wrong.

This might be a rounding issue related to going downhill.
Disclaimer: I know nothing about the Wii architecture other than it having two processors and running on IOSes or something.

#9 Updated by jimmyli1528 almost 7 years ago

Yes, I confirmed that mario circuit is not affected, as far as I can tell, no stupid errors. And the bug exists on r6515.

#10 Updated by JMC4789 over 6 years ago

  • Status changed from New to Accepted

I dunno why this isn't accepted.

#11 Updated by JMC4789 over 6 years ago

I recorded a quick demonstration of this glitch.

This video shows side by side what happens and may help with debugging exactly what's happening. I also have the source file for going frame by frame.

Two things I observed:

Ghosts that stay on flat surfaces work in Mario Kart Wii. In Double Dash, I don't think that's the case.

The landing, even though it seems to happen at the same point, gets less steering input on Dolphin.

#12 Updated by crudelios over 6 years ago

I watched the video and saw something interesting: before the big jump at the end (when things really start going downhill), the kart gets a small bump when it goes offroad (check video at minute 0:58).

When landing from that bump, both karts are already in different places and going at different speeds.

Then, when the original Wii kart lands from the big jump, it immediately turns slightly to the left. However, since at that point in time the Dolphin kart has not yet landed, it also doesn't turn and ends up going offroad when it shouldn't.

So perhaps this is a CPU bug which results in wrong game physics? It can also be wrong collision detection...

#13 Updated by JMC4789 over 6 years ago

That's what I assumed, but we really have no leads on what. This even happens in interpreter.

#14 Updated by phire over 6 years ago

Dolphin's floating point emulation is known to be inaccurate in a number of ways.

The two instructions which I'm really suspicious about are fres and frsqrte.

These instructions provide estimates and are not even guaranteed to provide the same result across Intel and AMD processors, or even different generations of the same family of processors.

#15 Updated by JMC4789 over 6 years ago

Is there a way to make them more accurate or simply different, if only in a branch or some kind of experiment to see if it fixes or effects this issue?

#16 Updated by phire over 6 years ago

Unfortunately, the exact algorithm used for these instructions on the gecko isn't documented, so someone would have to spend some time with a real wii to RE these instructions, which would take a lot of time.

And we don't even know if it's these instructions that are at fault, they are just the ones which stick out the most when I read through the gecko manual.

#17 Updated by JMC4789 almost 6 years ago

This should be fixed in JIT with this build:

#18 Updated by JMC4789 almost 6 years ago

  • Status changed from Accepted to Fix pending

#19 Updated by JMC4789 almost 6 years ago

  • Status changed from Fix pending to Fixed

Also available in: Atom PDF