How to build a blockchain game

Patrick Wieth
19 min readAug 16, 2024

--

or how and why we build CrowdControl

This article will inspect how online games can be build on a blockchain and what interesting pitfalls can occur. The example of this will be CrowdControl, a blockchain based trading card game I’m working on now for a couple of years. However the main goal is to give you insight how to build games on blockchains, whereas CrowdControl is just the thing that comes out of all the learned lessons here, hopefully. This is an article I’m writing without knowing the outcome and final conclusions, so it might be surprising even for myself, haha. Often I learn new things, when I write an article, since it forces me to be really accurate. So maybe we learn together the game I’m working on for years does not make sense, maybe we’ll learn something else, let’s go!

Let me get another thing straight as well: We will not discuss slot machines or some kind of gambling schemes disguised as a game. This exists a lot and these are not real games but rather gambling devices. We will talk about real games, that are fun to play by itself and not just hook us by exploiting our dopamine system. Real games like Warcraft, Starcraft, Hearthstone, League of Legends, Fortnite, GTA or Teamfight Tactics and many more. Of course the line is blurred nowadays, but I’m sure you get the point.

To give you some forecast what will be in this article, here is the list of topics we will cover:
1. What type of games can build with a blockchain?
2. Technical limitations of using blockchain
3. What is CrowdControl? And why??

1. What type of games can build with a blockchain?

Does it make sense to build any kind of game on a blockchain or are there some limits, where it really makes no sense. Let’s take Sudoku for example. The game is singleplayer, you just solve a puzzle, this is already an indicator this might not be for blockchain. Still, it can make sense. In Sudoku there are many different configurations to be played and one could think about putting the game creation on a blockchain.

Sudoku. Does it make sense to have this game on a blockchain?

This means you think about and design a Sudoku puzzle on a blockchain, mint this configuration as a NFT and then others can play your creation. In this approach it makes sense to put even a singleplayer game on a blockchain. In the concrete example there is one big problem though: All solvable configurations can be calculated by an algorithm and letting humans do this task and incentivize it on a chain is not really meaningful. It might still be a succesful blockchain project, because sometimes projects manage to promote useless bogus and sell it, before everyone realizes what it is. The best example to this are meme coins of which a lot exist.

Source https://roomescapeartist.com/2020/06/13/defense-sudoku/

The other option is to make challenges out of a configuration. So if you start a game, the blockchain randomly picks a Sudoku and then you have 5 minutes to solve it. To start a game you have to lock some coins and if you win you get some extra. If you don’t solve the game, you lose your locked coins. Again this makes no sense, because Sudoku can also be solved by algorithms in very short time and then this is very exploitable by bots.

So now we have learned about a singleplayer example, for which already two approaches to put it on a blockchain exit. However for Sudoku this makes no sense. We still have learned some concepts and can apply these to other games. So is there a singleplayer game, where this makes sense?

Super Mario Kaizo — community generated super hard to beat Mario Levels

Sure, let’s just take Super Mario, a jump and run game. Some players could design levels and think out interesting parcours and others could play these levels, try to solve those. The blockchain has some nice advantages here, for example in order to publish a level, the designer must first solve it herself. This prevents troll levels, which are unsolvable. Nice. What about the other option, challenges? Makes sense here, even with the aspect of speedruns in mind, it might be interesting to beat other players in solving levels fastest. The blockchain then puts a frame around these challenges and allows to bet on attempts and similar things. Of course there is the problem again that some people might write bots, which are superhuman strong in solving these levels and just scoop all the rewards and bets.

This is always a problem and has not really to do with blockchain. Even in World of Warcraft bots farm items and sell these online. And WoW is a complex game. So even moving from the complexity of Sudoku to Super Mario or even WoW does not change this problem, it only changes on which level of popularity a game starts to have botting. So this problem must be solved in other ways (Captchas, bot pattern detection etc.).

Mushrooms generally enhance experiences.

