Skip to content

ChanMeng666/ai-human-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

39 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– AI vs Human Guessing Game ๐Ÿ‘ค

Test Your Ability to Distinguish AI from Human Content

An interactive web-based quiz game that challenges players to identify whether content is AI-generated or human-created across four engaging categories: Text, Images, Audio, and Video.
Features beautiful pond-themed UI, real-time scoring, and progressive difficulty.
One-click FREE deployment ready.

๐ŸŽฎ Play Live Demo ๐ŸŽฎ


Share This Game

๐ŸŽฏ Challenge your perception. Can you tell the difference between AI and human creativity?

Important

This interactive game helps users understand the capabilities and limitations of AI-generated content. Perfect for educators, AI enthusiasts, and anyone curious about the future of content creation. Features include 4 content categories, 10 questions per category, and comprehensive performance analytics.

๐Ÿ“‘ Table of Contents

TOC


๐ŸŒŸ Introduction

Welcome to the AI vs Human Guessing Game! This project explores the fascinating boundary between AI-generated and human-created content. As AI technology rapidly advances, distinguishing between artificial and authentic content becomes increasingly challenging. This game provides an engaging platform to test and improve your detection skills across multiple content types.

Whether you're a student learning about AI, an educator teaching digital literacy, or simply curious about AI capabilities, this game offers valuable insights into the current state of generative AI technology.

๐ŸŽฎ Live Demo

Experience the game now at https://ai-human-game.chanmeng-dev.workers.dev/

Note

  • Node.js >= 18.0 required for local development
  • No external API keys needed
  • Content files must be provided by users for custom deployment
  • Works fully offline after setup

Tip

โญ Star this repository to stay updated with new features and content categories!

โญ Star History

Add star history chart after repository gains traction

โœจ Key Features

1 Multi-Category Content Testing

Experience comprehensive AI detection training across four distinct content types. Each category presents unique challenges that test different aspects of your perception and analytical skills.

Available Categories:

  • ๐Ÿ“ Text Content: Compare writing styles, grammar patterns, and creative expression
  • ๐Ÿ–ผ๏ธ Image Content: Analyze visual artifacts, composition, and artistic techniques
  • ๐ŸŽต Audio Content: Detect differences in sound quality, voice patterns, and musical composition
  • ๐ŸŽฌ Video Content: Identify motion patterns, visual effects, and editing styles
๐Ÿ” Category Details

Each category includes:

  • 10 Question Pairs: Carefully curated AI vs Human comparisons
  • Side-by-Side Display: Easy comparison interface
  • Instant Feedback: Learn immediately after each answer
  • Randomized Positioning: Left/right placement varies to prevent pattern guessing
  • Progressive Difficulty: Questions increase in challenge

2 Interactive Gameplay

Engaging user experience with beautiful pond-themed UI, smooth animations, and comprehensive feedback system. Built with modern React practices for optimal performance.

Gameplay Features:

  • ๐ŸŽฏ Single-Player Mode: Focus on improving your own skills
  • ๐Ÿ“Š Real-Time Scoring: Track your progress throughout the game
  • ๐Ÿ’ก Immediate Feedback: Learn from each question instantly
  • ๐Ÿ† Performance Analytics: Detailed results and improvement suggestions
  • ๐ŸŽจ Custom Pond Theme: Unique visual design with Peaberry font

* Additional Features

Beyond the core gameplay, this project includes:

  • ๐ŸŽจ Beautiful UI/UX: Custom pond-themed design with professional graphics
  • ๐Ÿ“ฑ Fully Responsive: Seamless experience across all devices
  • โšก Lightning Fast: Optimized Next.js 16 with App Router
  • ๐Ÿ”’ Privacy First: No data collection, all processing client-side
  • ๐ŸŽต Sound Effects: Optional audio feedback for interactions
  • ๐Ÿ“Š Detailed Statistics: Comprehensive performance breakdowns
  • ๐Ÿ”ง Highly Customizable: Easy content and question management
  • ๐ŸŒ Offline Ready: Works without internet after initial load

โœจ New categories and features are continuously being planned.

๐ŸŽฎ Game Screenshots

Home Screen

AI vs Human Guessing Game - Home Screen

Beautiful pond-themed interface welcoming players to the challenge

๐Ÿ“ธ View More Screenshots

