Skip to content

Yeah, it is yet another? crypto game framework, that service for the Arcadia: XGarden

License

Notifications You must be signed in to change notification settings

jhfnetboy/XGarden

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

59 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

XGarden - AI-Powered Interactive Storytelling Chrome Extension

XGarden Logo

๐ŸŒธ Create Your Own Interactive Story Worlds ๐ŸŒธ

An open-source Chrome extension for AI-driven character interactions, world-building, and immersive storytelling.

Version License

English | ไธญๆ–‡

Features โ€ข Installation โ€ข Quick Start โ€ข Documentation โ€ข Roadmap


โœจ Features

๐ŸŽญ Character & World Management

  • Create Custom Characters: Design unique NPCs with personalities, greetings, and avatars
  • Character Avatars: Upload custom avatars or generate via AI
  • Player Character: Set your own character with custom personality traits
  • Group Conversations: Organize characters into groups for multi-character interactions
  • World Building: Define world settings, backgrounds, and lore with keyword-based worldbook entries
  • Avatar & Portrait Management: Upload, preview, and delete character avatars and portraits

๐Ÿ“– Chapter System

  • Dynamic Chapters: Create story chapters with custom backgrounds and music
  • Auto-Progression: Chapters advance based on:
    • Time/dialogue count
    • Keyword triggers
    • AI-driven story judgment
  • Chapter-Specific Media: Each chapter can have unique background images and music

๐ŸŽจ Immersive Experience

  • Background Images: World defaults + chapter-specific backgrounds with stretch-to-fill mode
  • Background Music: Atmospheric audio that changes with chapters
  • Visual Effects: Enhanced transparency for better background visibility with blur effects
  • Sound Effects: Typewriter sound effects for authentic text appearance
  • Character Portraits: Display character portraits during conversations with download capability

๐Ÿค– AI Integration

  • Google Gemini: Free API via Google AI Studio (recommended)
  • OpenAI Compatible: Support for OpenAI and compatible APIs
  • Image Generation: Jimeng (Volcengine) API for character avatars and scene illustrations
  • Multi-Language: Built-in support for English, Chinese, and Thai

๐Ÿ’พ Data Management

  • Multiple Worlds: Create and switch between different story worlds
  • Import/Export: Complete world data export including characters, avatars, backgrounds, and chapters
  • World Rename: Easily rename existing worlds
  • Local Storage: All data stored locally in IndexedDB
  • Example Worlds: Pre-configured example worlds for quick start

๐Ÿ“ธ Screenshots

World Selection & Configuration

World Selector Create and manage multiple story worlds

World Configuration Configure world settings, backgrounds, and music

World Configuration - Chapters Manage story chapters with backgrounds and triggers

Character Management

Character List Talk with diverse AI characters in immersive worlds

Character Creation & Editing Create and customize characters with detailed settings and avatars

Character Creation Dialog Add new characters with personality, greeting, and avatar

Immersive Chat Experience

Chat Interface - Spring World Experience immersive chat with beautiful backgrounds and effects

Chat Interface - CypherPink World Dynamic storytelling with character interactions and chapter progression

Character Profiles

ZiWei Character Example character with detailed persona and backstory

Boss Character Diverse character types for varied interactions

Coach Character Create characters with different roles and personalities

Relaxing Atmospheres

Sakura Background Beautiful world environments with immersive backgrounds

Puppy Companion Craft unique worlds and characters for your stories

Application Views

Full Screen Chat Expanded chat view for maximum immersion

Full Window Interface Complete interface showing all controls and options

Sidebar Navigation Character and group management with quick access


๐Ÿš€ Quick Start

Installation

  1. Clone the repository

    git clone https://github.com/jhfnetboy/XGarden.git
    cd XGarden
  2. Install dependencies

    pnpm install
  3. Build the extension

    pnpm run build
  4. Load in Chrome

    • Open chrome://extensions/
    • Enable "Developer mode"
    • Click "Load unpacked"
    • Select the dist folder

First-Time Setup

  1. Get a Free API Key

  2. Configure XGarden

    • Click the XGarden extension icon
    • Go to Settings โ†’ AI Config
    • Enter your Gemini API key
    • Select your preferred model (e.g., gemini-2.0-flash)
  3. Create Your First World

    • Click "Create New World"
    • Add characters, define the world setting
    • Start chatting!

๐Ÿ“š Documentation

World Setup

1. World Defaults (Worldbook โ†’ Entries)

  • World Description: Overall setting and theme
  • Default Background: Image shown when no chapter is active
  • Default Music: Ambient music for the world

2. Characters

  • Name: Character identifier
  • Persona: Personality description for AI
  • Greeting: First message
  • Player Character: Mark one character as yourself

3. Worldbook Entries

  • Keywords: Trigger words (e.g., "magic system", "The Great War")
  • Content: Lore and context injected when keywords appear

4. Chapters (Worldbook โ†’ Chapters)

  • Order: Chapter sequence
  • Title & Description: Chapter info
  • Background Image/Music: Chapter-specific media
  • Trigger Type:
    • Time: Advance after N dialogues or minutes
    • Keyword: Advance when specific words appear
    • AI Judgment: Let AI decide when to progress

Image Generation API (Optional)

For AI-generated character avatars and scene illustrations:

  1. Get Jimeng API Keys

  2. Configure in Settings

    • Settings โ†’ Image API
    • Enter your credentials
    • Documentation

