8000
Skip to content

smouj/asciicritters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

๐Ÿพ ASCIICritters

The Ultimate 3D Virtual Pet Creator

GitHub Stars GitHub License TypeScript Next.js Three.js PRs Welcome

CI/CD Code Size Last Commit Issues

ASCII art pets rendered in stunning 3D with bloom post-processing, cinematic particles, AI-powered chat, and a dark cyberpunk UI.

ASCIICritters Preview

Features โ€ข Quick Start โ€ข Tech Stack โ€ข Species โ€ข Architecture โ€ข Contributing


โœจ Features

๐ŸŽจ Stunning 3D Rendering

  • Canvas-based ASCII textures โ€” ASCII art rendered to canvas with glow/shadow, applied as 3D textures for perfect readability
  • Post-processing pipeline โ€” Bloom + Vignette for cinematic, neon-lit aesthetics
  • Dynamic lighting โ€” Intensity adapts to pet mood (bright when happy, dim when sad)
  • 30 floating particles โ€” Octahedrons with mood-matching colors orbit your pet
  • Starfield background โ€” 600 procedural stars with fade and drift

๐Ÿพ 12 Unique Species

Each with hand-crafted ASCII art, distinct color palettes, rarity levels, and AI personality profiles.

Species Rarity Personality
๐Ÿฆ… Phoenix Legendary Wise, poetic, dramatic
๐Ÿ‰ Dragon Epic Proud, protective, formal
๐Ÿฆ„ Unicorn Rare Graceful, dreamy, kind
๐Ÿค– Robot Rare Logical, helpful, data-driven
๐Ÿบ Wolf Uncommon Stoic, loyal, observant
๐Ÿฆ‰ Owl Uncommon Wise, thoughtful, nerdy
๐ŸฆŠ Fox Uncommon Clever, witty, mischievous
๐Ÿ‘ป Ghost Uncommon Mysterious, playful, spooky
๐Ÿฑ Neko Common Playful, curious, sassy
๐ŸŸข Slime Common Bubbly, innocent, excitable
๐Ÿข Turtle Common Patient, calm, slow
๐Ÿฐ Bunny Common Hyperactive, adorable, giggly

๐Ÿ’ฌ AI-Powered Chat

  • Talk to your pet using LLM (z-ai-web-dev-sdk)
  • Responses are character-driven โ€” each species has a unique personality
  • Pet mood and stats influence dialogue naturally
  • Conversations persist per session

๐ŸŽฎ 6 Interactive Actions

  • ๐Ÿ– Feed โ€” Restore hunger (5 tokens)
  • ๐ŸŽฎ Play โ€” Boost happiness (8 tokens)
  • ๐Ÿ’ช Train โ€” Gain XP & health (12 tokens)
  • ๐Ÿ’Š Heal โ€” Restore health (6 tokens)
  • ๐Ÿ˜ด Rest โ€” Recharge energy (4 tokens)
  • ๐Ÿค— Pet โ€” Show affection (3 tokens)

๐Ÿ“Š Session Analytics

  • Token tracking โ€” Every interaction costs tokens, visible in real-time
  • Action counter โ€” Track total interactions per session
  • XP & leveling โ€” 50 XP per level with progress bars
  • Mood system โ€” Ecstatic โ†’ Happy โ†’ Neutral โ†’ Sad โ†’ Critical

๐Ÿ–ฅ๏ธ Professional UI

  • Dark cyberpunk aesthetic with 1px border radius throughout
  • 3-column layout โ€” Pet list | 3D viewport | Info panel
  • Tabbed bottom panel โ€” Switch between Actions and Chat
  • Framer Motion animations โ€” Smooth transitions everywhere
  • Responsive design โ€” Works on desktop and mobile

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+ or Bun
  • Git

Installation

# Clone the repository
git clone https://github.com/smouj/asciicritters.git
cd asciicritters

# Install dependencies
bun install

# Set up database
bun run db:push

# Start development server
bun run dev

Open http://localhost:3000 to see your pets.

Environment Variables

# .env
DATABASE_URL="file:./db/custom.db"

๐Ÿ›  Tech Stack

Category Technology Purpose
Framework Next.js App Router, SSR, API routes
Language TypeScript Type safety
3D Engine Three.js WebGL rendering
React 3D @react-three/fiber + @react-three/drei React bindings for Three.js
Post-FX @react-three/postprocessing Bloom, Vignette
UI Library shadcn/ui + Radix Component system
Styling Tailwind CSS Utility-first CSS
Animations Framer Motion UI transitions
Database Prisma ORM + SQLite
AI Chat z-ai-web-dev-sdk LLM pet conversations
State Zustand + TanStack Query Client + server state

๐Ÿ— Architecture

