Technology and Dreams: How are off-chain and on-chain games created?
Off-chain games have been a standard in the gaming industry for many years. However, new opportunities and technologies emerge as time passes, and on-chain games provide a slightly different approach for developers and players. In creating my own game, I discovered many of these nuances.
Nowadays, it is challenging to make an in-demand game based purely on blockchain because the speed and responsiveness of the game are often crucial for a pleasant gaming experience, and the speed of blockchain networks is not enough to provide such an experience. Therefore, my game can be called a hybrid game: for things where speed is required, the classical approach is used, and for things related to economics and statistics (player parameters, their level, and so on), the on-chain component is used.
Author's Note: In this article, I want to compare the difference in the production of off-chain games and hybrid games with an on-chain component. Often in publications, hybrid games are called Web3 games for simplicity. My project can also be called a Web3 game in this sense, but I will still call it a hybrid game for accuracy.
So, let's look at some of the critical differences between off-chain and on-chain game development. The difference in their production lies in both platforms' technological features and working principles.
Architecture and technology
Off-chain games are traditionally based on closed code and data stored on the developers' servers and, as a rule, are not available to players in full. In developing off-chain games, the classic client-server architecture is used, where the game client is installed on the player's computer or mobile device (the client can be a browser if we are talking about web games). All data is stored and processed on the game servers, and the game process is controlled. The game process is mainly implemented on the client side (which is not always valid for browser games: the server often plays a more significant role). Developers usually have complete control over the game and are responsible for the servers' operability.
On-chain: Besides the classic (off-chain) component, on-chain is usually open code and data stored on a public network, the blockchain. Thus, an on-chain game does not have a game server in the usual sense. The entire blockchain network acts as the server, and the smart contracts stored in it act as the server code. Smart contracts are program code (in Solidity, Cadence, Rust, and so on) that processes data stored in the blockchain and is also stored in the blockchain. In a sense, blockchain is a distributed database, and smart contracts are stored procedures analogous to traditional databases (with the significant difference that blockchain does not have a single control center and its data is public).
For such a decentralized network to exist in the market economy, writing data into it is not free. Each transaction is paid for with so-called gas (tokens of this network), and the transaction price is balanced depending on the network load. On August 15, 2023, the transaction fee on the Bitcoin network was approximately 0,000027 BTC or $0,798. This is an average, and the actual amount may vary. The higher the transaction fee, the more likely it will be included in the next block. Thus, interaction with the network is not free for the client and requires him to have tokens in the network on his wallet, which raises the threshold of entry both technically (you need to get a wallet and put the necessary tokens on it) and economically. Typically, a client connects to the blockchain network through its wallet and interacts with it through a standardized API, also called ABI (B stands for "binary").
ABI files are generated during the compilation of smart contracts and then used by the client as an interface to access these smart contracts on the blockchain network. This approach is similar to classical interface generation using Swagger or gRPC tools. In the case of blockchain development we get ABI files immediately when compilation simplifies the process. However, the specifics of the blockchain network add complexity. Requests (so-called transactions) in the network are processed in blocks, which, on the one hand, significantly increases the speed of response from the network (a request is processed from 1 sec to 12 sec, it all depends on a particular blockchain). However, it is crushingly inferior to off-chain games, not allowing you to create dynamic and responsive games on-chain.
On the other hand, in most networks, due to their openness, the request data is visible in the newly formed transaction block to all participants even before it is stored in the network - this forces additional security issues to be addressed (classic example: sandwich bots and, as a tool to combat this, the slippage parameter). Another essential detail is the following: due to the decentralized and distributed nature of the blockchain network, there is no guarantee that a newly formed block will be preserved in the blockchain (newly formed blocks may roll back if the participating servers do not reach a consensus).
Usually, we can say that a block is "anchored" in the network after generating 6-12 blocks after it. This last detail is essential to consider in hybrid games, where part of the information is stored and processed by the off-chain, and care must be taken to handle data mis-synchronization. If a block in the chain is rolled back, you should back the corresponding changes on your off-chain server.
These were difficulties. On the plus side, we can mention the already mentioned automatic generation of interfaces (ABI), no need to maintain your servers (in the case of a pure on-chain project). In addition, there is no need to worry about hacking or DDoS of servers - these issues are delegated to the blockchain network.
Asset ownership and community participation
Off-chain: Asset ownership in off-chain games is through centralized systems and databases that the developers and publishers of the game control. Asset ownership is limited to the rights granted to players as part of the game platform or license agreement.
What do off-chain players own?
1. Virtual items: weapons, armor, clothing, jewelry, and other in-game items that can be purchased or earned. However, possession of these items is limited to the game world and has no real value outside the game.
2. Currencies and in-game resources earned or purchased. These currencies allow buying items, upgrades, or other in-game benefits. However, the developers control game resources, and their use and exchange are limited within the game ecosystem.
3. Accounts and data. Players own their accounts containing information about their progress, achievements, and other statistics. Although players have control over their accounts, the data is stored on the game's servers and is accessible through the game platforms.
Ownership of assets in off-chain games is often subject to license agreements and restrictions developers and publishers impose. Game assets and data remain within the game platform and usually cannot be freely sold or transferred outside the game ecosystem without the developers' consent.
On-chain: On-chain games go further and seek to conceptualize NFT and asset management on a blockchain. Asset ownership in on-chain games is done through decentralized blockchain technology, allowing players complete control and ownership over their digital assets. Players can also trade them on open markets or through dedicated platforms.
It should be noted here that developers can precisely place restrictions on players' digital assets. These restrictions are represented in smart contracts and are visible to the community in advance. Why impose restrictions? It could be either a matter of maintaining the balance of the game and the in-game economy, or it could be a matter of malicious fraud. Thus, the player should read smart contract reviews from legitimate community members to weigh the pros and cons and, being informed, decide whether to accept the game rules.
It is worth admitting that understanding trading in Steam is much easier than learning how to work with cryptocurrencies quickly, set up a specialized wallet, and exchange tokens. All these actions are complicated and confusing for beginners, preventing them from understanding and using many game functions.
A bit of personal history: a year or two ago, I tried to help my nephews enter crypto, but they got bored after a week of learning and did not desire to make one more attempt. That's why in my project, I focused on the tutorial and tried to hide obscure terminology behind game terms.
Game economy and rewards
Off-chain: The in-game economy of off-chain games has a centralized model where developers and publishers control the game currency, resources, and economic systems of the game. In-game mechanisms offered by the developers reward achievements and progress in the game.
On-chain: On-chain games present economic systems and rewards in a decentralized format. They are based on smart contracts that automatically fulfill conditions and provide real-time rewards to players. The distribution of rewards is usually based on activity level, contribution to the game, ownership share, and other parameters.
Development cost
The total cost of creating an off-chain or on-chain game depends on many factors, including the scale of the project, its uniqueness, the number of game mechanics, the complexity of development, and other points. In general, it cannot be said that one type of game will necessarily be cheaper than another.
BR Softech says the average cost of AAA game development is between 60 and 80 million dollars, including basic and mid-level features. However, with advanced and high-level functionality and graphics, the cost of these games can reach $100 million or even exceed that amount. Here are some examples:
Grand Theft Auto V by Rockstar Games, released in 2013: $265 million (inflation-adjusted: $291 million).
Star Wars: The Old Republic by Electronic Arts, LucasArts, released in 2011: $200+ million (inflation-adjusted: $227+ million).
The Witcher 3: Wild Hunt by CD Projekt, released in 2015: $81 million (inflation-adjusted: $87 million).
However, the cost of developing an on-chain game can easily be higher than an off-chain game because on-chain games require additional integration with blockchain technologies, creating and managing smart contracts, the presence of a proprietary cryptocurrency or token, etc. All this requires extra time and resources on the part of developers.
Also, on-chain games often require a development team with experience with blockchain and cryptocurrencies, which can affect the project's cost, as experts in this field are usually in demand, and their services are expensive.
As mentioned above, the cost of creating a game can vary significantly in each specific case, and exact figures can only be provided after a detailed discussion of the requirements and the project with the development team.
What's the bottom line?
The main difference between off-chain and on-chain games is data openness, ownership, and control. While off-chain games are centrally controlled, on-chain products are fundamentally owned and operated by players, opening up new gaming experiences and monetization opportunities. On-chain games tend towards a more decentralized and participatory model where players have more control and influence over the gaming ecosystem. They offer new opportunities for asset ownership, community participation, and economic interaction.
Will they become more popular with the masses? This technology is still evolving and unfamiliar to most people. The high entry threshold, distrust, and fear of being cheated are severe barriers to the widespread adoption of on-chain games and limit the availability of gaming content to a mass audience. As on-chain products gain popularity, the traditional gaming industry will likely be affected, but there is still a long and challenging road ahead.