Building and Integrating Web3 Game Features with Sequence's Unreal Engine SDK
Integrate the Sequence Wallet, fetch your players assets, sign messages, send transactions and more using Sequence’s Unreal SDK.
Intro to Cropout - Unreal Engine Game Guide
Cropout is a top-down casual RTS game built with Unreal Engine, in this guide we will walk you through how to integrate Embedded Wallet features using Sequence’s Unreal SDK.
With this integration, players will be able to access features like smart contract wallets, in-game asset ownership, and transaction management—all without disruptive popups or gas fee requirements.
Checkout the Boilerplate for this guide. Learn more about Embedded Wallets.
1. Setup
Download the game sample
If you have the Unreal Engine installed go straight to Unreal’s Cropout page..
If not then start by installing Epic Games Launcher:
-
Download and install the launcher from Epic Games’ website..
-
Log In: Sign in or create an Epic Games account.
-
Find the Project: Go to the Unreal Engine tab, then the Learn section, and search for “Cropout Sample Project”.
-
Download: Click Add to Library and then Install to download the project files.
Download the Sequence Unreal Engine SDK
To get started, download the latest version of the Sequence SDK and put the SequencePlugin
folder into your Unreal project’s Plugin
folder.
Alternatively, get the SDK from the Epic Games Marketplace.
Configure your Project
-
In your
SequenceConfig.ini
file, add yourWaaS Config Key
and your Builder API Key from the Builder Console underSettings > API Access Keys
. -
Do not forget to add your preferred Oauth client ids, which you must set in the Builder under
Onboard > Embedded Wallet > Configuration
.
Login using the Built-In UI
On the Main Menu level blueprint we will spawn our Sequence Connector
Actor which will initiate and display the Login Panel.
We recommend using the Built-In UI for development purposes, here’s a more detailed explanation. For further customization, learn how to create your own UI.
2. Setting the Network Id and Chain
To start our interaction with the Sequence SDK, open the Sequence Connector blueprint, locate the Auth Success
event on Event Graph > Begin Play, and we will call Api Update Network Id
from the SequenceWalletBP Subsystem to set the wallet to your builders project selected chain.
In the same event, we will also call Set Chain
from the Sequence Indexer Subsystem so we can correctly fetch the assets.
3. Get Wallet address
To display the wallet’s address we first retrieve the user’s wallet reference again using the SequenceWalletBP and use it to fetch and display the wallet’s address from the selected network using Api GetWallet Address
from the SequenceWalletBP Subsystem. We will display the user address on UI_Layer_Menu.
4. Set your NFTs
In our case we are starting with an ERC-1155 contract, for our Resource Bundle packs and Farming Boosts. To create the NFTs go to Builder Console > Deploy > Contracts and select Web3 Game Item
.
Once we’ve made our items we will now create their respective sale contracts by deploying a new contract and selecting Web 3 Game Item(Sale)
.
We will add to our Web 3 Game items its corresponding rewards and it’s Sale contract address as a property.
Fetching our NFTs
To retrieve our newly created NFTs we will use the Indexer subsystem to call Get Token Supply, which will return us the information and metadata for the given contract address. You will find this in the CUI_Purchase
blueprint.
Purchasing an NFTs
To allow the player to purchase an NFT we will use the SequenceSDK subsystem to create and send a PrimaryPurchase
transaction the desired Web 3 Game Item(Sale)
and will use the contracts “Sale” property to reference our Web 3 Game Item(Sale)
. You will find this in the CUI_PurchaseItem
blueprint.
Fetch the players NFTs
To retrieve the players NFTs will be using the Indexer Subsystem to call Get Token Balances
, which will return us all the contract Balances for the given wallet address. Once returned, we will call Get Token Balances once again, but this time for each specific contract, which will return us the balance plus the information and metadata for the given contract. You will find this in the CUI_Vault
blueprint.
Burn the players NFTs
To give the player the rewards for using one of our NFTs we will use the SequenceSDK subsystem to create and send a Burn
transaction of the desired Web 3 Game Item
which will return us the transaction status and the contract address, to verify the success of the items burn. On Succes, we will use the contracts properties to give the players their reward. You will find this in the CUI_VaultItem
blueprint.
For a more detailed explanation go to Read From Blockchain and Write to Blockchain sections.
5. Sign out the player
To sign out the player and terminate his session we will call `Clear Session from the Sequence Sessions Subsytem, this way we will remove his stored credentials and the user will need to login again when he returns. We will be calling this method in the UI_Layer_Menu.
Was this page helpful?