Gaming + Sui: why and how?

Increase engagement, retention, and revenue

Overview

This guide covers the benefits of adding Web3 elements to your game, along with some discussion on how much to add and where (spoiler alert: you don't need that much to make a big difference). It discusses the benefits of using the Sui blockchain and using Shinami for your infrastructure needs. It then provides a high-level overview of the key integration flows. Finally, it summarizes the developer resources to help you get started building.


Why add Web3 elements to your game?

Player ownership = engagement, retention

Infusing your game with assets users can own, upgrade, lend, and trade is a powerful way to increase engagement. Examples include a NFT that represents their in-game playable character or your game's engagement tokens. Below, we discuss some of the benefits of these.

In-game items

Gamers have always been used to acquiring items and upgrades for their efforts. Now, you can give players verifiable ownership on a blockchain of some of these items. Why is this good for you or the player?

Players feel more invested in your game, because this unlocks the opportunity to buy, sell, lend, or trade these verifiably scarce items in a transparent way where they won't be scammed. No more transferring money to a PayPal account and hoping that the person on the other end actually gives you their World of Warcraft password. Allowing players to have control over using, displaying, and trading these items gives them an enhanced sense of connection to your game and pride in their in-game accomplishments. It can also help build a vibrant community around your game, as players interact with each other and display their assets for yet-to-be-acquired users to see. Letting players sell their items adds a new way for both the players and your game to make money on what the players are doing anyway: having fun paying your game.

Your game gets access to a global market where you can get a cut of these sales. For an example of how player ownership of in-game items can drive engagement and retention, see our case study with BlueJay Games.

Tokens

Tokens can be used to give players a stake in the success of the game's community. They can be given for playing the game, but also for taking other actions that drive interest in the game like posting on social media. These tokens can be exchanged for all sorts of rewards like unlocking new maps, game merchandise, etc. Players can also have the option to sell some of their tokens to others, earning money for their time and effort building your ecosystem.

The benefits for you include driving player engagement and community growth, rewarding players fairly, and easily tying rewards to key actions you want to promote. For an example of how a token can be used to drive engagement and retention, see our case study with Playground.


How to add Web3 elements to your Web2 game?

Start small.

Let's not forget about what players care most about: a great UX and a game that's fun to play.

You don't need to write every change in player or game state to the chain. A good place to start is with one key item like an in-game object represented as on-chain NFT. This could be a character, or a key item that character uses. Just owning one important thing can make a big difference in how connected a user feels to a game.

As a result, you don't have to read from the blockchain or write to it constantly. You can cache some chain-based game state and will almost certainly store some in your internal, private databases. You only need to write major changes, like when a user acquires that key item for the first time or when they upgrade it.

Introduce them slowly.

Player ownership is something you can slowly layer in as players spend more time with your game - after all, these things are a reward for spending time in your game. When players launch your game, the reason they come back the next day is because of great gameplay and/or community. No NFT can make up for a boring game.

Instead, think about ownership as one of multiple reasons why a player sticks around for week two, or month two. Maybe they don't earn ownership of a game object, or game tokens, until level 20. Or, after 10 hours of gameplay. From there, maybe they don't earn an upgrade or more tokens until level 30, or another 5 hours. And, maybe that second point is where you introduce to them that they have a wallet behind the scenes. You can then give players the option to learn more or take direct control of their wallet, but don't force it. Later, you can introduce actions they can take with their wallet, like selling their object to another player or trading some of their tokens for a reward.

The point is to not make Web3 knowledge a requirement of playing your game. Instead, these elements are an optional but rewarding enhancement to a player's experience with your game and game community.


Why use Sui + Shinami?

The Sui blockchain was designed from the ground up to support the needs of large scale, highly-performant games. And with the upcoming release of the SuiPlay0X1 handheld gaming device, you know Sui is a blockchain that's serious about gaming.

Shinami is the Sui ecosystem's leading developer platform, offering all that games need to deliver on the promise of Web3 gaming.

Safety first

When you think "blockchain," you might also think "security hacks that steal people's money". Sui was designed from the beginning to guard against this. The code that runs on the Sui blockchain is built using Sui Move, a programming language created for easily writing code with strong safely guarantees.

Object-centric with dynamic, composable objects

Sui is a blockchain built from the ground up to treat objects as first-class entities (as opposed to an account-centric model). Objects are not entries in a smart contract. They are stored directly on chain, making them both more secure and more accessible by games and other apps. NFTs are objects on Sui, and in the rest of this guide we'll use object, NFT, and player asset to refer to the same idea: an in-game asset represented by an NFT you give to a player (which is an object stored on the Sui blockchain).

NFTs on Sui can be dynamic. Game developers can alter NFT metadata without having to burn and reissue them, which means you can make changes to your game and reflect those changes in existing player assets. They can be composable, meaning that an NFT owned by a player can itself own an NFT - for example, a hero the player owns can be equipped with a sword. Dynamic, composable NFTs allow for countless possibilities to evolve and enhance your players' NFTs - and thus game experience - as they accomplish in-game tasks.

Low latency and predictably low fees.

Sui is highly scalable and allows for parallel execution of independent transactions. For example, updating an NFT owned by a player doesn't require waiting on global transaction sequencing. This allows for transactions to have the sub-second speeds needed to give your players the smooth, uninterrupted experience they demand.

The architecture is horizontally scalable, allowing for predictable, very cheap transaction fees (as opposed to the huge spikes in transaction fees you see when a big NFT project launch on Ethereum).

Web3 apps with a Web2 UX. Powered by Shinami.

Shinami is the leading developer platform for apps on Sui. We offer a world-class Node Service for reading and writing to the blockchain, with low-latency and high-availability. We provide both app-controlled and user-controlled wallet infrastructure, both of which let you abstract away friction like signing popups, requiring players to download a wallet application, and other UX hurdles that would turn Web2 gamers away. Finally, games use Shinami's Gas Station to sponsor the gas fee for their users' transactions and offer a seamless, free-to-play experience. This means that when a player earns or updates an NFT representing a game asset, they don't have to go through a long KYC process to buy SUI for the small gas fee.


High-level technical overview

How to create a Web3 wallet for a user

There are two main options here, both shown the in the image below:

  1. Use a Shinami Invisible Wallet. This is a backend wallet that your app manages in the following way: whenever a user creates an account in your game - using whatever account creation and login flow you already have or want to have - your app creates two additional pieces of data you store in your database for the user. These two things are a Shinami wallet id and a Shinami wallet secret. Then, you app will use the id and secret as a sort of username and password in its API requests to Shinami to create and perform operations with the user's wallet.
  2. Use a Sui zkLogin wallet. This is a frontend (including mobile app) wallet that works specifically with social sign in with Google, Apple, Twitch, Facebook, etc (full list of options is what's show as supported on Mainnet here). When the user first logs in and you create an account for them, you then ask Shinami to create the wallet, which means to create a salt (like a special password the wallet needs to work). Then, each time the user logs in you ask Shinami for the salt and to generate a zkLogin proof (a fancy mathematical proof that you use to write to the blockchain with the wallet).

For a more complete discussion of Shinami's wallet services, see our high-level guide.

How to read and update a player's NFT on chain

Diagram

Summary of steps

  1. When a player logs in, you lookup the objects that player owns and present them to the player (you can also store a copy of these in your database). At this point in our example, your player has a character with no weapon.
  2. Once the user defeats a boss in the game, they earn a sword to enhance their character's attack power. Your backend makes a request to mint a sword NFT and assign it to the player's character. Now, the player owns a character who owns a sword. All the better to keep playing and take on the next boss!


Developer resources

Sui Move game and transaction code

Prior to integrating with Shinami, you should create and deploy Sui Move smart contracts to manage your on-chain assets (characters, items, etc.) and game logic. You'll use Programmable Transaction Blocks to build the transactions that interact with your on-chain assets and smart contracts (using Sui's SDK for this is recommended).

Shinami services to power your game

Shinami has all the services games need to deliver on the promise of Web3 gaming. We also have SDKs so you can get started quickly. Key services are:

  • Node Service: enterprise-grade infrastructure to read from and write to the Sui blockchain. Use this to mint, read, and update NFTs, as well as deploy and update your game's smart contracts.
  • Gas Station: sponsor the gas fees for transactions involving your users' wallets for a seamless, free-to-play experience.
  • Wallet Services - abstract away signing popups, seed phrases, and other web3 friction for a smooth UX
    • Invisible Wallet: app-controlled, backend wallets under the shared custody of your app and Shinami. Both parties must cooperate in order to obtain a valid signature. Uses your app's existing authentication.
    • zkLogin Wallet: user-controlled wallets tied to a user's OpenID authentication. zkLogin is a Sui primitive that provides the ability to send transactions from a Sui address using an OpenID credential, without publicly linking the two.