Bandai Namco Entertainment announced the latest entrant in its series of Dragon Ball games this week. Dragon Ball Legends is a player versus player (PvP) mobile game that has players from all over the world battle with each other in real time by using their move cards. From all I’ve seen, it looks like a pretty fun game, though I know nothing about Dragon Ball and I have an unreasonable disinterest in card-based games. What made me perk up, though, was when I heard that Bandai Namco opted to use Google’s Cloud Network to host all the infrastructure for the game and that one of the main components of this system is Cloud Spanner, Google’s globally distributed database.
To make a real-time game work at all is hard enough, but Bandai Namco wanted players from all over the world to be able to play against each other. There’s a reason most games distribute players into regions based on their geography, though. In a real-time game, latency matters, as every hardened PUBG player will tell you, and the farther you get away from the game server, the higher your latency will likely be.
As Bandai Namco’s Keigo Ikeda and Toshitaka Tachibana told me ahead of the launch, the team opted to divide every game second into 250ms intervals, so while the game looks like it’s real-time to users, it’s actually a really fast turn-based game at its core. “Technically speaking, to the user’s eye, it’s real-time, but on the server, players have their own turn,” said Tachibana. By opting for the Google Cloud Platform and Cloud Spanner as the database to keep track of all moves, the average latency the team has seen during its tests is 138ms, which allows for plenty of wiggle room.
To make all of this work, the team spent almost two and a half years building out the necessary infrastructure, and Tachibana admitted that the team learned quite a bit more than it expected about network latency. During early tests, the team wanted to create a peer-to-peer connection to have players battle each other, for example, but depending on the carriers, the difference in user experience varied too much. The team also had to learn how to best route traffic between players, something that most gaming developers don’t really have to think about most days. “We were pretty frustrated with everyone who wasn’t Google,” said Tachibana.