GGPO, short for "Good Game, Peace Out" is a middleware suite designed with fighting games in mind. It was developed by Tony Cannon, a member of the Shoryuken online fighting community. The functional part of this middleware (where the magic happens) is closed source, but the section of code pertaining to the GUI for its client can be found at this GitHub repository. The GGPO middleware is an attempted solution at providing a smoother online experience for peer-to-peer fighting games. This section goes through two parts:
This software sits at the network layer behind the desired game. It was not designed for any one game in mind, but instead to allow netplay for a wide variety of fighting action games. Its primary functionality is twofold:
From here, the game uses a process called speculative execution to try and eliminate perceived input delay. Tony Cannon explains how this process works in this interview with writers at Gamasutra. The main idea is that in combination with the frame delay set previously by players, the GGPO middleware predicts inputs before they occur based on previous actions. When inputs are actually received, they are compared to the predicted inputs. If any discrepancies occur, the middleware "rolls back" its simulation to the first incorrect frame and corrects using the received inputs.
Another explanation on how GGPO functions with respect to frame delay can be found from this blog post written by a developer of Skullgirls.One very important side effect of using this middleware is that games using this middleware must use a peer-to-peer architecture. You can use any protocol to send packets, but the packets have to be sent and interpreted by each client directly. Games using GGPO cannot use a server/client architecture and any benefits associated with using such an architecture.
GGPO's primary functionality relies on an archive named "ggpo-build-030.zip" as per the last GitHub update from above. To ensure the middleware functions out-of-the-box, both users need to perform the following tasks:
For the purposes of analysis, a copy of the archive was found on a 3rd party rehost. The archive's contents and structure can be seen in the following image.
As seen at the bottom of the screenshot, this middleware also includes 4 DLLs that hold the majority of its functionality:
These DLLs were created from Visual C++ source code. Because of this, Visual Studio's dumpbin tool was used to dump function information from both ggponet.dll and kailleraclient.dll. The functions found from each can be seen below.
ggponet.dll:
kailleraclient.dll:
From these method names, I made the assumption that kailleraclient.dll is used to handle networking functions between games and the client itself. This would include things like starting up the client, creating and managing lobbies, handling chat between connected peers and initiating games.
This leaves ggponet.dll as the primary source of our interest, as it would handle all of the in-game networking. Of note is the capabilities to advance frames, synchronize input as per the previously set frame delay, connecting peers properly before and during a game and ensuring the game stays alive for as long as necessary.