Introducing Payloads, a layer 2 multiplayer game built on the xDai chain. It was the first of the FunFair Labs experiments, and our goal was to create a Blockchain Gaming experience with lower gas fees than what is currently possible on Ethereum Layer 1. This included not only gas fees for the players but also factoring in operational overheads for running the smart contract used by the game itself. It was important to develop a game that was both affordable and scalable.
The vision for this experiment arrived at the height of Ethereum Gas fees in the latter half of 2020. At the time, many blockchain gaming projects, including our own Fate Channel casino network, were falling to the wayside due to gas fees becoming increasingly expensive, unpredictable and therefore exhaustive. Today, let’s cover a bit about the game itself, working with xDai and what the team learned from this experiment.
Before diving in, I encourage anyone who hasn’t given Payloads a play to click the link below and sign in or create your very own FunFair Wallet and experience a few rounds. It’s free to play, and the sign-up procedure is completed in under a minute. In no time at all, you can get a hands-on experience of the fastest, multiplayer blockchain game we have made to date. Furthermore, through that same wallet, you’ll retain access to some of our future Labs projects, some of which will require the FunFair Wallet to access.
Free to Play Payloads: here
Sign in or Create a FunFair Wallet: here
xDai: Speed and Scalability… but at what cost?
In the early days of blockchain, the technology itself was heralded for its potential within the gaming sector. Decentralisation, trust and transparency; all new ingredients that offered huge potential to liberate gaming towards a higher level and direction. The buzz was emphatic. Looking back now, it’s interesting to reflect upon how scalability and speed was something most of us overlooked at the time. Perhaps, some didn’t, but the glamour that decentralisation has brought to the table drowned out their voices. Next-generation blockchain gaming was here. And for a while, it worked! Dice were rolled, crypto kitties were born. A new age was taking over. But sadly, the bubble soon burst.
Speed and scalability have been an area where Ethereum gaming has suffered in the past year. With the bulk of blockchain dapp activity taking place on Ethereum, the increased network usage from the growth of the Ethereum ecosystem has led to an increase in the average gas fees paid per transaction and a slower speed of transaction. In turn, Ethereum games that require multiple transactions to be completed within a required time become unviable. Furthermore, creating financially viable gaming systems is becoming more and more difficult. Scalability in the blockchain world focuses on a chain’s ability to support an increasing number of transactions. However, in blockchain gaming, scalability is twofold.
Firstly, yes, we need a chain to be scalable to support our transactions, but secondly, and more importantly, we must be able to pay for the overhead transaction fees that the game contracts require.
Luckily, Layer 2 solutions are stepping in to solve these issues. With sidechains, rollups and other newfangled solutions, not to mention EIP 1559 being just around the corner (August 4th), there is hope on the horizon.
Payloads, built on xDai is an excellent example of this very hope.
Payloads is a multiplayer game full of helicopters, snow and ski goggles! In each round, players pick a tile on a map hoping that our golden helicopters will drop gold coins onto their area of the map. It offers leaderboards, canned chat, and random user avatars. Not to mention a persistent unique random name is generated for each user account from their Ethereum address, some of my favourite names combined thus far; ‘Jammy Wolf’, ‘Ignorant Intelligence’ and my lucky account ‘Outstanding Tree.’ But enough name talk – how does Payloads work on-chain?
Each player’s tile pick is an individual transaction. Tile pick transactions are committed upon user selection. A further two transactions are required to create the game round and commit the random number generator seed. The final transaction is necessary to finish the game by revealing the random number generated, calculating the outcome, and winning payouts.
With multiple transactions required to run a single round of Payloads, GAS transaction costs become an important metric of concern. When comparing running payloads on xDai vs Ethereum, it’s clear that improvements in gas fee reduction and block time speed are possible.
As you can see, xDai is undoubtedly kinder on the game operators coffers. It offers gas fees that have the potential for thousands of users to all be playing at once without much of a financial burden. Additionally, the quicker block speed brings a sense of fluidity to the game. For almost all gaming experiences, speed and fluidity are vital. Who wants to be stuck on a loading screen or to wait for a round to begin? How many times have you exited a game rather than wait out the waiting period? In an on-demand world, audiences simply don’t have the time or the patience to be held up. If blockchain gaming will challenge the mainstream gaming space, it has to alleviate itself from wait times. So it was relieving to see that on xDai, both speed and low operation costs were possible. However, it wouldn’t be fair to ignore the fact that there was an issue with this speed and low transaction costs.
We often found that Payloads ran perfectly with 20 players playing for an hour or so. However, at some point within that hour, the xDai network performance would dip, and in turn, so would the game fluidity. Sadly, chain constipation is a common theme in blockchain, especially in Ethereum or other chains that host or transact with stable coins such as USDT. These blockages are nearly always a result of shifts in the crypto markets. If Bitcoin or other large players incur volatile price action, the entire sector is administered a few minutes of high transaction volume whilst all the crypto traders adapt to the markets. Due to the transaction architecture of how and when transactions are committed in Payloads, the game performance would suffer if the xDai chain is congested. Once the xDai pipes are clogged, the network would slow and misbehave. During these times of constipation, rounds would require a wait time to begin, and the game’s fluidity was interrupted. Other side effects were that some players might have their tile pick transaction mined, whilst others can select a tile but cannot commit their pick to the chain for that round.
The nature of blockchain development is that the bulk of the conception and build process is conducted on test networks. When developing on testnets, it’s easy not to feel the ebb and flow of mainnet blockchain speed and its volatility. Once switching to mainnet, you are exposed to the whims of the main network and what comes with that. For us, seeing Payloads be at the mercy of xDai’s bowel inconsistencies highlighted the importance of transaction architecture. By that I mean, the importance of how and when transactions are required for gaming experiences. Can we group them? Can we remove dependencies from user transactions to game contract transactions? How can we plan ahead for busy mainnet periods? All questions that are highlighted and now in consideration for future projects for our Labs team.
In reflection, I think building Payloads on xDai was brilliant for us as a team. The knowledge and teamwork momentum our Labs department has acquired from working on a new chain is tremendous. It’s liberating to work on concepts outside of the Ethereum chain and see what’s possible. Who doesn’t love to tinker with new toys? And whilst in blockchain land, it’s to get sucked into the idyllic potential that comes with every new thing that blockchain technology has to offer, I still find myself extensively optimistic of what Layer 2 is already bringing to the table. Furthermore, considering the short three month build time, I’m in awe of how much juice we managed to squeeze out of this game. Despite occasional constipation, Payloads really is a fun multiplayer game. It’s perfect for a few mates who just want to sit around, have a laugh and win gold coins… And in terms of meeting our objectives? It turns out, using xDai to build a multiplayer blockchain experience that offers speed and low transaction costs, is possible!
If only for an hour or so!