GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - seangeng/based-adventure: Farcaster Frames Text-based Adventure on the Base L2

BranchesTags
Open more actions menu

Latest commit

 

History

86 Commits
86 Commits

Folders and files

NameName
Last commit message
Last commit date
assets
assets
 
 
public
public
 
 
src
src
 
 
.eslintrc.json
.eslintrc.json
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
next.config.mjs
next.config.mjs
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
postcss.config.js
postcss.config.js
 
 
tailwind.config.ts
tailwind.config.ts
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

Base Quest

This is an experimental Farcaster frame app for an AI text-based adventure powered by the Base L2. Base Quest is still a work in progress and subject to change.

Base Quest Splash Screen

Want to play?

Follow me on Farcaster for the latest game link: https://warpcast.com/seangeng

Features

  • AI Driven Gameplay ✅
  • Leaderboard ✅
  • Option to continue vs start a new game ✅
  • Issue Character NFTs on Base & save state to them ✅
  • Notifications
  • Character attributes
  • Game backgrounds & environments (✅ testing)
  • $EXP Tokens
  • Character profile links & PvP (✅ testing)
  • Multi-player quests

How it Works

Technical Diagram

This high level diagram explains the frame states & how menu actions are managed generically. Buttons can be passed to the menu in the GET parameter, and map to the business logic - essentially acting as a router.

Several awesome SDKs & frameworks are leveraged to accelerate developement:

Coinbase OnChain Kit: For frame helpers & future onchain actions.

  • https://github.com/coinbase/onchainkit

Neynar: Making it easy to interact with Farcaster

  • https://neynar.com/

OpenAI: For chat completions & image generation.

  • https://openai.com

Inngest: For executing background jobs (there is latency when generating images + certain onchain actions)

  • https://www.inngest.com/

Vercel: For hosting, and easy programmatic OpenGraph image generation:

  • Check out /src/app/api/image/prompt/route.tsx as an example
  • https://vercel.com/docs/functions/edge-functions/og-image-generation/og-image-examples

Basic AI Workflow

Base Quest uses the OpenAI GPT 3.5 Turbo model to narrate & continue the storyline. That means each user's journey is completely unique!

Check out the /src/app/api/prompt/route.tsx file to see how the AI prompt loop works:

  1. AI generates the prompt & button options
    • system: You are the narrator in a choose your own adventure text-based game.
    • The user is a {class} starting their first adventure.
    • Write a character narration prompt (up to 100 characters), and present the user with either 2 or 4 action options to continue the story.
    • Action options should be either emoji(s) or short button text (up to 14 characters)
    • Return a JSON response like so: { }
  2. Present options as next frame og:buttons
  3. Feed the previous prompt & user selected action to the next prompt screen

Onchain Interactions

To avoid timeouts and for better resiliency - Inngest is leveraged to run serverless jobs async & in the background. This pattern has better monitoring, auto-retrys, and decouples business logic from the frame rendering.

Check out /src/app/inngest/functions.tsx to see how this works.

We use the InstaMint.sol contract - developed by my team at Coinbase & optimized for gas & ease of use! The NFT factory contract is available at: Sepolia Testnet: 0x4d64cAc5Bd09c7CaC9748D1E5a63A30Ee40B6A40 Base Mainnet: 0x85db63af3f0cfac7813abb4dfca6d713e937a5dd

Want to build onchain?

The future is onchain. Does this interest you? Do you think you can do better? Coinbase hires the top 1% of developers - reach out to me for a possible referral: https://www.linkedin.com/in/seangeng/

About

Farcaster Frames Text-based Adventure on the Base L2

basequest.ai

Topics

farcasterfarcaster-framesfarcaster-protocolopenai

Resources

Readme
Activity

Stars

40 stars

Watchers

3 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.