You’ve probably already heard about NFTs, even if you haven’t really strive for it. Popular trends tend to penetrate all parts of the information space and catch the eye of everyone, regardless of the level of interest.
But since you’re reading this article, it means that you’re definitely interested in what NFT is and how to make an NFT game.
NFTs are used in many industries. In 2021, the Hermitage opened a digital art exhibition where 38 NFT projects were presented. Twitter founder Jack Dorsey sold the NFT token of his first tweet for $2.9 million. Artist Mike Winkelmann received a record $69 million for his NFT painting.
Join us in showcasing the cryptocurrency revolution, one newsletter at a time. Subscribe now to get daily news and market updates right to your inbox, along with our millions of other subscribers (that’s right, millions love us!) — what are you waiting for?
What are NFTs?
Tokens, in turn, represent a ledger entry on the blockchain. These are units of asset accounting, analogous to shares on the stock exchange. A distinctive feature of most tokens is the principle of fungibility. It can be compared to a currency, including a cryptocurrency: one dollar or one bitcoin can be easily replaced with one dollar or one bitcoin belonging to other users.
But not all digital assets are fungible. Unique objects, such as a Leonardo da Vinci painting, cannot be identical to a Paul Gauguin painting, even if they are theoretically similar in appraised value. To transfer unique elements to the blockchain, a non-fungible token format was created.
Each blockchain has several standards that you can consider as a template for the function you will use in the smart contract. Smart contracts are self-executing pieces of code stored on the blockchain. Each standard offers certain features and attributes that must be filled in when creating an NFT.
The original non-fungible token standard was ERC-721, built on Ethereum. It continues to be the most widely used blockchain platform for building and running NFTs. It assumes that an asset has certain attributes or characteristics that make it unique and rare.
Other standards less common on the Ethereum blockchain are ERC-998 and ERC-1155. They have similar characteristics to ERC-721 but can contain both non-fungible and fungible tokens. ERC-1155 tokens allow users to register fungible (ERC-20) and non-fungible (ERC-721) tokens using the same address and smart contract. This feature can be very interesting for games where fungible in-game currency and non-fungible collectibles can be kept together.
Other token standards, such as ERC-1190, which offer the creation of flexible and complex NFTs, have already been submitted for review and are awaiting approval.
Flow owes its existence to CryptoKitties. CryptoKitties is an NFT-based game that allows users to buy, sell, collect, and breed digital cats. It was launched using ERC-721 tokens. It became so popular that it started consuming more Ethereum blockchain resources than originally planned.
The Dapper Labs game development team solved this problem by creating the Flow blockchain. It was designed specifically for crypto-collectibles and games.
Smart contracts in the Flow network are written in the Cadence language. Flow makes it possible to use updatable smart contracts. These smart contracts can be deployed in beta and then incrementally upgraded by the original authors until they are satisfied.
Tezos is a multifunctional decentralized blockchain platform with support for smart contracts and the ability to create tokens and decentralized applications. Tezos has its own cryptocurrency called Tez and a non-fungible FA2 standard that provides more flexibility for handling in-game elements.
There are other blockchains, such as Palm and Solana.
Palm Blockchain is a token-based NFT ecosystem that is connected to Ethereum and features low gas costs and fast transaction completion times. It focuses on building an NFT ecosystem for culture and creativity.
Solana is the world’s fastest open source blockchain and the fastest-growing cryptocurrency ecosystem with thousands of projects. It aims to use several revolutionary technologies for the next generation of dApps (keep reading to learn more about dApps).
What Are NFT Games?
We’ve already talked about special token standards for games – for example, Ethereum ERC-1155. Not only developers, but also players can benefit from NFTs. For example, they have the opportunity to sell in-game NFTs to other collectors and players, thus earning cryptocurrency and money.
Let’s looks at the FPS blockchain game Undead Blocks. Our team created art for it, including characters and weapons. The game offers zombie killers to expand their arsenal of weapons with NFT options and even whole packages at attractive prices.
NFT games are mainly featured on Ethereum. To start playing, you need to make some kind of contribution, such as purchasing an NFT in-game product that you can play with. By playing this item or character, you increase its uniqueness and can later sell it to another player or collector for a higher price.
Some games don’t require a contribution and are partially free. Usually, they work on a pay-to-win system, when there is a certain part of paid game assets that significantly speed up game progress. So the players have a choice – buy the items and secure the victory, or rely on their patience and a pinch of luck at no cost.
For example, you start without investments and develop your character through various actions. Over time, its value will increase. In addition, almost every game has mechanics that allow you to earn bonuses – drawings of tokens within the game, competitions that can also generate income, etc.
The features of these games are that you can earn money in them, monetize your gaming experience, and develop the blockchain ecosystem. There are also disadvantages: you need to invest in them, earnings depend on cryptocurrencies and sales of in-game assets, and these are risks. Gamers must constantly improve their characters and most often buy add-ons to win. On the other hand, the cost of upgraded characters can reach crazy values. For example, the most expensive creature from the NFT game Axie Infinity was sold for a modest $1,076,100.
How to Create an NFT Game: Preparation Stage
How is NFT implemented in the gaming environment? To design and use NFTs in the game, developers create smart contracts with the rules for using such tokens.
For example, in CryptoKitties, a small number of core contracts structure the game. The most famous of them – geneScience – defines the random mechanics of generating new cats. Initially, the developers of the game kept its code secret, so interested players even created tools to analyze the likelihood of cats having certain traits. This helped users increase their chances of getting a rare and more valuable breed.
Now let’s talk in more detail about how to create an NFT game.
NFT games can be divided into two large groups:
The utility token method is considered a more stable way of earning than the NFT-only method – winning valuable NTFs is very dependent on chance. In order to help novice players who are unable or afraid to invest, special scholarship funds are established. Experienced players sponsor and train them, after which they are entitled to a share of the profits.
Design for Your Game
Select the genre of the future game. The NFT game is not some scary beast that exists in another reality. This is the same game as the others, but with its own characteristics. So strategy, combat, adventure, simulation, role-playing, or card games – all options are available.
After choosing a genre, it is important to conduct a competitive analysis. Find similar games on the blockchain and beyond. Do not mindlessly copy successful games – take the most interesting features and supplement your idea with them.
All information about the game should be recorded in the game design document. This way you can avoid misunderstandings or misinterpretations within the team. When you precisely define the key milestones of the game, characters, their leveling system, victory conditions, and monetization features, you can move on to design and start creating art.
Of course, game art is an absolutely creative field, and you are free to do whatever you want there. But note one thing for yourself.
At the moment, the most popular NFT game is Axie Infinity, where the player has to collect fantastic NFT animals that can be bred or sold. We also remember about CryptoKitties, a kind of trendsetter for games with animal breeding mechanics. These games combine bright cartoon art with cute animals. Almost no one in the world can resist cute animals. Keep this in mind.
Other popular NFT games are also non-AAA graphics examples. In the future, the emergence of AAA games with the introduction of NFT is planned, but so far the effectiveness of such a combination hasn’t been tested and remains in question. To avoid the risks and huge investments in an untested concept, start with a simpler graphic option. Later, after getting your hands on it and understanding the specifics of NFT games, you will be able to move on to games with a more advanced level of art.
Web or Mobile
Applications built on blockchain technologies are called dApps – decentralized applications. The main code and data (backend) of a decentralized application are stored and executed on the peer-to-peer blockchain, unlike client-server applications, whose data and code are processed on servers.
In fact, all cryptocurrencies are already variants of decentralized applications. But usually, they are considered the basic foundation of the blockchain, on top of which a variety of decentralized applications already work. Decentralized applications are usually open source.
We continue to figure out how to make an NFT game. The next question to ask is how do you want your users to interact with the game? Through a web browser or mobile app?
Both options are valid. The web application is universal and can be launched from any device, from a computer to a smartphone, anywhere in the world. On the other hand, a mobile app will run much faster on smartphones and may have many more features. Therefore, its development is often more expensive.
Mobile applications can be native and cross-platform:
- Native options are created for a specific operating system and can have access to various smartphone functions: camera, contact list, GPS, and others. Often we are talking about Android and iOS, but there are also Blackberry, Windows Mobile, Bada, Symbian, as well as open source systems such as Mobian and Ubuntu.
- Cross-platform options won’t be able to access smartphone functions, but they’re much easier, faster, and cheaper to create because you only need one version that will work for all operating systems.
Before choosing between native and cross-platform apps, consider whether you need smartphone features for your game. Also, note that the AppStore requires each app to meet a set of requirements and may refuse to list a game on the store if it detects any infringement.
There is also a hybrid app option that works as both a mobile app and a web app. Then it makes sense for you to pay attention to progressive web applications. PWA allows you to run the application using a mobile browser. At the same time, the functionality of the native application is almost completely preserved, and the application itself doesn’t need to be placed in the AppStore and go through all the circles of hell with regards to audit.
The advantages of PWA are:
- Sending push notifications (except iOS devices).
- Working offline.
- Accessing some smartphone features (except iOS devices).
- Placing a shortcut on the desktop that doesn’t visually differ from that of a native application.
Define your target group and the devices they use. But the simplest solution for your first NFT game would be a web application. It has maximum coverage, is not limited to a specific device and doesn’t require either a complex technological pipeline or compliance with the rules of a specific platform.
To get your feet on the ground in NFT, take advantage of open source. For example, you can go to GitHub and find both ready-made games and templates for NFT games that you can manipulate to better understand the specifics of such games.
If GitHub is Greek to you, then pave the way for the initial orientation in it. You will definitely need it in the future. This is the most famous project and code version management system. It allows you to collaborate with other people around the world, plan your projects and track your work.
One of the most common dApp development ecosystems is Truffle Suite. It is the leading smart contract development environment. Truffle tools are used by well-known companies such as Microsoft, Amazon, and VMWare. Truffle Suite provides blockchain developers with a standardized testing environment and asset pipeline to create high-quality and reliable smart contracts.
Truffle Suite consists of three different parts:
- Truffle. A development environment that uses the Ethereum virtual machine as a basis and specializes in the development, management and testing of smart contracts.
- Ganache. A tool for setting up a local Ethereum blockchain that allows you to deploy, develop, and test all of our decentralized applications in a secure and deterministic environment.
- Drizzle. A set of front-end libraries based on the Redux store for developing a more predictable and manageable interface.
For a long time, Truffle Suite only supported blockchains based on Ethereum and Ethereum Virtual Machine. But recently, Truffle has announced support for Tezos. It is the first blockchain outside of the Ethereum Virtual Machine.
Another dApps development platform is Moralis, which has an infinitely scalable server infrastructure and is able to remove the biggest obstacles in dApp development. The platform provides you with a fully managed back-end infrastructure. This means that you, as a developer, can focus on developing the front end and the main user interface.
The Front-End Stage
As frameworks, React and Vue can be good options. Angular, with its huge API, may seem too complicated for beginners. Truffle Suite was originally built to connect to React, but as of 2019 they also offer a Vue plugin.
The frontend can be hosted on Netlify. It is one of the most advanced web development platforms that helps programmers publish projects online. It is ideal for small teams or solo developers who are not able to create the infrastructure for their resources on their own, but still want to put their product on the Internet. Besides, it’s free.
Unlike ordinary money, cryptocurrency is not stored in a real or virtual wallet, it is located directly in the blockchain ecosystem. A crypto wallet is a special software or hardware that allows you to store digital currency, as well as perform various operations with it.
Any crypto wallet should have a high level of security. To select a suitable wallet, you first need to go to the website of the cryptocurrency you are going to store and familiarize yourself with the list of recommended applications. Every secure wallet must meet the following requirements:
- have private and public keys;
- have several levels of security.
For example, CryptoKitties uses the MetaMask non-custodial wallet. It works as an extension for the Google Chrome family of browsers.
We have already mentioned that smart contracts are programs stored on the blockchain that run when predetermined conditions are met. If users want to access their NFT, it goes like this:
- The frontend receives the user’s address from the crypto wallet.
- The frontend sends the user’s address to the smart contract.
- The smart contract gives the user the NFT address owned by the given user.
The Solidity programming language is used to write smart contracts. Solidity is a Turing-complete language, which means you can create complex contracts in a well-defined code format.
All state transitions are logged and stored unchanged. Therefore, you need to thoroughly test the contract before it is sent to the production environment. Fixing bugs can be costly or even cause critical system failures.
Smart contracts have the following important properties and advantages:
- Transparency. Blockchain users can read and use smart contracts through the APIs.
- Immutability. When a smart contract is executed, logs are generated that cannot be modified.
- Distribution. The output of the contract is verified and evaluated by many nodes in the network. Information on the status of contracts is publicly available. In some cases, even private variables are viewable.
The Back-End Stage
So, we have already determined that the smart contract deals with the URL of the desired NFT. With this address, the frontend makes a request to the backend to get the metadata for this NFT. The backend sends metadata to the frontend. They include the name of the NFT, its address and identifier. After receiving this data, the frontend can send another request to the server with the NFT URL. The interface can then display the available data and the user can see their NFT’s name and image.
The Testing Stage
To test your NFT game, you can use special test blockchains like Rinkeby. Ganache by Truffle makes it easy to create a mock blockchain. The types of blockchain game testing can be as follows:
- Functional testing. This is a test of the overall functioning of the game, data transfer, block and chain sizes to evaluate requirements, processes, etc.
- Security testing. This is mandatory to check for any threats to the blockchain system.
- UI testing. It’s important to make sure the game’s workflow and functionality are working properly and to test fonts, colors, graphics, and more for a great user experience.
- Integration testing. This is a test of interconnection between different software components.
- API testing. The bottom line is to check the communication of software components with an external API to make sure that the request and response are correctly processed by the system.
Now you have a general idea of how to make an NFT game. In this case, it is important not to get carried away with the number of NFT assets, but to think about what value they represent for the players. Will players want to buy them and what will be their motivation?