Spermagotchi - A Science-Based Sperm Racing Simulator

Inspiration

We wanted to create a tongue-in-cheek Tamagotchi for the goon community, something funny and chaotic that still encourages healthy habits. The idea was to blend meme culture with genuine wellness tracking, so while players laugh at the absurdity, they also build better routines.

What it does

When players start, they hatch their own mischievous little swimmer and begin checking in each day to track their good and bad habits. Each check-in updates four science-flavoured stats — Motility, Linearity, Flow, and Signals — which affect how the swimmer performs in 30–45 second races.

1. Hatch & Track: Users start a 72-day "season" and hatch their own swimmer. They use a quick daily check-in to log habits (e.g., sleep, exercise, hydration, supplements).

2. Level Up Stats: Each habit maps to four "gamified" sperm parameters derived from CASA (Computer-Assisted Sperm Analysis) metrics:

  • Motility (MOT): Progressive swimming speed (VCL - curvilinear velocity) - affected by energy, sleep, and toxins
  • Linearity (LIN): Path straightness (VSL/VCL ratio) - improved by consistent sleep and reduced by alcohol
  • Flow (FLOW): Rheotactic response to fluid environments - boosted by hydration, reduced by heat exposure
  • Signals (SIG): Chemotactic sensing and hyperactivation - enhanced by antioxidants (matcha), inhibited by smoking

3. Race for Glory: The 2D racing simulation accurately models real sperm navigation challenges:

  • Flow Zones: Simulate cervical mucus currents where high FLOW stats enable rheotaxis (swimming against flow)
  • Gradient Zones: Simulate chemical gradients where SIG (chemotaxis) guides navigation toward the target
  • Viscous Zones: Simulate thick mucus barriers where MOT (raw power) and LIN (efficient pathing) matter most

Each zone's physics uses soft-cap logarithmic scaling to normalize stats while preserving relative advantages, ensuring races feel fair while rewarding stat optimization.

4. Customize & Progression: Winning races earns "sperm count" coins to buy cosmetics (hats, skins, backgrounds). A streak system, weekly milestones, and stat caps reward long-term consistency over short-term grinding. An ELO matchmaking system pairs you with similarly-skilled opponents, and stat rankings (C → B → A → S → SS → SSS → SSS+) provide clear progression goals.

How we built it

We built Spermagotchi with scientific accuracy as the foundation, ensuring every system connects cohesively from real biology to gameplay.

Frontend: Next.js 16 (App Router) and React 19 with JavaScript for a fast, server-routable architecture. Tailwind CSS v4 for rapid, utility-first styling with custom animations.

State Management: React's built-in hooks for clean player data management.

Persistence: Next.js API Routes backed by JSON file storage + localStorage for session management. Optimistic UI updates with debounced saves ensure responsive interactions.

Race Physics Engine: Custom deterministic 2D simulation built on Rapier2D:

  • Three biologically-accurate zone types (flow, gradient, viscous)
  • Stat-to-performance formulas based on fertility research
  • Fixed 60 FPS timestep with accumulator for frame-rate independence
  • Seeded randomness for variety while maintaining fairness

Biological Mapping System:

Real Habit → Clinical Effect → Game Stat → Race Mechanic → Observable Outcome
Example: Sleep 8hrs → Improved cell motility → +1.5 LIN → Straighter paths → Cleaner racing lines

Game Balance Architecture: All progression is controlled through data-driven configs, allowing rapid iteration on habit rewards, race physics, and stat scaling without touching core simulation logic.

Challenges we ran into & What we learned

1. Balancing Scientific Accuracy with Fun Gameplay

Our biggest challenge was respecting real biology while making engaging mechanics. We learned that real science makes better game design—when we modeled flow zones after actual rheotaxis (sperm swimming against currents), players intuitively understood it without tutorials. The biology gave us coherent rules that didn't need arbitrary justification.

We created a three-zone race system where each zone's physics directly maps to real tract environments. Players naturally discover that high FLOW helps in flow zones, high SIG helps in gradient zones—just like real sperm navigation.

2. Infinite Stat Progression vs. Balanced Competition

Players wanted numbers that grow forever (50→100→200→300+), but races need bounded effectiveness to stay competitive. Clinical research showed us the answer: biological systems have saturation points (enzymes, receptors have maximum binding capacity).

