Traditional servers that host games are centralized, giving the authority to change the rules of the game according to their liking. So let's say you've worked on a special ability for your pokemon for months and months and the authority decides one fine day that the special ability is no more special and will be treated as normal. That kind of power is dangerous and should be decentralized. Moreover, you don't even know the algorithm inside out so that you can play according to the algorithm. In a Blockchain based Game, the rules are fixed once the game is made(since the code on Blockchain is immutable) and it can't be controlled by a single authority. The algorithm too, is publicly visible, removing any "insider bias".
Missing in-game assets:- While in-game assets sound stupid to non-gamers, professional gamers take them very seriously and them going missing is a big no-no. But this has happened several times with games like PUBG, GTA etc. Reasons might be server issues or hacks. Blockchain in itself is a persistant data storage system and changing data is not practically possible, so you can be assured that your assets aren't going anywhere. Example of in-game assets going missing:- https://steamcommunity.com/app/578080/discussions/1/1291816569114482592/
Forgery of rare items:- In real life, it's quite common to see rare and precious items like paintings and limited edition cards being forged. Centralized servers too have the threat of being attacked. With the advent of Blockchain, this problem can easily be tackled with concepts like Non Fungible Tokens(NFTs), which can help prove limited existence and ownership of rare items.
What it does
CryptoMon is a Blockchain and NFT based Pokemon Battle Game.
When a player registers, they receive a set of starter CryptoMons with a 1/10 chance of getting a rare shiny CryptoMon(which has an XP higher than normal and there only 200 of these available in the whole game!).
Players can enter a lobby to challenge and battle other players with their CryptoMons.
The game algorithm takes into consideration the XP(rating) of the CryptoMon, the type of the CryptoMon, adds a small factor of randomness and decides the winner of the battle.
How we built it
The whole game consists of 3 components, the frontend, the backend and the blockchain component.
All of the operations happen in real-time and asynchronously via an event-driven architecture.
For the Blockchain component, we used Solidity to code our Smart Contracts and deployed it on the Matic(now Polygon) test network.
The Smart Contracts acts both as a storage of the CryptoMons and Players as well as has to logic to challenge and announce results of battles.
The backend has been built in Node.js. This component listens to New Player events and assigns them their starter CryptoMon. It also acts as a source of randomness for the randomness factor to decide the winner of the game.
The frontend has been built using React.js. Players can register via the register screen, view their CryptoMons and their statistics on their dashboards and participate in battles in the lobby.
Challenges we ran into
We underestimated the complexity of the game, it turned out to be bigger than we expected it to be, yet we're glad to have completed all the main features of the game.
Accomplishments that we're proud of
Managed to complete the product whilst having to juggle between exams and being out of town.
Built something new and interesting that we hadn't previously worked on.
What we learned
Emitting and listening to events via Blockchain.
Non Fungible Tokens.
What's next for CryptoMon
Add a marketplace where players can trade their CryptoMons.
You'll now be connected to the Matic Network. In order to get some fake ether to play the game, go to https://faucet.matic.network/, enter your account address which you can copy from Metamask and you'll have 0.5 ether deposited in your wallet. That's it, you're all set up and ready to play!