作者展示了基于NEAR AI构建的3D经济模拟游戏,揭示了AI驱动NPC决策与链上资产交互的具体实现路径。
I built VIVOLITH for the @NEARProtocol Hackathon, in the Games With Real Economies track. It is a 3D market town where the economy is the game, and every coin, mango and merchant lives on NEAR.
Play it: https://vivolith.world
You arrive in Saltlight with 40 coins. Four merchants buy and sell all day, and you haggle with them, carry mangoes to the stalls that need them and decide who you help. You can sell Pema a mango for 3 coins, or sell it to Arin for more. The town remembers what you chose.
The economy
- Every merchant has a NEAR account and a till of their own
- Rent is charged every market day. A stall that cannot pay closes, and only delivered stock opens it again
- There is one shared town for everyone. When I reopen Pema's stall, it is open for you too
- You can buy shares in a stall, and those shares pay you from every sale it makes after that
- A Market Guild lends coins to stalls in trouble
- Every coin is accounted for. Coins enter through new players and shoppers, and leave through rent and harbor freight
What @near_ai does
- It sets each merchant's prices, one coin at a time, inside fixed limits
- It runs Lin, a resident of the town, who chooses who buys her mangoes and where she eats, from real orders in the market
- It answers anything you ask a merchant, using that merchant's real numbers on chain. Any answer with a number that is not in those facts is thrown out
- It signs every decision it makes, and the game checks that signature. The model is Jev (typesafe/jev-1.13) on NEAR AI Cloud
There is no wallet and no popup. You type a name and you are in, while a NEAR account is created for you in the background. You can also continue with your Google account to keep your market on any device. Every trade is signed with your own key and the game pays the gas, so you never see a fee.
How it is built
- One Rust contract on NEAR testnet, using the NEP-245 multi-token standard. Coins, mangoes, lemons, lassi and stall shares are all tokens
- Trades are NEP-366 meta-transactions: the player signs them and the game relays them
- A haggled price only counts if the merchant signed it
- 55 contract tests and 17 game checks run on every push
- Three.js for the game, one Vercel function as the relayer, and Blender Python scripts that build the city and the NEAR Spire
Everything you do in the game is recorded on chain, and you can see it for yourself. Open the ledger and press N to see your NEAR account and every trade you made, each with an explorer link.
Ledger: http://vivolith.world/ledger
Anyone can also check any player by adding their account name to the inspect link.
Inspect: http://vivolith.world/inspect/
The coins are game coins on testnet, not real money
The voices, sound effects and music were made with ElevenLabs. The merchants speak their lines out loud and the town has its own music, but in this demo I muted the game audio so you can hear my voiceover clearly.
Please give it a shot with your sound on for the real game experience.
Play it on a desktop browser with a keyboard and mouse, because I have not designed it for mobile yet. Send me your feedback after you play. I will keep improving it.
Code: http://github.com/bunnyyxtan/vivolith
@NEARProtocol @NearLegion @NearBuilders @ilblackdragon @hosseeb @kain
#NEARHackathon
来源:Bunnyy · x.com