๐ŸŽต Adding Background Music

Music files should be placed in public/assets/music/:

  • peaceful-forest.mp3
  • calm-piano.mp3
  • ambient-space.mp3
  • medieval-lute.mp3
  • gentle-rain.mp3

Free Music Resources:

Alternatively, modify getMusicUrl() in ChatInterface.tsx to use online URLs.


๐Ÿ› ๏ธ Development

Tech Stack

  • React + TypeScript
  • Vite - Build tool
  • IndexedDB (via idb) - Local storage
  • LangChain - AI integration
  • TailwindCSS - Styling

Project Structure

src/
โ”œโ”€โ”€ components/          # React components
โ”‚   โ”œโ”€โ”€ ChatInterface.tsx
โ”‚   โ”œโ”€โ”€ WorldSelector.tsx
โ”‚   โ”œโ”€โ”€ Sidebar.tsx
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ services/           # Core services
โ”‚   โ”œโ”€โ”€ database.ts     # IndexedDB operations
โ”‚   โ”œโ”€โ”€ ai.ts          # AI service
โ”‚   โ”œโ”€โ”€ globalConfig.ts # Settings
โ”‚   โ””โ”€โ”€ vector-db.ts   # Vector search (RAG)
โ””โ”€โ”€ App.tsx            # Main app

Build Commands

pnpm run dev    # Development mode
pnpm run build  # Production build
pnpm run preview # Preview build

๐Ÿ—บ๏ธ Roadmap

v0.1.3 โœ…

  • โœ… World default backgrounds and music
  • โœ… Chapter system with auto-progression
  • โœ… Character and group management
  • โœ… Worldbook entries
  • โœ… Image API configuration (Jimeng)

v0.1.4 (Current) โœ…

  • โœ… Enhanced background image clarity (bg-cover stretching)
  • โœ… Avatar and portrait management with delete functionality
  • โœ… Improved UI transparency for better background visibility
  • โœ… Typewriter sound effects for authentic text appearance
  • โœ… World rename functionality
  • โœ… Multi-language support (English, Chinese, Thai)
  • โœ… Portrait download capability
  • โœ… Sidebar logo branding

v0.2.0 (Next Release)

  • ๐Ÿ”„ AI image generation integration
    • Character avatar generation
    • Scene illustration generation
    • Dynamic visual storytelling
  • ๐Ÿ”„ Enhanced RAG with vector embeddings
  • ๐Ÿ”„ Performance optimizations

v0.3.0 - Historical & Literary Worlds

  • ๐Ÿ“š Pre-built World Templates
    • Romance of the Three Kingdoms (ไธ‰ๅ›ฝๆผ”ไน‰)
    • Journey to the West (่ฅฟๆธธ่ฎฐ)
    • The Three Musketeers
    • Greek Mythology
    • Norse Mythology
    • And more classic literature worlds
  • ๐ŸŽญ Historical Characters Integration
    • Interact with historical figures in their contexts
    • Accurate historical backgrounds and settings
    • Educational storytelling experiences

v0.4.0 - Famous Personalities Database

  • ๐Ÿง‘โ€๐Ÿ”ฌ Scientists & Innovators
    • Alan Turing (Computer Science Pioneer)
    • Claude Shannon (Information Theory Founder)
    • Albert Einstein (Theoretical Physicist)
    • Isaac Newton (Mathematician & Physicist)
    • Marie Curie (Physicist & Chemist)
    • And many more...
  • ๐Ÿ’ญ Philosophers & Thinkers
    • Socrates, Plato, Aristotle
    • Confucius, Laozi
    • Modern philosophers
  • ๐Ÿ’ผ Economists & Psychologists
    • Adam Smith, John Maynard Keynes
    • Sigmund Freud, Carl Jung
    • Contemporary thought leaders
  • ๐ŸŽจ Artists & Writers
    • Shakespeare, Tolstoy, Hemingway
    • Da Vinci, Van Gogh, Picasso
    • And more cultural icons

v0.5.0 - Open Gaming Platform

  • ๐ŸŽฎ Community Features
    • Share custom worlds and characters
    • Community-created content library
    • Rating and review system
  • ๐ŸŒ Multiplayer Interactions
    • Shared world experiences
    • Collaborative storytelling
    • Real-time character interactions
  • ๐Ÿ† Gamification
    • Achievement system
    • Story progression tracking
    • Community challenges

Future Vision

  • ๐ŸŽฌ Video generation for cinematic storytelling
  • ๐ŸŽ™๏ธ Voice synthesis for character dialogues
  • ๐ŸŒณ Branching storylines with choice consequences
  • ๐Ÿ”— Blockchain integration for NFT characters/worlds
  • ๐Ÿ“ฑ Mobile companion app
  • ๐ŸŒ Multi-language support (Chinese, English, Japanese, etc.)

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

  • Google Gemini for free AI API access
  • Volcengine Jimeng for image generation capabilities
  • LangChain for AI integration framework
  • Open-source AI training datasets for historical character data
  • All open-source contributors and community members

๐Ÿ“ž Support


Made with โค๏ธ by the XGarden Team

โญ Star us on GitHub if you find this project useful! โค๏ธ Thanks and inspired by 3000World repo and SillyTavern

About

Yeah, it is yet another? crypto game framework, that service for the Arcadia: XGarden

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages