🐾 Pocket Pet

A nostalgic, relaxing virtual pet simulator powered by generative AI—where your imagination is the only limit to the companion you create.


💡 Inspiration

I’ve always loved classic virtual pet games like Tamagotchi and the joy of keeping a digital companion in my pocket. I’m also a huge Pokémon fan, endlessly inspired by unique creature designs and the deep bonds formed with them. But every time I played, I hit the same classic dilemma: Do I pick Squirtle or Charmander?

That’s when it hit me: Why choose at all? What if I could have the best of both worlds—a design 100% tailored to my own style?

Most pet simulators force players to choose from a fixed set of pre-made animals. I built Pocket Pet so no one has to compromise on how their ideal companion looks. There are no battles or superpowers here—just pure, relaxing caretaking. You design your pet's exact visual appearance, hatch them, and nurture them as they grow from a baby into your custom adult best friend.


✨ What It Does

Pocket Pet brings custom companion generation into a fully playable, animated mobile game:

  • 🎨 Custom Pet Creation: Design a unique companion from scratch using text prompts or reference images to shape ears, tails, fur patterns, and colors—or adopt a ready-made design from the curated gallery.
  • 🐣 Full Growth Pipeline: Watch your custom creation naturally grow through distinct life stages—from an unhatched egg to a playful baby, all the way to a loyal adult.
  • 🧼 Interactive Care & Vitals: Keep your companion happy and healthy by feeding them treats, giving them baths, stroking them, curing them when sick, and playing mini-games.
  • ⏳ Real-Time Vitals Decay: Stats decay based on real-world time, calculated dynamically using server snapshots and timezone-aware logic so your pet never sleeps at odd hours.

🛠️ How We Built It

Developing Pocket Pet was a step-by-step process of validating technical feasibility, gamifying AI processing delays, and building a secure backend state engine.

1. Proof of Concept: Prompt Engineering & Prototyping

Before writing the core game, I had to answer: "can this be built?", "is this feasible?"

  • Prompt & Reference Engineering: Tested Google Gemini to consistently generate spritesheets containing multiple poses of a creature. Using a base reference image dramatically increased performance.
  • Prototyping: Built a lightweight Unity prototype to verify that extracted LLM sprites could be animated cleanly in real time.

2. Gamifying the AI Pipeline (The Egg Lore)

Using a reference image meant the user first needed to pick a static creature design. To make this fun:

  • The Hatching & Hibernation System: I wrapped the asynchronous generation phase inside game lore. Players select an unhatched egg, design their pet, and wait for it to "hatch"—which serves as the interactive loading phase while background workers process the LLM sprites.
  • Async Workers & Push Notifications: When a player requests a generation or growth phase, my backend schedules a background task. Once the LLM finishes and sprites are processed, the API sends a push notification to Unity, prompting the player to review their new animations.
  • Iterative Onboarding UI: I designed a generation wizard allowing players to re-prompt, re-color, or request single-frame fixes if an LLM frame produces visual anomalies before committing.

3. Account Auth & Social Sign-In

Once the onboarding and generation pipeline were proven, I built the account creation flow. To keep friction low, I integrated social authentication (Apple & Google Sign-In) to ensure user progress and custom-designed pets carry over seamlessly across devices.

4. Custom Backend & Vitals Synchronization

  • Django & PostgreSQL Architecture: Built a custom Django (Python) REST API backed by PostgreSQL to manage user profiles, item inventories, and pet snapshot states.
  • Timezone-Aware State Machine: To prevent client-server state desyncs, care actions (feed, bathe, play) are sent to the Django API and applied to the latest database snapshot. The server calculates vitals decay relative to the player's local timezone so pets don't sleep at unnatural hours.

5. Monetization, Security & Settings

  • RevenueCat Integration: Handles App Store and Google Play transactions via server-to-server webhooks to safely credit in game items directly to the user's account in PostgreSQL.
  • Hardware App Attestation: Secured open onboarding endpoints using Firebase App Check—leveraging Google Play Integrity on Android and Apple App Attest / DeviceCheck on iOS to block unauthorized API access.

6. AI-Assisted Development

Production was greatly accelerated by pairing multiple AI models to reduce hallucinations: Claude served as the primary agentic coder, ChatGPT was also used for agentic programming, and Gemini was used for consultation, validation, and core sprite generation.


🎯 Challenges We Ran Into

  • 🎨 Background Removal: Google Gemini struggled with transparent backgrounds. I enforced a solid background color for all generated outputs, running automated edge-detection and background removal on the server before sprite cutting.
  • 💰 Cost-Effective Animation: The costs of image generation is not cheap. In order to keep the vision feasible for a small indie team of one person (me 🙂), I had to come up with a system where the animations were composed of small set of sprites that the LLM also generates. But in order to make this efficient, each animation, for example, the happy animation, is generated as a single image containing several sprites with different positions of the character, which after processing, gives the appearance of movement. It is not the most fluid movement, but it makes it so that the budget does not spiral out of control, and is also reminiscent of old school virtual pet games.
  • 🧬 LLM Consistency & Sprite Normalization: Generative models naturally make size, proportions, or color mistakes. I built automated image-processing scripts to normalize sprite dimensions alongside an in-game User Review & Regeneration UI so players can check each of the generated images and request a regeneration so that wildly distinct sprites can be corrected.

🏆 Accomplishments That We're Proud Of

  • Living the Vision: The game is fun and cute, which was the idea from the start. What started as a premise of "is this achievable technically?" became a passion project that made me increasingly excited about its possibilities.
  • Seamless Immersion: Successfully disguised complex backend processing (background tasks, queueing, and sprite extraction) inside delightful in-world lore like egg-hatching and hibernation.
  • Technical Resilience: Overcame complex platform hurdles across image processing, server sync, and mobile engine optimization.

📚 What We Learned

  • 🖼️ Advanced Image Processing: Mastered server-side sprite sheet cutting, color normalization, and token-efficient prompt structures for LLM vision models.
  • 🛡️ App Attestation & Security: Implemented Google Play Integrity and Apple App Attest / DeviceCheck with Firebase App Check to secure open onboarding endpoints against unauthorized API abuse.
  • 🛡️ Multi-Tier Content Moderation: Built a multi-layered moderation pipeline utilizing OpenAI's Moderation API alongside custom text/image safety filters to protect players—especially younger audiences—from inappropriate prompt inputs.
  • 💳 Server-Side Webhooks: Expanded from client-only SDKs to handling server-to-server RevenueCat webhooks to safely credit items and manage entitlement states directly on user accounts.

🚀 What's Next for Pocket Pet

The core loop is just the beginning. Future plans for Pocket Pet include:

  • 🧬 Breeding System: Combine two custom pets (or partner with a friend's pet) to pass down visual traits to a unique offspring.
  • 🏠 Adoption Center: Allow players to place pets up for adoption or rescue companions released by other owners.
  • 🧳 Pet Sitting & Visits: Send your pet to a friend's app while you're on vacation or visit friends' houses for mini-game playdates.
  • 🧸 Real-World Plushies: Connect the digital designs to custom print-on-demand services (via Shopify) so players can order physical plushies of their unique virtual pets!
Share this project:

Updates

Submission history