[!TIP] The game features:

  • ๐Ÿ  Home Screen: Engaging pond-themed welcome page
  • ๐Ÿ“‹ Category Selection: Choose from Text, Images, Audio, or Video challenges
  • ๐ŸŽฎ Game Interface: Side-by-side content comparison with intuitive controls
  • โœ… Instant Feedback: Real-time response after each answer
  • ๐Ÿ“Š Results Page: Comprehensive performance analysis and statistics
  • ๐ŸŽฏ Summary View: Track your progress across all categories

Visit the live demo to experience the full interface!

๐Ÿ› ๏ธ Tech Stack

Next.js
Next.js 16
React
React 19
TypeScript
TypeScript 5
Tailwind
Tailwind CSS

Frontend Stack:

  • Framework: Next.js 16 with App Router for optimal performance
  • Language: TypeScript 5 for complete type safety
  • Styling: Tailwind CSS with custom Peaberry font
  • State Management: React Context API for game state
  • Components: Custom UI components with pond theme

Development Tools:

  • Package Manager: npm/yarn/pnpm
  • Linting: ESLint with Next.js configuration
  • Code Formatting: Prettier
  • Version Control: Git

Tip

This tech stack was selected for rapid development, excellent developer experience, and easy deployment to multiple platforms.

๐Ÿ—๏ธ Architecture

System Architecture

graph TB
    subgraph "Client Layer"
        A[Next.js App] --> B[React Components]
        B --> C[Game Context]
        C --> D[Local State]
    end
    
    subgraph "Data Layer"
        E[questions.json] --> F[Content Metadata]
        G[Content Files] --> H[Media Assets]
    end
    
    subgraph "UI Components"
        I[Home Page]
        J[Category Selection]
        K[Game Interface]
        L[Results Page]
    end
    
    A --> I
    A --> J
    A --> K
    A --> L
    
    C --> E
    K --> G
    
    subgraph "Assets"
        M[Text Files]
        N[Images]
        O[Audio Files]
        P[Video Files]
    end
    
    G --> M
    G --> N
    G --> O
    G --> P
Loading

Game Flow

sequenceDiagram
    participant U as User
    participant H as Home Page
    participant C as Category Selection
    participant G as Game Interface
    participant R as Results Page
    
    U->>H: Click "Play"
    H->>C: Navigate to Categories
    U->>C: Select Category (e.g., Text)
    C->>G: Load 10 Questions
    
    loop For Each Question (1-10)
        G->>U: Display Content Pair
        U->>G: Select Left or Right
        G->>U: Show Immediate Feedback
        G->>G: Update Score
    end
    
    G->>R: Navigate to Results
    R->>U: Display Final Score
    R->>U: Show Performance Breakdown
    U->>R: Choose to Play Again or Return Home
Loading

Component Structure

graph LR
    subgraph "App Router Pages"
        A[page.tsx<br/>Home]
        B[category/page.tsx<br/>Selection]
        C[game/page.tsx<br/>Main Game]
        D[results/page.tsx<br/>Summary]
        E[summary/page.tsx<br/>Overall Stats]
    end
    
    subgraph "Components"
        F[ContentDisplay.tsx<br/>Media Renderer]
    end
    
    subgraph "Context"
        G[GameContext.tsx<br/>State Management]
    end
    
    subgraph "Data"
        H[questions.json<br/>Question Metadata]
    end
    
    A --> B
    B --> C
    C --> D
    D --> A
    D --> E
    
    C --> F
    C --> G
    C --> H
    
    G --> A
    G --> B
    G --> C
    G --> D
Loading

๐Ÿš€ Getting Started

Prerequisites

Important

Ensure you have the following installed:

  • Node.js 18.0+ (Download)
  • npm, yarn, or pnpm package manager
  • Git (Download)
  • Content files for the game (see Content Setup)

Quick Installation

1. Clone Repository

git clone https://github.com/ChanMeng666/ai-human-game.git
cd ai-human-game

2. Install Dependencies

# Using npm
npm install

# Using yarn
yarn install

# Using pnpm (recommended)
pnpm install

3. Add Content Files

Follow the Content Setup guide below to add your game content.

4. Start Development Server

npm run dev

๐ŸŽ‰ Success! Open http://localhost:3000 to play the game.

Content Setup

The game requires content files to function. Add your files following this structure:

