This guide will show you how to have a production style setup for your Unreal Engine game.
To do so, we’ll use a template to deploy a client/server compatible with Engine, and a template game.
Here’s an overview of the overall architecture for this example:
You can try out our live Speed Racer demo to see all parts working together, it is deployed on arbitrum-sepolia.
Download Speed Racer for Windows
This example makes use of thirdweb Engine, a backend HTTP server that calls smart contracts using your managed backend wallets.
You’ll need an instance running for your server to interact with the blockchain.
Documentation can be found here.
We’ll need a website for users to sign up and link their wallets, and a backend to handle wallet authentication, user registration and interaction with engine.
Here’s a step by step guide to deploy your client/server:
- Clone https://github.com/thirdweb-example/engine-express/
- Install client dependencies
cd client
andyarn
- Install server dependencies
cd server
andyarn
- Head back into the root folder and
yarn
- Replace the
.env.example
in the client/server folders with your own api key values and engine url - make sure your api key can be used to authenticate with your deployed engine - You can now run the client and server in two terminals using
yarn client
andyarn server
- Go ahead and create a user on your website, and link a wallet
- You are now ready to head into Unreal!
This part is simple, we have a template for you with a simple script to interact with your server as per the architecture above. A level blueprint instantiates the UI, which has its own blueprint to interact with your server.
Go ahead and clone https://github.com/thirdweb-example/unreal_demo and head to _Thirdweb/Scenes/Scene_Game
and start the level.
At this point, you can update your server url in ThirdwebManager.cpp, and website url in the Canvas_Main blueprint graph to match your deployed frontend/backend in the previous step.
You should now be able to login and see the output as the game polls and updates your balance whenever you collect an item while driving.
All thirdweb related assets are under the _Thirdweb
folder in your Content Browser.