An Unreal Engine plugin + Node.js backend that makes it easy to build onchain game flows on @Arc using familiar Blueprint nodes.
This project gives game developers:
-
A reusable Unreal Engine plugin (
ArcBlockchain) that:- Reads onchain data (e.g. USDC balances) directly from @Arc via JSON‑RPC.
- Talks to a simple backend API for write operations (spending / rewarding USDC, minting NFTs, registering players).
- Exposes everything as Blueprint nodes, so you don’t have to write C++ to integrate @Arc.
-
A reference backend (Node.js + ethers v6 + Express) that:
- Wraps your GameCore and GameNFT smart contracts behind simple HTTP endpoints.
- Signs transactions with a server‑side wallet.
- Provides a clear pattern for real game servers (authoritative logic, rewards, etc).
Out of the box, you get:
Get USDC Balance (Async)– async Blueprint node to query a player’s USDC balance on @Arc.Backend Register Player– POST to backend →GameCore.registerPlayer.Backend Pay With USDC– POST to backend →GameCore.payWithUSDC.Backend Reward USDC– POST to backend →GameCore.rewardUSDC.Backend Mint NFT– POST to backend →GameNFT.mintTo.
All of these are designed to be plug‑and‑play for any @Arc game that wants:
- Server‑side control of state and rewards.
- Client‑side UX in Unreal, entirely through Blueprints.
SETUP.md– quick start using the deployed contract addresses in this repo.DOC.md– detailed guide: architecture, customization, best practices.
Recommended structure:
arc-unreal/
├─ blockchain/ # Hardhat/Foundry project with GameCore.sol, GameNFT.sol, deployments
├─ backend/ # Node.js + Express backend server (server.js, package.json, .env)
└─ UnrealProject/
├─ Plugins/
│ └─ ArcBlockchain/ # Unreal plugin (C++ + Blueprint nodes)
└─ Content/
└─ ... # Your game content (maps, blueprints, UI)
Key components:
-
blockchain/contracts/GameCore.sol- Manages player profiles, USDC spends and rewards.
- Interfaces with @Arc’s USDC token contract.
-
blockchain/contracts/GameNFT.sol- Simple ERC‑721 contract for minting game NFTs to players.
-
backend/server.js- Connects to @Arc via
ethers.JsonRpcProvider(ARC_RPC_URL). - Uses
PRIVATE_KEYwallet to callGameCoreandGameNFT. - Exposes routes:
POST /registerPlayerPOST /payWithUSDCPOST /rewardUSDCPOST /mintNFTGET /health
- Connects to @Arc via
-
Plugins/ArcBlockchain(Unreal plugin)UArcBlockchainSettings– holds RPC URL and GameCore address.UGetUSDCBalanceAsync– async Blueprint node callingeth_callagainstGameCore.getUSDCBalance.- Blueprint‑callable functions for the backend routes (HTTP POSTs to your server).
-
Unreal Engine developers who want to add:
- Onchain balances and items (USDC, NFTs) to their game.
- Server‑authoritative rewards and payments.
- @Arc integration with minimal blockchain boilerplate.
-
@Arc developers who want:
- A reference integration showing best practices for:
ethers+ @Arc RPC- Smart contract design for games (
GameCore,GameNFT) - Safer backend patterns: server wallet, approvals, etc.
- A reference integration showing best practices for:
If you want to run this project exactly as configured in this repo, follow:
SETUP.md– quick setup using the deployed contract addresses and config.DOC.md– in‑depth documentation and guidance for customizing and extending.
High‑level steps:
- Deploy
GameCoreandGameNFTto @Arc (or use the addresses provided inSETUP.md). - Configure and run the backend in WSL or Linux.
- Install and enable the ArcBlockchain plugin in your Unreal project.
- In Unreal:
- Set @Arc settings (RPC URL, GameCore address).
- Set backend base URL (WSL IP:port).
- Use the Blueprint nodes in your map or game mode to:
- Read USDC balances.
- Register players.
- Spend/reward USDC.
- Mint NFTs.
- Do not commit secrets: never push
.envfiles or private keys to GitHub. - The backend signs transactions using
PRIVATE_KEY. Run it on trusted infrastructure only. - USDC uses 6 decimals. Example:
5 USDC = 5,000,000(raw units).
- ✅ Onchain read path:
GetUSDCBalanceAsync(verified with real balances on @Arc testnet). - ✅ Backend write path:
registerPlayerpayWithUSDCrewardUSDCmintNFT
- ✅ Unreal integration:
- Blueprint nodes hooked to backend and onchain RPC.
- Tested end‑to‑end with @Arc testnet.
If you're an Unreal, game, or backend engineer, I’d love your input:
- What would you need before using this in production?
- What’s missing or could be improved?
- Should this evolve into a full SDK?
Feel free to open issues or PRs if you test it.
Building in public, all feedback is appreciated.
Apache-2.0 — see LICENSE.
Note: Earlier versions of this repository may have been released under the MIT License. See Git history/tags for details.