Unfortunately, I have committed a tiny lie, saying we are discussing a singleplayer game and then turning it into multiplayer by making different players interact with each other. The point here is that such a thing will always happen, because blockchains in essence are engines of consensus.

Blockchains always have to do with multiple entities, if not, there is no reason why you need a blockchain. Consensus always happens between different persons. I mean, it can be that a person is torn within herself and wants to find a consensus, but it is questionable how a blockchain can help here. This is absolutely crucial to understand, blockchains are engines of consensus and if the problem you are about to solve has nothing to do with consensus, then blockchain is not the answer.

An example which does not really need a blockchain. Or let’s be more exact: It does not need blockchain to solve any problems, blockchain is just a good platform to make money with a product that has no substance.

So let’s be more specific on what we call a singleplayer game. A singleplayer game is for a single player inside the game. So our examples of level creation interaction or speedrun interaction are both interactions outside of the game. While you play there is no interaction. Chess in contrast is always a multiplayer game no matter which scope you pick. By that definition Trackmania Nations/Sunrise is also a singleplayer game, because there is no interaction between the racing cars even if you play at the same time.

Which brings us to the next example, Chess. If you guessed that this will be the next example, then you are actually smart enough to read this article. If not, no worries, just keep on reading.

Chess — undoubtedly a multiplayer game. It is also deterministic and a game with perfect information. Is this relevant? Let’s find out.

Chess is a very good example, because this totally works on a blockchain. Having games on blockchains often implies technical limits and Chess has no problem with these limits — we will cover this in the next section. So putting Chess on a blockchain is really straightforward, two players commit to a game, every move is posted on the chain and then the chain checks if there is a winner or if someone gave up. This is a third variation, competition. The game creation part makes no sense for Chess, because the game always starts in the exact same configuration. The third game mode “Challenge” does not apply to normal Chess, but there are Chess puzzles, where you have to win the game with a fixed number of moves. As chess is a deterministic game with perfect information this has exactly the same problems Sudoku also has, so we will not repeat this. Of course botting is also a huge problem in normal Chess, if there is some money involved. Since Chess computers do exist and they beat world champions.

Starcraft — a multiplayer game without perfect information(source Blizzard)

What about other multiplayer games? Let’s have a look at things like Starcraft, Warcraft, Command & Conquer, you know, the good old real time strategy games. These games share the feature of competitiveness with Chess, so it should come out as the same. But they differ in that not every starting configuration is the same, factions are asymmetric and the real-time aspect brings a lot of technical limitations. Different starting configurations might open up the possibility for game creation interaction. Great, but what is the real-time problem? Imagine you’d have to post every state change to the blockchain. For these games at least 10 happen per second. Blockchains have block times of seconds if they are fast. So even fast blockchains are too slow. So this real-time problem is a real problem. We will discuss solutions to this in the next section.

Well, then let’s do Poker, things happen slow in Poker. Decisions are made over many seconds, so should work for full blockchain integration? Yes, in some sense, but there is another pitfall. In real-time strategy games there is something called fog of war. In Poker it’s just not seeing the hands of the other players. Unfortunately blockchains are very transparent and one could inspect the game setup and know what cards others have. So here again a solution must be found and we will look at it in the technical chapter. Yes, I know, I’m building up a lot of tension and this is something a reader might not expect from such an article. But it could be worse, I’m not using cliffhangers which do not let you know if some main actor of our story died or not.

Poker, slower than real-time strategy but also with hidden information. © happy_author/stock.adobe.com

But let’s come back to the real-time strategy games. Competition interaction works the same like Chess, but what about game creation interaction? This is a bit dull, since sure there are maps, but most of the time 3–4 maps emerge which are played almost all of the time. So this might not be very interesting in these games. But there are other possiblities as well. For example in Warcraft III maps were not just made for competitive play under normal game rules, but the game rules were altered. Some of these maps were so popular, that these are still played today. The most prominent example is DoTA, from which a whole genre has emerged, the MOBAs to which League of Legends and obviously DotA 2 belong. The same applies to battle chess type games like Teamfight Tactics. So there would be a possibility to put these maps as creations on a chain.

