Web3 Wallet Setup
G3Engine makes it effortless to add Web3 functionality to your games. Enable wallet connections, token launches, NFT minting, and blockchain interactions without writing smart contracts.Why Web3 in Games?
Add blockchain features to:- Launch tokens on Pump.fun bonding curves for in-game economies
- Mint NFTs for collectibles, achievements, or unique items
- Token-gate content (require token holdings to access areas)
- Reward players with crypto for completing challenges
- Enable tipping so players can support creators
- Create on-chain leaderboards with permanent records
Enabling Web3
Enabling Web3 is optional. Games work perfectly without blockchain features. Only enable if you want token/NFT functionality.
- Phantom (recommended for Solana)
- Backpack
- Solflare
- Any Solana wallet
First time with Web3?Start on Devnet (test network) to experiment without real money:
- Go to Settings tab
- Select “Devnet”
- Get free test SOL from a Solana faucet
Launching a Token on Pump.fun
Pump.fun is a bonding curve platform where anyone can launch a token in seconds.{
"name": "My Game Coin",
"symbol": "GAME",
"imageUri": "https://example.com/token-icon.png",
"description": "The official currency of My Awesome Game"
}
┌─────────────────────────────────┐
│ 🪙 GAME │
│ My Game Coin │
│ Balance: 1,000,000 │
│ Price: 0.00001 SOL │
└─────────────────────────────────┘
Using Web3 Nodes in Visual Scripting
Once Web3 is enabled, Web3 nodes (purple) appear in the Node Editor.[On Collision (VIP Door)]
│
└──→ [Token Gate]
Token Mint: [Your token]
Min Balance: 100
│
├─ Has Access ──→ [Set Visible (Room, true)]
│
└─ No Access ──→ [Print String ("Need 100 tokens!")]
[Event Tick]
│
└──→ [Get Token Price]
Token Mint: [Your token]
│
└─ Price (SOL) ──→ [Print String ("Price: X SOL")]
Minting NFTs
{
"name": "Victory Badge",
"imageUri": "https://example.com/badge.png",
"attributes": {
"rarity": "legendary",
"level": "10",
"score": "9999"
}
}
[On Level Complete]
│
└──→ [Mint NFT]
Name: "Level 1 Complete"
Image URI: "..."
Attributes: {level: "1"}
│
└─ Mint Address ──→ [Print String ("NFT minted!")]
Configuring In-Game Economy
{
"economy": {
"rewardTokenMint": "YourTokenMintAddress",
"rewardPerLevel": 10,
"tipJarEnabled": true
}
}
Web3 Node Reference
Token Operations
🚀 Launch Token (Pump.fun)- Creates a new token on the bonding curve
- Inputs: name, symbol, imageUri
- Outputs: tokenMint, txHash
- Buy tokens from the bonding curve
- Inputs: tokenMint, solAmount, slippage
- Outputs: tokensReceived, txHash
- Sell tokens to the bonding curve
- Inputs: tokenMint, tokenAmount, slippage
- Outputs: solReceived, txHash
- Send tokens to the connected wallet
- Inputs: tokenMint, amount
- Outputs: txHash
- Get token balance for connected wallet
- Inputs: tokenMint
- Outputs: balance (float)
- Check if wallet has minimum token balance
- Inputs: tokenMint, minBalance
- Outputs: exec-pass (has access), exec-fail (no access), balance
- Query current price from bonding curve
- Inputs: tokenMint
- Outputs: priceInSol, marketCap
NFT Operations
🎨 Mint NFT- Create an NFT and send to wallet
- Inputs: name, imageUri, attributes
- Outputs: mintAddress, txHash
Solana Operations
⬡ Send SOL- Transfer SOL to another wallet
- Inputs: recipient, amount
- Outputs: txHash
- Send tokens to a specific address
- Inputs: tokenMint, recipient, amount
- Outputs: txHash
Testing on Devnet
Published Game Wallet UI
When you publish a Web3-enabled game:- A Connect Wallet button automatically appears in the game UI
- Players connect their Solana wallet (Phantom, Backpack, etc.)
- Web3 nodes execute transactions using the player’s wallet
- Transaction confirmations appear as notifications
- The player must approve each transaction in their wallet extension
Best Practices
Start on Devnet
Always develop and test on Devnet. Only switch to Mainnet when your game is fully tested.
Clear Token Info
Explain to players what tokens/NFTs they’ll earn and why. Add in-game tooltips.
Reasonable Rewards
Don’t give away too many tokens too quickly. Balance your in-game economy.
Transaction Feedback
Use Print String or UI elements to confirm when tokens are sent or gates are checked.
Common Issues
Wallet won't connect
Wallet won't connect
Check that:
- You have a Solana wallet extension installed (Phantom recommended)
- You’re on the correct network (Devnet vs Mainnet)
- The wallet extension is unlocked
- You’ve approved the connection request
Token launch fails
Token launch fails
Verify:
- You have enough SOL for transaction fees (~0.01 SOL)
- You’re on the correct network
- Token symbol is 3-5 characters
- Image URI is a valid URL
Token Gate always fails
Token Gate always fails
Check:
- Token mint address is correct (copy from Tokens tab)
- Player’s wallet is connected
- Player actually owns the tokens (check on Solscan)
- Min Balance is set correctly
Transactions pending forever
Transactions pending forever
Solana congestion can delay transactions. Wait 1-2 minutes. Check:
- Transaction signature in Settings → Recent Transactions
- Status on Solscan
- Network status at Solana Status
Example: Complete Web3 Game Economy
Next Steps
- Publishing Games - Deploy your Web3 game to social platforms
- Adding Interactivity - Master all visual scripting nodes
- Creating Your First Game - Review the basics