graph TB
    subgraph "Content Directory Structure"
        A[public/content/]
        A --> B[text/]
        A --> C[images/]
        A --> D[audio/]
        A --> E[videos/]
        
        B --> B1[human_1.txt to human_10.txt]
        B --> B2[ai_1.txt to ai_10.txt]
        
        C --> C1[human_1.jpg to human_10.jpg]
        C --> C2[ai_1.jpg to ai_10.jpg]
        
        D --> D1[human_1.mp3 to human_10.mp3]
        D --> D2[ai_1.mp3 to ai_10.mp3]
        
        E --> E1[human_1.mp4 to human_10.mp4]
        E --> E2[ai_1.mp4 to ai_10.mp4]
    end
Loading
๐Ÿ“ Text Content Requirements

Location: public/content/text/

Required Files (20 total):

  • human_1.txt to human_10.txt - Human-written text samples
  • ai_1.txt to ai_10.txt - AI-generated text samples

Sample Content Provided:

  • โœ… human_1.txt, human_2.txt
  • โœ… ai_1.txt, ai_2.txt

Content Guidelines:

  • Plain text format (.txt)
  • Similar length and topic to paired content
  • Diverse writing styles and subjects
  • 100-500 words per sample recommended
๐Ÿ–ผ๏ธ Image Content Requirements

Location: public/content/images/

Required Files (20 total):

  • human_1.jpg to human_10.jpg - Human-created images
  • ai_1.jpg to ai_10.jpg - AI-generated images

Supported Formats: JPG, PNG, WebP

Image Guidelines:

  • Resolution: 800x800px to 1920x1080px
  • File size: < 5MB each for optimal loading
  • Varied subjects and styles
  • Similar composition to paired image
๐ŸŽต Audio Content Requirements

Location: public/content/audio/

Required Files (20 total):

  • human_1.mp3 to human_10.mp3 - Human-created audio
  • ai_1.mp3 to ai_10.mp3 - AI-generated audio

Supported Formats: MP3, WAV

Audio Guidelines:

  • Duration: 10-60 seconds
  • Quality: 128kbps minimum
  • Varied content types (speech, music, ambient)
  • Similar style to paired audio
๐ŸŽฌ Video Content Requirements

Location: public/content/videos/

Required Files (20 total):

  • human_1.mp4 to human_10.mp4 - Human-created videos
  • ai_1.mp4 to ai_10.mp4 - AI-generated videos

Supported Formats: MP4, WebM

Video Guidelines:

  • Duration: 5-30 seconds
  • Resolution: 720p or 1080p
  • Codec: H.264 for MP4
  • File size: < 20MB each
  • Similar subject matter to paired video

๐Ÿ“ Project Structure

ai-human-game/
โ”œโ”€โ”€ app/                          # Next.js App Router
โ”‚   โ”œโ”€โ”€ page.tsx                 # Home page - Game entry point
โ”‚   โ”œโ”€โ”€ category/page.tsx        # Category selection interface
โ”‚   โ”œโ”€โ”€ game/page.tsx            # Main game interface
โ”‚   โ”œโ”€โ”€ results/page.tsx         # Results & immediate feedback
โ”‚   โ”œโ”€โ”€ summary/page.tsx         # Overall performance summary
โ”‚   โ”œโ”€โ”€ layout.tsx               # Root layout with GameProvider
โ”‚   โ””โ”€โ”€ globals.css              # Global styles & Tailwind imports
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ””โ”€โ”€ ContentDisplay.tsx   # Dynamic content renderer
โ”‚   โ”œโ”€โ”€ context/
โ”‚   โ”‚   โ””โ”€โ”€ GameContext.tsx      # Global game state management
โ”‚   โ”œโ”€โ”€ data/
โ”‚   โ”‚   โ””โ”€โ”€ questions.json       # Question metadata & configuration
โ”‚   โ””โ”€โ”€ assets/                  # Static assets
โ”‚       โ”œโ”€โ”€ fonts/               # Custom Peaberry font
โ”‚       โ””โ”€โ”€ images/              # UI graphics & pond theme
โ”œโ”€โ”€ public/
โ”‚   โ”œโ”€โ”€ audio/                   # Sound effects
โ”‚   โ”‚   โ”œโ”€โ”€ correct.mp3
โ”‚   โ”‚   โ””โ”€โ”€ wrong.mp3
โ”‚   โ””โ”€โ”€ content/                 # Game content files
โ”‚       โ”œโ”€โ”€ text/                # Text content pairs
โ”‚       โ”œโ”€โ”€ images/              # Image content pairs
โ”‚       โ”œโ”€โ”€ audio/               # Audio content pairs
โ”‚       โ””โ”€โ”€ videos/              # Video content pairs
โ”œโ”€โ”€ package.json                 # Dependencies & scripts
โ”œโ”€โ”€ tsconfig.json                # TypeScript configuration
โ”œโ”€โ”€ tailwind.config.ts           # Tailwind CSS configuration
โ”œโ”€โ”€ next.config.ts               # Next.js configuration
โ”œโ”€โ”€ wrangler.jsonc               # Cloudflare Workers configuration
โ”œโ”€โ”€ open-next.config.ts          # OpenNext adapter configuration
โ””โ”€โ”€ README.md                    # This file
๐Ÿ” Key Files Explained

