Case Study: Kickin’ out netcode issues with Edgegap

Apr 11, 2022

Kickin’ out netcode issues with Edgegap

The Background

Describing Jonah Wallerstein, the developer of KungFu Kickball, as patient and resourceful in building a real-time multiplayer online game as a one-person show would be an understatement. 

His journey in developing the online multiplayer is detailed on Game Developer as he explains the challenges he faced trying to mitigate any netcode issues and gives tips on how he resolved them. 

Kung Fu Kickball - Screenshot - 8 Playable Champions

The Problem

KungFu Kickball is a fighting-sports game in which players kick, punch and headbutt their way across the field to smash the ball into the opponent’s bell to win points. As any game developer knows, online fighting games are particularly challenging due to the importance of muscle memory and reaction times: a bad netcode can kill the online fighting experience.

From the beginning, Jonah kept netcode top of mind as he wanted to ensure that the game had no lag and no unfair advantage to any given player because of the latency. What’s more: he wanted KungFu Kickball to be crossplay.

Jonah was developing the game with Unity and initially thought of using the Photon PUN plugin for the multiplayer, crossplay aspect of KungFu Kickball. However, he noticed two main issues of how PUN handled player authority: 

  • In peer-to-peer shared authority mode: The gameplay experience would be odd because there was no actual state of sync, especially with how collisions would be handled on each player’s client

  • In peer-to-peer client-hosted authority: This would cause an unfair advantage for the host with 0ms latency 

Kung Fu Kickball - Screenshot

Jonah started researching how other fighting games handle netcode. He found that lockstep/rollback netcode (GGPO) was often used for peer-to-peer multiplayer games. Nevertheless, he had issues with the traditional implementation of lockstep/rollback netcode.

As Jonah wrote in his article

"One of the significant issues that can happen with lockstep is a slowdown. Sometimes even rollback isn’t enough to hide the latency between players. And when the game runs out of rollback frames, it must stop and wait for the inputs to arrive. This issue is exacerbated when you have more than two players. If one player has a poor connection, that can slow down the game for everyone else."

Kung Fu Kickball - Screenshot

That’s when he decided to add impartial authority to the game and created what he dubbed a “server authoritative rollback netcode” instead of peer-to-peer rollback. 

But his netcode puzzle was still missing something. The reason? Introducing a server can make response times worse. For example, if the server is in New York and two players in the UK are fighting against each other, the lag would be worse than just having them play peer-to-peer. Having multiple servers was also out of the question because he didn’t want to split up his player base and did not have the luxury of having servers in all regions of the world. 

The answer to his puzzle came as a new way of hosting game servers that combine a large server locations pool with immediate availability.

How Edgegap helped

Jonah found Edgegap, which provided him with servers on a per-match basis, thanks to containerization and a proprietary server. As a result, the same two UK players would most likely be assigned a server in England, let’s say, or somewhere very close by. As such, he did not have to split his user base into regions, reducing matchmaking and improving the player experience.

Edgegap not only helps with performance but with the cost aspect as well. “Edgegap allows me to keep the number of servers I’m actively paying for a pretty low while at the same time having a huge network to draw from.”

Finally, integrating Edgegap was blazingly fast and straightforward. Jonah had to turn his server application into a container image and link it to the Edgegap platform. This flip-of-the-switch ease-of-use enabled him to deploy his game anywhere in the world in seconds—and meant KungFu Kickball had state-of-the-art netcode along with the 350 server locations available to him within a few seconds of making an API call. Truly the best of both worlds for this indie game developer with big ambitions.  

Get Your Game Online, Easily & in Minutes

Get Your Game Online, Easily & in Minutes

Get Started

Get Started

Get Started