DotA Allstars — not the first of its kind, Aeon of Strife existed before it, but the most popular one. An ultimate testament to what is possible with Warcraft III map editor.

Another option is to create units. Since these games are not set with a fixed configuration from the start, but rather units are build while the game progresses, it is possible to introduce new units. So one could think about a game, where players can design new orks, catapults or space ships to fight each other. However there lies a cursed problem as Alex Jaffe from Riot Games calls it (https://www.youtube.com/watch?v=8uE6-vIi1r). A cursed problem in game design is a set of design goals which cannot be achieved at the same time. In our given example letting players create units in competitive games brings the following problem:
A designer of a new orc wants it big and strong and easy to build, just imbalanced as hell, because your own creation should be impactful. But a game is only interesting if it is balanced. So giving the design of units into the hand of players drives insane imbalance, which makes the game unfun.

Minecraft — a game which has been enhanced tremendously by its community via mods. Source: pcgamesn

This is not a problem in non-competitive games. In Sims, Minecraft or Factorio this is not a problem. Someone can design a new game element that breaks the game. Because you can just avoid this element and not include it into your game. But in competitive games the opponent can chose to play against you with this creation that breaks the game. Here we see an inherent problem of game asset creation in competitive games, that is much less severe in cooperative games. However in cooperative games it is also necessary to gatekeep these additions.

So remaining are cooperative games, which work on blockchains, but of course become a bit more competitive, since there might be competition for ressources in some sense. If you take Sims on a blockchain, then some property for real estate might be more valuable and similar things. It can be a real problem, because these games can suffer very fast if things like this happen. Since creativity is at the center of games like Sims, showing players they have to compete for ressources to be creative can ultimately kill the fun of being creative and turn it into a grind. This always depends on the exact game design and of course what type of blockchain interaction makes sense. But creating assets and using these is a pretty clear usecase and the concept of a metaverse is on everyone’s lips. Here we are basically talking of games where the creation of game bound NFTs is at the center and trading these between players is crucial. This can be just for building your virtual home and having nice NFT clothing in the metaverse or fighting with weapons or pokemon like NFTs in games like Diablo, Path of Exile or Pokemon. The blockchain examples are already in existence, like Axie Infinity.

Factorio — just like Minecraft is so much bigger with all those mods from the community. The developers often take ideas from mods and put those into the official version. From this we can see some interesting problem: Consensus on what should be included for everyone. Source: reddit

Summary of this section:
Singleplayer games can be build with blockchains only if some kind of interaction is introduced either via game creation interaction or challenges. Competitive games work great but can have big problems with game creation interaction. Non-competitive games work, but can become competitive through fighting for ressources. NFTs are a core concept that can be used in games.

P.S. oh I forgot something important, because this article is about blockchain, many arejust reading this to learn how to get rich faster. Well, err here is some get rich faster advide: If you see a game, that is actually running on a blockchain but is true singleplayer. Well, this is very likely a slot machine or other type of gambling device. There is no point in putting such a thing on a blockchain if you want to create a good game. The only point to put such things on a blockchain is because your money is readily available and gambling laws might be bypassed. Don’t lose your money gambling. This is the ultimate advice that no gambler has ever heard, haha.

2. Technical limitations of using blockchain

Well, we already learned a lot about these and the most common one is transaction or throughput limitation. This is really no surprise since this is already a problem for blockchains which only transfer coins between users. So for games which have several state updates every second there is no way to capture all that on a blockchain. Either these updates are captured on a second level chain, which then only posts concluding states after a long time or the game server becomes a trusted entity, which posts updates from time to time on the chain. The first second layer concept means that for example every game is on its own “mini-chain” or channel and once the game closes, only the result is posted to the first layer blockchain. The difference between the 2 presented options here is not that big. This is because both reduce the decentralization a lot. For most game devs it might be a lot easier to have a trusted game server, which can post game results on a blockchain. So for Chess this means the server only posts the result of the game on the chain or maybe also the moves, but each move is done directly on the server, so Blitz Chess is possible.

State channels are a typical solution not only for games. source: https://research.csiro.au/

For Poker we have seen another type of problem, which is also solved by such a server and might not be solved by a second layer. A server could easily hide the game information from the players. However there is a problem, with the amount of money involved in Poker, trusting a server might not always be great, since hacking happens. So is there another solution? Yes, chains that implement zk (zero-knowledge) protocols. This is some crazy stuff, where you can proof that you know something without revealing what you actually know. This reminds me, that I have to write an article about how zk crazy stuff works. This allows poker to be played completely decentrally but without the ability to cheat and see the hand of others. It often comes with quite high transaction fees, so might be problematic for low stake Poker games, but not if you build a blockchain dedicated for poker games.

I couldn’t find a useful image showing zero-knowledge algorithms/proofs, so I let AI create another useless one.

So basically all games that have a real-time aspect, might it be shooters, strategy, MOBA or just GTA, cannot post everything on the chain. They have to rely on something that is off-chain and processes the game interactions.

Another important thing is fees. If you have a game where you collect and find items which have a value of $0.1 or $1 and fees are $30, then the awesome feature of trading and sharing with others is basically not usable. So the first thought here might be to pick a chain with low fees. But I would give the advice to go with your own chain. It depends a bit on the game, some can totally work on an established chain, but games that are hosted on their own chain have the fee problem ultimately solved. Fees basically mean competition for block space between different users on the blockchain. Users who transfer a lot of money are willing to pay more fees than those who just play a game. If all users on a chain basically play the same game, then the competition for fees is totally different.

Network fees can vary :D (source https://x.com/coinmarketcap/status/1481448979997069312)

Another important thing is governance. A game that is hosted on their own chain has a completely different level of governance. Fundamental things can be changed, rollbacks in case of catastrophic events are possible and most importantly you don’t go down with the ship. What do I mean with this? The collapse of UST and Terra is a prime example. If you have build your game on Terra and your users use UST to transfer value, then after the crash you have basically lost everything. This is not nice. “But I want to have these external assets, stablecoins etc. in my game!” no problem, if you build with Cosmos you can transfer these assets via IBC on your chain and use them, but still your chain survives after such a collapse. The big downside of this is of course more development time is needed for a chain and the infrastructure is more costly. If this is a problem you can still build your game as a dapp first and then move to a app specific chain if there is interest in the game.

Visualization of the vision of the early cosmos ecosystem. Good old times.

Unfortunately Cosmos has changed over time and did not stick to its initial goal of enabling app-specific chains very much. Therefore gaming infrastructure was not really build. When I started to write this article, I was still full of hope, that Cosmos might continue to evolve as it has done, but now this has changed and I’d say, it is no longer a no-brainer to just go with Cosmos.

Summary of this section:
Transaction througput is a concern, especially if your game is a real-time game. Fees can be a problem, but actually have the same root. If you need updates more than once a second, you have to move these off-chain. For all these problems, solutions exist. Build on your own chain if you can and there is no ultimate need for using smart contracts. However if you just build a bad game that aims to collect some money and that’s it, it might be best to just go with a big network and ignore all the downsides. If you want to build a truly awesome game, follow along.

3. What is CrowdControl

So after all these realizations I thought about what kind of game I want to make using blockchain. And I came directly back to the cursed problem mentioned above. Because I like competitive games, but I also like being creative and creating new stuff in games. So I had to think about how to solve this cursed problem and if blockchain can be of help here. Let’s think about how this process normally happens:
Some game designers create some new hero in League of Legends or a new tank in a stragegy game and then the players play it. The hero might be totally overpowered and then players complain about it in boards, on youtube or twitter. The game designers realize this and then nerf the hero, (nerf = make weaker). This can also happen in the other direction if something is too weak, then the game designers make it stronger.

New heroes are added to League of Legends periodically. Often these are too strong and must be nerfed. Over time Heroes, whose power level was ok, becomes too low over time, this is called power creep. Source leagueoflegends

Also it might happen that such a game evolves over time and something that was strong in the past has become weak because all the new stuff is just a tiny bit stronger, this is usually called power creep. It often happens into this direction because making new stuff a bit stronger incentivizes players to spend money on the new stuff. But at some point it becomes necessary to adjust the old stuff to the new level, which is long term balancing. What we see here is a loop of interaction between game designers and players, a constant exchange of adjustments and evaluation.

This process can be automated. If we move it on a blockchain, then we can collect the feedback of players on game elements and thus buff (make stronger) or nerf these elements. I think there are 2 different ways of doing this. One way is letting the players explicitly express their evaluation. We call this voting. This is the automated equivalent of ranting online about overpowered things and seeing how many upvotes such a rant gets. Upvotes can also be in the form of retweets or board responses in a forum. The other way is to draw conclusions from statistics. If something occurs very often for winning players, this might be overpowered. This approach has the big upside that it is not distorted by human emotion and perception, but it also has downsides.

Is the next evolution in gaming empowering players?

One downside is that if some elements are rare or are not used then they might not even appear in statistics and the engine will never find out if it contributes to won or lost games more. Another downside is that some items might be utility things and are not necessarily overpowered. So for heroes in LoL this might not apply, since all heroes are on the same level, you only pick one per game and play that. But it applies to the heroes items, some might be useful for play and very often appear in the inventory of succesful players, but not because these are overpowered (OP) and make you win but rather because they provide a better game experience and were added to the game as “quality of life” features. For example a potion, which lets you see invisible things. Everyone uses it and if you don’t, you just lose to stealthy shenanigans. So in statistics this item is highly correlated with winning, but it’s just a default tool of the game and nerfing it may lead to a situation where everybody starts playing stealthy champions and so on. Other statistical biases can be found as well, for example if looking at Magic the Gathering, then your balancing algorithm might find out that Islands are the strongest card. For everyone who does not know Magic the Gathering, this is a trading card game, where you play lands, which give you mana and that let’s you play spells and creatures. There are 5 basic lands, to which the Islands belong and all of them do the same, give you a single mana just in 5 different colors. So neither of these lands are overpowered, since they all do the same and are the basic piece of economy. Every deck consists of 30% of these lands and if the color blue is overpowered, then Islands are by far the most common cards in winning decks, even though the Islands are totally not overpowered. But the color these Islands are associated with might be overpowered. In such cases a balancing algorithm might fail, whereas players are better to identify the broken part of a game.

CrowdControl — a trading card game as deep as Magic the Gathering, but also as accessible as Hearthstone.

But in my opinion the biggest downside is that these algorithms do not make use of the consensus engine a blockchain is. By voting players express their opinion, collecting votes and finding the most popular vote creates consensus. This allows players something that is truly unique and is what we want to achieve with CrowdControl. A game that is developed by the players. The players can also unite and nerf something out of the game, that is not too strong, but unpleasant to play. It is possible to change the game to whatever the players want. At this point a very typical response is “but players are idiots, they will not create utopia but dystopia, they will destroy everything”. To this I can only respond, that this is the ultimate discussion if democracy works or not.

An interesting view on democracy.

We believe at CrowdControl that democracy works and want to find out what happens if the players are empowered.

That is why we are creating a blockchain, where players create their game, balance it and write their story. We think this is something new, which is enabled by blockchain and sadly most blockchain games are just about extracting coins from their users instead of giving them a voice. We all love having an opinion and playing games, so why not combine the two things together.

We are not just building a game, but the whole blockchain solution that has all those features of self-developing and auto-balancing. We believe in empowering games, so if you are building a game and want to use our technology, come and let us know!
If you are interested in playing our game, also come!

This linktree has all the places you can go to: https://linktr.ee/crowdcontrolnet

Infinite fun awaits!

The fastest way to get in contact with us via Discord.

I really like this topic, so I think I will write more about it. I was very busy in the recent years building this stuff, I was talking about above and I hope you could learn some interesting thoughts here, even if you find what we are doing totally boring.

--

--