How to Make More Impressive Decentralized Games

Erick de Moura
Cartesi
Published in
7 min readOct 24, 2019

Imagine a fully decentralized tower defense game built on a public blockchain. Players could compete in tournaments and earn cryptocurrency as rewards. A game like this would require billions of microprocessor instructions. With today’s on-chain technology, this would be orders of magnitude above what’s currently supported. It would be like trying to play Call of Duty on a Mac Classic. 4 MB of RAM just won’t cut it. Even if developers could have the necessary scalability they’d still be unable to use their favorite software stacks, engines, and libraries that are integral to their programming toolkit. They would still be handicapped without these tools, unable to build compelling blockchain games.

How do most developers solve this problem? They compromise on decentralization. They might run the complex game logic on a cloud server while only using the blockchain to finalize some transactions or assign ownership of in-game items to players. These games trade decentralization for efficiency. It might work, people might play the game, but it’s no longer decentralized.

And who can blame them? The technological alternatives just aren’t there yet.

Cartesi is that alternative. We are currently building that Tower Defense game. We chose to use a popular programming language, TypeScript, to code the game logic. In fact, we could have used any language, framework, or library to develop our DApp, without ever sacrificing on decentralization.

With Cartesi’s infrastructure, the entire game logic runs off-chain in a fully reproducible Virtual Machine (VM). This VM guarantees that any honest player is able to defend themselves against dishonest opponents. Disputes, in the rare case they arise, are resolved through a Truebit-like Verification Game. This Verification Game keeps on-chain computation costs negligible, as all that is processed on-chain is a logarithm of the original computational effort that was completed off-chain. In other words, Cartesi does the work off-chain and then transfers the results on-chain deterministically so that anyone can confirm the legitimacy of the computation.

We have built a fully decentralized game that involves large processing and mainstream software components. Problem solved.

This represents a massive improvement for decentralized infrastructure and for game developers. Here’s why that matters:

Video games today are siloed. They’re closed systems. Game economies are confined to their in-game environments. Valuable assets, characters, land, tools, and avatars — while earned through hours and hours of playtime — have no real-world value and are non-transferable. Gamers are stuck in consumer roles, supporting them only through their purchases. Opportunities to be involved in the development and production of their favorite games are rare. Mods are developed only by altruistic gamers that receive little reward for their efforts. Games today are just that, “games.” They can’t transcend the confines of their four walls and pixelated screens.

In many ways, the evolution of games seems to mimic the segregation of computers before the Internet. Before people fully comprehended the impact of an interconnected, global network, what existed was a disjointed and disconnected set of personal computers and mainframes. Prior to technological advancements like ARPANET and TCP/IP, computers ran independently, incapable of communicating with a larger network. Just as computers sat isolated and alone prior to the Internet, games today are just as isolated.

That’s why decentralization matter for games:

Reality: Gamers are stuck in a consumer role.

Vision: Gamers can become co-creators and stakeholders of their favorite games, helping to fund initial development and assist through open-source contributions. They will be rewarded with in-game assets, profit sharing, and fractional ownership.

Reality: Game economics are isolated from the outside world and from other games. Game studios forbid secondary markets of assets.

Vision: Game economies can transcend individual games. Players could own what they’ve earned and trade or sell items through free-market asset marketplaces. Games could support transferring characters to new game editions or even to different games entirely. Already, Cryptokitties can be transferred to other decentralized games. They can be used as collectibles in GodUnchained or be summoned in the upcoming Cheeze Wizards game.

Reality: Companies have complete control over games. Even though players paid for the game, if the company discontinues the game, their access ends. Games also cannot interoperate with each other or share states.

Vision: With decentralized frameworks, games could be forked, re-skinned, and modified. Original creators wouldn’t have censorship power over the future direction of the game. Internal game states could be used by other games. Other developers could build complementary applications on top of the game — assets exchanges, item lending platforms, and item history trackers. An open-source standard for games would encourage truly collaborative efforts where multiple developers and gamers could build and create, transcending the original scope of the game.

This is how blockchains or other consensus networks help:

Open-source + Blockchain: Blockchains take open-source software to the next level. Traditional open-source standards provide ever-evolving composable components but they depend on someone running the code. With open-source software today, code is shared but the runtime is not. By combining open-source with blockchain, we can create a system where both runtime and states are shared. DApps are connected through open interfaces, owned by no one, and censorship-resistant.

True Digital Ownership: Unlike with current games, assets on blockchain-based games actually belong to the players. There is true digital asset ownership. Assets are transferable between games or sold on open exchanges, boosting in-game capabilities or improving social status.

Currently, in mainstream games, players do not own their assets and have no recourse with the company when things go wrong. For example, Hearthstone today is one of the most popular online games. They broke 100 million users last year. Gamers can pay for an in-game advantage in the fantasy card game by purchasing Booster Packs. Players purchase these game cards and yet, they do not own these cards. Blizzard, the creator of Hearthstone, can create an infinite number of cards and manipulate them at will, altering prices dramatically. Players have no ownership record and items are essentially on-loan for the length that the company maintains the game.

Unfortunately, blockchain is still limited by:

Bad user experience: Decentralized apps and games struggle to attract mainstream users because the entry barriers are high. Users need to manage their own keys, obtain tokens from exchanges, and navigate confusing regulatory environments. Even if people overcome these obstacles, the applications themselves are clunky and inefficient.

Very tight computational limits: Blockchains are extremely inefficient and large computational tasks are very expensive. Blockchains suffer from further inefficiencies such as low throughput, a high propagation delay, and long latency to finality.

Very limited storage on-chain: The cost of storing information on-chain makes blockchains expensive and inefficient candidates for storing anything more than basic transactional data.

No support for OS and mainstream software components or stacks: When building on a blockchain, developers don’t have access to all of the stacks, libraries, and tools that they’re accustomed to using with mainstream operating systems.

For example, think about decompressing a file on Ethereum. That’s an operation that every developer takes for granted. It’s easily done on a traditional operating system. However, even the concept of a file doesn’t exist on Ethereum. Even if it did, the computation would cost exorbitant amounts. Computations do not scale on blockchains, and thus, complex apps are impossible to build.

This all amounts to a terrible game-development platform.

Because of these major limitations, as outlined earlier, some developers opt for a hybrid approach; not really decentralizing the game, but only establishing a bridge with a blockchain to provide asset ownership to players. Unfortunately, this approach doesn’t achieve any of the major benefits of decentralization — if the game dies, the asset becomes worthless. Game companies still have full control over asset issuance, making in-game asset scarcity questionable, and undermining the asset’s value. The company can even change the laws of the in-game worlds, further changing the value of assets. The community has no recourse available. Games cannot be forked and the game cannot benefit from the creative collaboration of the community. This is not decentralized game design.

The reality is that fully decentralized games are still difficult to develop and restrictive for developers and for players. The benefits are promising but leaps must first be made in the available infrastructure. In that sense, we are thrilled to bring Cartesi to the table as a significant step forward.

A TLDR about Cartesi.

Cartesi is a second layer system that moves complex computation off-chain while preserving the security guarantees of the blockchain. Such computations run on a deterministic RISC-V emulator, capable of booting a real OS. In case of disagreement, Cartesi relies on a Truebit-like algorithm for dispute resolution. In other words, Cartesi brings Linux to blockchain applications.

Once developers have a decentralized Linux infrastructure, they can use 30 years of open-source software evolution. The Cartesi engine also unleashes enormous computational power. With Cartesi, game logic processing is performed off-chain, while the security guarantees of the blockchain are still maintained. Cartesi could offer a best-of-both-worlds solution to game devs: an efficiency closer to what exists for centralized games with the decentralization of native blockchain games.

In the next weeks, we will be rolling out the first version of our Tower Defense game with an in-depth article exploring the architecture of our system. If you are a developer, it should be easy for you to use our game design as a template for your own first decentralized tournament!

For a deeper technical understanding of Cartesi, please read “On Linux and Blockchains.”

We are eager to hear from you and welcome your questions and thoughts. The best way to reach us is through our Discord channel. Additionally, if you feel like collaborating in any way, please don’t hesitate to contact us.

Follow us here:

https://cartesi.io

Discord (Development Community)

Github

Telegram Community

Telegram Announcements

Facebook

Medium

Reddit

Twitter

Youtube

--

--