app/layout.tsx

  • Root layout component
  • Wraps entire app with GameProvider
  • Loads global styles and fonts

src/context/GameContext.tsx

  • Manages global game state
  • Tracks current question, score, and answers
  • Provides game control functions

src/data/questions.json

  • Defines all game questions
  • Maps content file paths
  • Configures human position randomization

src/components/ContentDisplay.tsx

  • Renders content based on type (text/image/audio/video)
  • Handles different media formats
  • Provides consistent display interface

๐ŸŽฏ How to Play

flowchart TD
    A[๐Ÿ  Home Screen] --> B[๐Ÿ“‹ Select Category]
    B --> C{Choose Content Type}
    C -->|Text| D[๐Ÿ“ Text Challenge]
    C -->|Images| E[๐Ÿ–ผ๏ธ Image Challenge]
    C -->|Audio| F[๐ŸŽต Audio Challenge]
    C -->|Video| G[๐ŸŽฌ Video Challenge]
    
    D --> H[Compare Two Items]
    E --> H
    F --> H
    G --> H
    
    H --> I[Click Left or Right]
    I --> J[Get Instant Feedback]
    J --> K{More Questions?}
    K -->|Yes| H
    K -->|No| L[๐Ÿ“Š View Results]
    L --> M{Play Again?}
    M -->|New Category| B
    M -->|Same Category| H
    M -->|Home| A
Loading

Step-by-Step Guide:

  1. ๐Ÿ  Start: Click "Play" on the home screen
  2. ๐Ÿ“‹ Choose Category: Select from Text, Images, Audio, or Video
  3. ๐Ÿ‘€ Compare: View two pieces of content displayed side-by-side
  4. ๐Ÿ–ฑ๏ธ Make Selection: Click the left or right button for human-created content
  5. โœ… Get Feedback: See immediately if your choice was correct
  6. ๐Ÿ”„ Continue: Progress through all 10 questions in the category
  7. ๐Ÿ“Š Review Results: See your final score and performance analysis
  8. ๐ŸŽฎ Play Again: Try another category or replay to improve

Tip

Take your time with each question! There's no time limit, so analyze the content carefully before making your selection.

๐Ÿ† Scoring System

Points Structure:

  • โœ… Correct Answer: +1 point
  • โŒ Incorrect Answer: 0 points
  • ๐ŸŽฏ Maximum Score: 10/10 per category

Performance Levels:

Score Level Badge Feedback
10/10 ๐Ÿ† Perfect! Expert You have an exceptional eye for detail!
8-9/10 ๐ŸŒŸ Excellent! Advanced Great job! You're really good at this.
5-7/10 ๐Ÿ‘ Good! Intermediate Solid performance! Keep practicing.
0-4/10 ๐Ÿ’ช Keep Trying! Beginner This is challenging! Don't give up.

Statistics Tracked:

  • Total questions answered
  • Correct vs incorrect answers
  • Success rate percentage
  • Category-specific performance
  • Answer patterns and tendencies
๐Ÿ“Š Performance Analytics

The game tracks comprehensive statistics including:

  • Overall Accuracy: Percentage of correct answers
  • Category Breakdown: Performance by content type
  • Improvement Tracking: Compare scores across attempts
  • Common Mistakes: Patterns in incorrect answers

๐ŸŽจ Customization

Modify Question Descriptions

Edit src/data/questions.json to customize question text and content paths:

{
  "id": 1,
  "category": "text",
  "humanContent": "/content/text/human_1.txt",
  "aiContent": "/content/text/ai_1.txt",
  "humanPosition": "left",
  "description": "Which text was written by a human?"
}

Customizable Fields:

  • description: Question prompt shown to users
  • humanPosition: "left" or "right" to vary content placement
  • humanContent: Path to human-created content file
  • aiContent: Path to AI-generated content file

Randomize Human Position

Vary the humanPosition field across questions to prevent pattern-based guessing:

{ "id": 1, "humanPosition": "left" },
{ "id": 2, "humanPosition": "right" },
{ "id": 3, "humanPosition": "left" }