asciicritters/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ page.tsx              # Main UI (3-column layout)
โ”‚   โ”‚   โ”œโ”€โ”€ layout.tsx            # Root layout + fonts
โ”‚   โ”‚   โ”œโ”€โ”€ globals.css           # Dark theme + CSS variables
โ”‚   โ”‚   โ””โ”€โ”€ api/
โ”‚   โ”‚       โ”œโ”€โ”€ species/route.ts  # GET /api/species
โ”‚   โ”‚       โ””โ”€โ”€ pets/
โ”‚   โ”‚           โ”œโ”€โ”€ route.ts      # GET/POST /api/pets
โ”‚   โ”‚           โ””โ”€โ”€ [id]/
โ”‚   โ”‚               โ”œโ”€โ”€ route.ts       # GET/DELETE /api/pets/:id
โ”‚   โ”‚               โ”œโ”€โ”€ action/route.ts # POST /api/pets/:id/action
โ”‚   โ”‚               โ””โ”€โ”€ chat/route.ts   # POST/DELETE /api/pets/:id/chat
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ pet/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ASCIIPetCanvas.tsx # Three.js 3D renderer
โ”‚   โ”‚   โ””โ”€โ”€ ui/                     # shadcn/ui components
โ”‚   โ””โ”€โ”€ lib/
โ”‚       โ”œโ”€โ”€ pets/
โ”‚       โ”‚   โ”œโ”€โ”€ types.ts           # Pet, Species, Chat interfaces
โ”‚       โ”‚   โ”œโ”€โ”€ species.ts         # 12 species definitions + ASCII art
โ”‚       โ”‚   โ”œโ”€โ”€ generator.ts       # Deterministic pet generation
โ”‚       โ”‚   โ”œโ”€โ”€ rng.ts             # Mulberry32 PRNG
โ”‚       โ”‚   โ””โ”€โ”€ index.ts           # Barrel exports
โ”‚       โ””โ”€โ”€ db.ts                  # Prisma client
โ”œโ”€โ”€ prisma/
โ”‚   โ””โ”€โ”€ schema.prisma              # Pet + PetAction models
โ”œโ”€โ”€ public/
โ”‚   โ””โ”€โ”€ og-image.png               # GitHub social preview
โ”œโ”€โ”€ LICENSE                        # MIT
โ”œโ”€โ”€ CONTRIBUTING.md
โ”œโ”€โ”€ CODE_OF_CONDUCT.md
โ”œโ”€โ”€ SECURITY.md
โ””โ”€โ”€ README.md

๐ŸŽฒ Deterministic Generation

Each pet is generated using a Mulberry32 pseudo-random number generator seeded from the user ID. This means:

  • The same user always gets the same pet for a given species
  • Stats, rarity, and name are all reproducible
  • No external randomness source needed
  • Fair distribution with weighted rarity rolls
// From src/lib/pets/rng.ts
function mulberry32(seed: number): () => number {
  return function () {
    let t = (seed += 0x6d2b79f5);
    t = Math.imul(t ^ (t >>> 15), t | 1);
    t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
    return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
  };
}

๐Ÿพ Species Gallery

๐ŸŽจ Click to view all ASCII art

Phoenix (Legendary)

         __          __
        /  \        /  \
       / .. \      / .. \
      /  /\  \    /  /\  \
     /  /  \  \  /  /  \  \
    /  /    \  \/  /    \  \
   /  /  /\   \    /\   \  \
  /  /  /  \       /  \   \  \
 /__/__/____\_____/____\___\
     \    \  |  |  /    /
      \____\ |  | /____/
            \|  |/
             |  |
            _|  |_

Dragon (Epic)

              __====-_  _-====__
         _--^^^#####//      \\#####^^^--_
      _-^##########// (    ) \\##########^-_
    -############//  |\^^/|  \\############-
   /############//   (@::@)   \\############\
  /#############((     \\//     ))#############\
 /###############\\    (oo)    //###############\
 /################\\  / VV \  //################\
/###################\\      \\//###################\

Neko (Common)

    /\_/\
   ( o.o )
    > ^ <
   /|   |\
  (_|   |_)
    "   "

๐Ÿ“„ License

This project is licensed under the MIT License โ€” see the LICENSE file for details.


๐Ÿค Contributing

Contributions are welcome! Please read CONTRIBUTING.md for guidelines.

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

๐Ÿ—บ Roadmap

  • Multi-pet collection view
  • Pet trading between users
  • Animated ASCII art (frame sequences)
  • Sound effects for actions
  • Pet evolution/evolution system
  • Achievement badges
  • Leaderboard (highest level pets)
  • Custom ASCII art upload
  • Mobile native app (React Native)
  • Multiplayer features (battles, trading)

Built with โค๏ธ by the ASCIICritters Team

โญ Star us on GitHub ยท ๐Ÿ› Report a Bug ยท ๐Ÿ’ก Request a Feature

About

๐ŸŽฎ The Ultimate 3D Virtual Pet Creator โ€” ASCII art pets rendered in stunning Three.js with AI chat, bloom post-processing, and cinematic effects

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

0