Our soft-cap logarithmic normalization (100 * (1 - e^(-x/100))) mimics real biological diminishing returns. Stats grow infinitely, rankings stay meaningful (C→SSS+), but races remain balanced. Biology solved our game design problem!

3. Deterministic Physics for Fair Competition

Building races that feel dynamic but produce identical results with same inputs (required for fair ELO and future ghost racing) taught us that determinism requires fixed timesteps and pure functions. We implemented physics at exactly 1/60s steps with accumulator-based updates, ensuring frame-rate-independent consistency.

4. Connecting Habits to Observable Race Behavior

Making the habit→stat→race chain visible and satisfying was critical. We learned that showing the "why" makes progression feel earned, not arbitrary. Real-time stat deltas (+1.5 in green), hover tooltips with biological context, speech bubbles during races ("Thick here!"), and rankings (A, S, SS) all make abstract fertility metrics tangible.

5. Maintaining End-to-End Cohesion

As we added features (streaks, shop, ELO, unique track geometries), we had to ensure every addition respected the biology. We learned to treat the scientific mapping as sacred—every new mechanic needed to answer "how does this relate to real fertility?"

Accomplishments that we're proud of

End-to-End Scientific Coherence: Despite the memey theme, we're proud that every mechanic traces back to reproductive biology:

  • Habit effects match clinical research (e.g., smoking → -2 MOT mirrors 40-60% motility reduction in studies)
  • Race zones simulate real tract environments with accurate physics (viscosity, chemotaxis, rheotaxis)
  • Stat names are actual CASA parameters used in fertility clinics worldwide
  • The progression system respects biological reality (diminishing returns, saturation curves)
  • Track geometries represent anatomical challenges (spiral ampulla, narrow isthmus, cervical crypts)

Complete Biological→Gameplay Pipeline:

Clinical Research → Habit Effect → Stat Change → Race Mechanic → Visual Feedback
Smoking study (-40% motility) → -2 MOT → Lower velocity → Visible struggle in viscous zones

Emergent Strategy from Real Biology: Players naturally discover optimization strategies that mirror actual fertility advice:

  • High MOT builds (exercise + sleep) dominate viscous tracks = real advice for thick cervical mucus
  • High SIG builds (antioxidants) excel in gradient tracks = real chemotaxis optimization
  • Balanced builds (all habits) perform consistently = actual holistic fertility approach

Deterministic Science Simulation: Built a physics engine where:

  • Same stats + same track + same seed = identical race (required for fair competition)
  • Physics runs at fixed 60 FPS timestep regardless of device performance
  • Soft-cap normalization based on real biological saturation curves
  • Six dramatically different track geometries with varied challenges

Cohesive Game Loop: Every system reinforces the others:

  • Daily habits → Stat changes → Better race performance → Earn points → Buy cosmetics → Visual progression
  • Streaks → Bonus stats → Higher rankings → Tougher opponents → Greater challenge
  • ELO system → Fair matchmaking → Competitive races → Meaningful wins

What's next for Spermagotchi

Expanded Track System:

  • 20+ unique tracks representing different conditions (ovulation phase, pH variations, immune responses)
  • User-created tracks with our geometry system + JSON sharing
  • Track-specific leaderboards and mastery rankings

Educational Mode: Add optional "Science Mode" showing:

  • Real research citations for each habit effect
  • Detailed explanations of race zone physics
  • Interactive biology lessons unlocked through progression
  • Transform the game into a legitimate fertility education tool

🔬 Technical Notes for Judges

Key Innovation: Our stat normalization system solves a fundamental game design problem:

  • Players want unlimited growth (numbers going up forever)
  • Competitive games need bounded effectiveness (can't have 10000x power differences)
  • Our soft-cap formula elegantly solves both while being biologically accurate (real enzymes/receptors have saturation points!)

Scientific Rigor:

  • Habit effects scaled to match clinical research ranges (smoking → -40-60% motility in studies → -2 stat points in our 0-100 scale)
  • Zone physics mirror real tract properties (cervical mucus flow: 20-40 μm/s → our flow zone boost proportional to FLOW stat)
  • Track geometries represent anatomical challenges (spiral track = ampulla anatomy, canyon = narrow isthmus)
  • Soft-cap formula mimics real biochemical saturation curves (Michaelis-Menten kinetics)

Despite the humorous theme, this is a legitimate fertility science simulator with accurate mechanics rooted in reproductive biology research! 🧬🏁

Built With

Share this project:

Updates