Customize Styling

Modify Colors: Edit tailwind.config.js for custom color schemes

Change Fonts: Replace font files in src/assets/fonts/

Update Theme: Modify app/globals.css for global style changes

๐Ÿ›ณ Deployment

Cloud Deployment Options

Cloudflare Workers (Recommended)

The live demo is deployed at https://ai-human-game.chanmeng-dev.workers.dev/

Deployment via Wrangler CLI:

# Login to Cloudflare
npx wrangler login

# Build and deploy
npm run deploy

Tip

The project uses @opennextjs/cloudflare adapter for deploying Next.js on Cloudflare Workers with edge performance and global CDN.

Other Platforms:

โ˜๏ธ Alternative Deployment Options

Vercel:

npm i -g vercel
vercel --prod

Self-Hosted:

# Build for production
npm run build

# Start production server
npm start

Build Commands

# Production build
npm run build

# Start production server
npm start

# Preview build locally
npm run build && npm start

Warning

Ensure all content files are included in your deployment. Large media files may require CDN or external hosting for optimal performance.

๐Ÿ› Troubleshooting

๐Ÿ”ง Content Not Loading

Problem: Content files not displaying or 404 errors

Solutions:

  • โœ… Verify files are in correct directories (public/content/[category]/)
  • โœ… Check file naming: human_1.txt, ai_1.jpg, etc. (lowercase, underscore)
  • โœ… Confirm file extensions match supported formats
  • โœ… Check browser console for specific error messages
  • โœ… Ensure file paths in questions.json match actual files

Debug Command:

# List all content files
ls -R public/content/
๐ŸŽต Audio/Video Not Playing

Problem: Media files won't play or show errors

Solutions:

  • โœ… Verify file format is supported (MP3/WAV for audio, MP4/WebM for video)
  • โœ… Check file encoding (H.264 for MP4, Opus for WebM)
  • โœ… Test in different browsers (Chrome, Firefox, Safari)
  • โœ… Reduce file size if loading is slow
  • โœ… Check browser console for codec errors

Recommended Codecs:

  • Video: H.264/AVC with AAC audio
  • Audio: MP3 at 128kbps or higher
โšก Performance Issues

Problem: Game loading slowly or lagging

Solutions:

  • โœ… Optimize media file sizes (use compression tools)
  • โœ… Implement lazy loading for large media
  • โœ… Clear browser cache and reload
  • โœ… Check network tab for slow-loading resources
  • โœ… Consider using CDN for large content files

Optimization Tips:

# Install image optimization tool
npm install -g sharp-cli

# Optimize images
sharp -i input.jpg -o output.jpg --quality 80 --resize 1200
๐ŸŽจ Font Not Displaying

Problem: Custom Peaberry font not loading

Solutions:

  • โœ… Verify PeaberryBase.woff2 exists in src/assets/fonts/
  • โœ… Check font declaration in app/globals.css
  • โœ… Clear browser cache and hard refresh (Ctrl+Shift+R)
  • โœ… Inspect element to verify font-family is applied
๐Ÿ”จ Build Failures

Problem: npm run build fails

Solutions:

# Clear npm cache
npm cache clean --force

# Remove node_modules and reinstall
rm -rf node_modules package-lock.json
npm install

# Check for TypeScript errors
npm run type-check

# Check for linting issues
npm run lint

๐Ÿ“„ License

This project is open source and available under the MIT License.

What You Can Do:

  • โœ… Use commercially
  • โœ… Modify freely
  • โœ… Distribute copies
  • โœ… Private use

Credits:

  • UI Theme & Assets: Based on OOPTriviaGame (Pond Ponder) by PowerPuff People
  • Custom Font: Peaberry Base
  • Framework: Next.js by Vercel

๐Ÿ™‹โ€โ™€๏ธ Author

Chan Meng
Chan Meng

Creator & Lead Developer

Chan Meng


๐Ÿค– Challenging Human Perception in the Age of AI ๐Ÿง 


Can you tell the difference? Test yourself today!



โญ Star this repository โ€ข ๐Ÿ› Report Issues โ€ข ๐Ÿ’ก Suggest Features โ€ข ๐Ÿค Contribute



Made with โค๏ธ by Chan Meng


Perfect for educators, AI enthusiasts, and the curious mind


About

A web-based quiz game challenging players to distinguish between AI-generated and human-created content across text, images, audio, and video. Built with Next.js, TypeScript, and TailwindCSS.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors