Dolphin Progress May and June 2020
dolphin-emu.org
dolphin-emu.org
The way he implemented it is insane, he had to reverse engineer a way to generate arbitrary game states in game, as using dolphin savestates was not performant enough.
He's also added other amazing features, like in game matchmaking, or my favorite, being able to stream a game state through the Wiis ethernet port, so two players can be competing on original hardware while a stream setup upscales that footage in realtime to 16:9 4k through Dolphin, and also generates real time match stats, saves replays... Incredible stuff.
Here's the project page: https://slippi.gg/ and a video from a top melee player showcasing the matchmaking: https://www.youtube.com/watch?v=erbZV8u6-hA
Commercial environments would have called these ideas unfeasible before the first line of code was written.
[0]: I'm not affiliated with Fizzi but I'm not sure if sharing his patreon would be spam, so I'll say you can find it in the project website from my previous comment.
I'm just an outside observer, but i love the topic. For others like myself, this is a great GDC video to watch on the topic
> 8 Frames in 16ms: Rollback Networking in Mortal Kombat and Injustice 2
As to dev blogs, they have a medium[1] with some interesting posts, but nothing too recent, I hope they'll do one in time with all the new stuff.
On top of the rollback, something very notable they did was realising melee has 3 frames of input lag when running on native hardware, so they managed to remove them from Dolphin when running on 120hz screens. This allowed them to keep those frames as a delay buffer without actually having a real effect on gameplay.[2]
[0] Slippi Github: https://github.com/project-slippi/
[1] Dev Blog: https://medium.com/project-slippi
[2] Post about Faster Melee, the previous netcode iteration, going into the input delays: https://www.reddit.com/r/SSBM/comments/azoiqz/faster_melee_2...
If you're referring to my comparison, I'm talking about current gen titles. In fact, with this you can now play play cross-country with less input lag than Smash Ultimate offline
[1] https://en.wikipedia.org/wiki/GameCube_online_functionality#...
> GGPO uses a netcode technique called “rollback”. Rather than waiting for input to be received from other players before simulating the next frame, GGPO predicts the inputs they will send and simulates the next frame without delay using that assumption. When other players’ inputs arrive, if any input didn’t match the prediction, GGPO rolls back the state of the game to the last correct state, then replays all players’ revised inputs back until the current frame. The hope is that the predictions will be correct most of the time, allowing smooth play with minimal sudden changes to the game state.[6][7] The system in itself is highly similar to client-side prediction, but applied to a peer-to-peer setup.
I see this repeated often without justification. Why is rollback better?
Based on my basic understanding, rollback netcode would absolutely fall apart under any suboptimal network conditions. If there's too much lag or packet loss, you and the opponent character will start teleporting all over the screen, missing lots of inputs, etc.
It makes sense that rollback netcode would be preferable when paired with a very good, reliable network (e.g. so if any rollback is needed, it's only a frame or two). But if you're selling a casual game meant for anyone to be able to play, a delay based netcode makes more sense to me. An average Joe can understand "the game is buffering", but if the game starts rolling back too much and you can't control your character because he's teleporting all around, that just looks like a broken game.
An interesting follow up question: if rollback is objectively the better approach, why is it implemented less often? Is it significantly more difficult to develop and does that offset how much value it would add to the game?
Teleporting rarely happens for me, if ever - and if it does, then I can cancel and move on to the next opponent who generally doesn't exhibit the issue. In a game like Melee, this is huge - you really need to play both to understand how impactful the difference is.
The reason rollback is rarely implemented is because it is hard to motivate a company to do it when the benefits are so intangible. “Better netcode” doesn’t really sell games, flashy graphics does. And since most of the FGC has existed offline, online is just an afterthought.
This video explains fairly well: https://youtu.be/1JHetORRpfQ
- predicting that the buttons held down in frame X will be the buttons held down in frame X+1 is actually a pretty good heuristic
- in fighting games, changing directions and attacking generally have windup animations, so if a correction skips a few of the initial animation frames, it still hasn't diverged the overall game state much
- even in bad connections, you still have control of your character; the game doesn't freeze and take you out of the flow (this can be subjective)
- hybrid approaches are possible, where a small fixed delay is used in addition to rollback; short enough to not be obvious to the player, but long enough to avoid rollback in the cases where delay would be sufficient. (delay-based netcode is not good intercontinentally anyways due to the necessary delay for synchronization becoming obvious input lag)
As for why rollback is rarer, yes, it is more difficult; it usually requires a fully deterministic game engine with the ability to snapshot and restore game state, which can be a very intensive retrofit if you didn't design it in from the start.
Rollback requires your game to be able to rollback to a previous game state. Some games are not developed with this in mind (too much reliance on global state, hard to go backwards in time)
I jumped in and have been poking at some stuff for the macOS build, tons of fun.
"Free Look is a longstanding Dolphin feature that allows the user to reposition the camera in a game however they so please, with abilities far far beyond what game cameras can provide. This allows for exploring blocked off areas, advanced game photography, and more. "
Dolphin isn't reading 3D models, they're just tweaking the matrices that the game sends. Increased resolution sort of similar the same -- the game sends the hardware triangles in an abstract model space, which is converted to clip space (where the left of the screen is -1.0 and the right is 1.0). Increasing the resolution just means adjusting the rest of the transform; everything the game sends is in abstract space.
(Yes, I know there's a bit more to it than that, e.g. virtual XFBs, LOD biases, and so forth)
Basically, unlike the PS2, the GameCube is pretty much an ancestor of modern PC GPUs, so its way of doing graphics is very familiar to us, and maps quite well. And this is not an accident! ATI bought the company that made the GameCube's GPU (ArtX), and put out a GPU so good (the r300) that NVIDIA nearly went out of business.
Also, fun, I ran into the same "GLES doesn't support glReadPixels for depth" when working on the lens flare code for Wind Waker and Super Mario Galaxy in https://noclip.website. Had to do some dirty tricks to convert it to a color format first.
I was lucky with drivers but I heard a lot of horror stories so also switched to NVIDIA when I finally got around to upgrading.
The R300/Radeon 9700 (based on the ArtX IP) came out late summer of 2002, and several months later NVidia launched the dismal GeForce FX series (which is the project that most of the 3DFX “rampage” team went to work on after acquisition). The fundamental problem with NVIDIA’s design was that it was optimized for 16-bit precision pixel shaders, and then-new DirectX 9’s “pixel shader 2.0” model mandated a 24-bit minimum precision. The R300 ran FP24 math natively, and consequently ran circles around the FX series in DX9 performance.
NVidia didn’t really catch up to and surpass ATI until much, much later.
I agree ATI still dominated Nvidia in sales well into the 00's, Nvidia took a long time to offer competitive cards. The solder issues & Cap Plague didn't help them any, either.
edit: just watched a video and I am completely sold
It reminds me a bit of this multi-year, labor-of-love project: http://www.starryexpanse.com