Skip to content

thirdweb-example/engine-express

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unreal Engine x thirdweb Engine Architecture

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:

Untitled

Demo

You can try out our live Speed Racer demo to see all parts working together, it is deployed on arbitrum-sepolia.

⚠️ This is not a production ready app, it uses an in-memory db to demonstrate the architecture, do not use a password you've used before.

Download Speed Racer for Windows

Download Speed Racer for Mac

Setting up Engine

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.

Setting up your website and backend

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:

  1. Clone https://github.com/thirdweb-example/engine-express/
  2. Install client dependencies cd client and yarn
  3. Install server dependencies cd server and yarn
  4. Head back into the root folder and yarn
  5. 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
  6. You can now run the client and server in two terminals using yarn client and yarn server
  7. Go ahead and create a user on your website, and link a wallet
  8. You are now ready to head into Unreal!

Setting up Unreal Engine

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.