Emulator Issues #3122
Mario Kart Wii: Ghosts don't play back correctly
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
32-bit or 64-bit and any other build parameters?
OS version and versions of tools/libraries used?
WinXP Pro MCE
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.
#4 Updated by JMC4789 almost 8 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.
#8 Updated by jimmyli1528 over 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.
#11 Updated by JMC4789 almost 7 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 almost 7 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...
#14 Updated by phire almost 7 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.
#16 Updated by phire almost 7 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 over 6 years ago
This should be fixed in JIT with this build: https://dl.dolphin-emu.org/prs/pr-834-dolphin-latest-x64.7z
#19 Updated by JMC4789 over 6 years ago
- Status changed from Fix pending to Fixed
Fixed by 4.0-2729 -> https://dolphin-emu.org/download/dev/ebf1b981067c7f92e60178325fee40f6f54e11c1/