PIONEERS

Groundbreaking Blockchain OS Projects — Decentralized Battleship Game.

A series on the Web2 and Web3 pioneers on The Blockchain OS.

Cartesi Foundation
Cartesi

--

Groundbreaking Blockchain OS Projects — Decentralized Battleship Game.

Productive developer Lachezar says his start with blockchain was a cinch. There was lots of documentation provided by Cartesi and he was able to gain most of his blockchain knowledge through actually developing his decentralized apps and not having to go through learning all the intricacies of Solidity first. The Blockchain OS provides developers like Lachezar with a Linux operating system: the framework, languages, and libraries that can run on it. This meant freedom to bring his ideas to reality on blockchain — without feeling the limitations of Solidity.

For Lachezar, it wasn’t just an interesting experience, but a chance for him to help others get on board with blockchain too.

No Solidity

“What I like about The Blockchain OS is that I don’t really have to deal with the blockchain. I’m able to use programming languages that are already familiar to me, such as C++, Python, and JavaScript, which is great! The Cartesi Machine hid all the complexities of the blockchain, and that makes the development so much easier.

I have no real experience with Solidity, I’ve taken a basic course to get familiar with it and found it very limiting — at some point, I need a higher expressivity level, like parsing strings for instance. In Solidity, I can’t just use something like Python’s substring method. So when The Blockchain OS provided me with a full Linux operating system, it felt freeing. I’m able to use the framework and languages and platforms that can run on Linux and not feel frustrated or restricted.”

A decentralized battleship game

“With an online version of the classic Battleship game, secrecy is extremely important — if you figured out the other player’s boards, you’d just win straight away. In an online version of battleship, you have to trust the server processing the game isn’t doing anything nasty to you; that it’s not giving up your position for example.

In general, there’s a lot of cheating in battleship games (just Google it and you’ll see). With a decentralized version like the one I’m building, we used this protocol in which we encrypt the board configuration and send it when the game begins so that no one can see the board but they also can’t lie about what was the initial setup of the ship’s positions.

During the game there’s trust, but if there’s a dispute, like when player A has the impression the other is cheating, player B has to reveal what their actual board was. And the blockchain will show who was right. So, despite being on the blockchain, the players can’t access each other’s positions because it’s kept encrypted until the end of the game.”

Blowing up the processing power

“Creating a decentralized battleship game is tricky with smaller amounts of processing power. Decrypting the whole board means you have to go through all the moves — you have to reproduce all the game validates from start to end. And that simply doesn’t fit with a single blockchain transaction, so you would have to perform multiple actions, processing this in chunks. And you’d have to make sure each transaction is correctly processed before proceeding to the next chunk.

With The Blockchain OS, because of its enormous processing power, you can process the whole game at once. No need to worry about dividing it into smaller chunks constrained by the blockchain transaction computational limits.”

The future of battleships

“For now, the goal is to create a stable first version of the game, a traditional version. But in the near future, we imagine seeing multi-player versions, or versions with a variety of customized rules. For example, players could decide to alter the size of the board, change the kinds of ships they’re allowed to play with, add additional submarines, and create special boats with specific powers, such as taking 2 hits on each specific section before they blow up, or bombs that blow up two squares at a time.

Developers can really play around and make this classic game more elaborate by building off ours. Additionally, we’re building a platform for developing board games that are turn-based. With our framework, people will be able to develop a board game even faster because they’ll start from a higher level of abstraction.

Imagine even using machine learning to create a battleship bot that can play against you, or probabilistic physics/mathematics libraries to determine something that will happen in the game. You could even include real-life influences such as wind and weather! It would be interesting to create these more complex layers in the game, and make this an overall richer experience.”

NFTs, the good, the bad, and the ugly

“All these great ships and custom assets could be turned into NFTs of course. The NFT itself is generally decentralized because it’s an asset on-chain. But here’s something I’ve learned — what the NFT represents isn’t always decentralized. The game platform can turn a very powerful NFT into a bad NFT by just flipping their meaning on the server without anyone agreeing to this in the community.

A lot of times, players are often left frustrated because one of their favorite characters or items or something is nerfed, and they don’t have a say in the matter. When there’s no alternative, you’d either continue playing or stop. With blockchain games, you can stick with the version you’re playing, even if you don’t agree with the changes the developer has made. Or you can just create your own version!”

Game community power

“Balancing a game is challenging, important, and generally done in a centralized fashion. For example, if I’m matched with someone that has this super ship that I don’t have, I’m probably going to lose because I’m overpowered. Traditionally, the developer will balance that within the game.

But with blockchain and decentralized governance, you can have players voting for balance using a DAO. So players can decide to collectively increase the powers of a specific ship, or collectively make it weaker. This way, the gaming community is driving the balance of the game. And that’s very different from a centralized game, where the developer must be the warden of the game, increasing or decreasing the power or something for the game to reach some equilibrium. Now we can have the community do that instead.”

Want to hear more from developers building on The Blockchain OS? Check out how Web3 newcomer Aleksander is finding ways to protect a creator’s rights using blockchain technology:

About Cartesi

The Blockchain OS is a decentralized layer-2 infrastructure that supports Linux and mainstream software components. For the first time, developers can code scalable smart contracts with rich software tools, libraries, and the services they’re used to, bridging the gap between mainstream software and blockchain.

Cartesi is enabling millions of new startups and their developers to use The Blockchain OS and bring Linux applications on board. With a groundbreaking virtual machine, optimistic rollups, and side-chains, Cartesi paves the way for developers of all kinds, to build the next generation of blockchain apps.

Welcome to The Blockchain OS, home to what’s next.

Follow Cartesi across official channels:

Telegram Announcements | Telegram | Discord (Development Community) | Reddit | Twitter | Github | StackOverflow | LinkedIn | Facebook | Instagram | Youtube | Cartesi Improvement Proposal (CIP) | Website

--

--