🎮 Journey Within - DevPost Submission

Inspiration

Mental health struggles are deeply personal, yet universally experienced. We noticed a gap in how mental health tools engage users - most are either purely clinical (therapy apps, mood trackers) or purely entertainment (wellness games). Journey Within was born from a simple question: What if your inner world could talk back to you?

We were inspired by the idea that mental health isn't about fixing yourself - it's about understanding yourself. Traditional therapy can be intimidating; initiating conversations about feelings is hard. We wanted to create a space where the world reaches out to you first, where your environment reflects your emotional state, and where every interaction is a step toward self-awareness.

What it does

Journey Within is an AI-powered psychological exploration game that generates a personalized world based on your life experiences. Here's how it works:

🗺️ Personalized World Generation

  • You share your life story and current struggles during onboarding
  • AI generates 8-10 unique zones representing actual places from your life (your apartment, workplace, favorite café, etc.)
  • Each zone has a psychological state (Suffocating, Peaceful, Monotonous) with intensity ratings
  • NPCs are real people from your life with dynamic relationship states (trust levels, emotional descriptors)

🎨 Dynamic Visual Feedback

  • Zones are color-coded by emotional state (red = overwhelming, purple = lonely, gray = monotonous)
  • NPCs display relationship status through colored borders (red to green gradient based on trust)
  • Your mental state (stress, energy, connection) is visualized through HUD bars
  • The entire world adapts visually to your psychological state

💬 Reactive Psyche Stream

This is where it gets unique - the game is not passive. Every 30 seconds, the world checks:

  • Should NPCs reach out to you? (based on relationship trust, your mental state, time since last contact)
  • Should zones "call" to you? (based on proximity, emotional intensity, psychological resonance)
  • Should your psyche generate alerts? (when stress/energy/connection hits thresholds)
  • Random intrusive thoughts based on your mental state

Messages appear in a notification stream on the right side of the screen:

  • 💬 NPC Messages: "Hey, I noticed you've been quiet lately. Want to talk?"
  • 🏠 Zone Calls: "The empty park bench waits for you..."
  • Mental Alerts: "Your stress is overwhelming. You feel like you might break."
  • 💭 Thoughts: "Does anyone actually care?"

You can respond, teleport there, or dismiss. The world initiates conversations when you're struggling to.

🤖 AI-Powered Conversations

  • Talk to NPCs - they remember your relationship history and respond authentically
  • Reflect in zones - your inner monologue adapts to the location's psychological state
  • Conversations affect your mental state and relationship dynamics
  • AI analyzes outcomes and updates the world in real-time

🧠 Smart NPC Behavior

  • NPCs wander their zones realistically
  • They follow you when you're close (creating presence)
  • Movement patterns reflect relationship states
  • Each NPC has unique emotional context

How we built it

We built Journey Within using React for the frontend with a custom Canvas-based 2D game engine, and Node.js/Express for the backend. The core innovation was creating a hybrid AI system where AI handles creative content generation while deterministic algorithms handle spatial logic.

Key Technical Approach:

  • AI generates content: Zone names, themes, emotional states, NPC personalities, relationship dynamics, and conversational responses
  • Smart algorithms handle world generation: Zone placement with collision detection, terrain patterns, NPC positioning, and safe spawn points
  • Reactive stream system: Probability-based checks every 30 seconds determine when NPCs/zones reach out based on multiple factors (trust, mental state, proximity, time)
  • Real-time canvas rendering: 40x40 tile grid with viewport culling, smooth camera following, and state-based visual overlays

The game world is fully dynamic - every conversation, every zone reflection, every stream notification affects your mental state and relationship dynamics in real-time.

Challenges we ran into

1. The Movement Bug from Hell 🐛

On initial game load, the player couldn't move until you resized the window. Took us hours to debug.

Problem: Canvas size wasn't set before camera calculation, causing coordinate mismatch.

Solution: Separated game loop initialization, forced canvas sizing before first draw, added proper cleanup to prevent double-initialization.

2. AI Coordinate Generation Was Chaos 🗺️

AI would generate zones with impossible coordinates or create overlapping zones trapping the player.

Solution: Complete architecture change - AI generates ONLY content (names, states, themes), our deterministic algorithm handles ALL spatial logic with smart placement, collision detection, and safe spawning.

3. Stream Messages Lost in the Void 💬

NPCs would send messages via the stream, but when you talked to them, they'd act like it never happened.

Solution: Added conversation history integration - stream messages save with special flags so dialogs can distinguish between user-initiated and world-initiated conversations.

4. NPC Movement Looking Robotic 🤖

Early versions had NPCs standing still or moving in straight lines.

Solution: Implemented smart wandering behavior with random target selection, time-based retargeting, follow behavior when player is close, and zone boundary enforcement.

5. Performance Issues

Initial large worlds caused frame drops.

Solution: Optimized world size, implemented viewport culling (only render visible tiles), cached calculations, and separated update/render loops for smooth 60 FPS.

Accomplishments that we're proud of

🎯 Technical Achievements

  • Hybrid AI System: Successfully separated AI creativity from deterministic logic
  • Zero-Bug World Generation: 100% playable worlds, no trapped players, no overlaps
  • Smooth 60 FPS: Canvas rendering with camera following, NPC movement, and state updates
  • Reactive Stream System: Probability-based world that genuinely feels alive

🎨 Design Achievements

  • Emotional Visual Language: Color-coded states that intuitively communicate feelings
  • Passive-to-Active Gameplay: Solved the "initiation problem" in mental health tools
  • Natural Conversations: AI that responds contextually to relationships and mental states
  • Atmospheric UI: Minimalist design that enhances immersion

💡 Innovation

  • World Reaches Out to You: First mental health tool where NPCs initiate based on your state
  • Psychological Resonance: Zones call out when your mental state matches their theme
  • Living Memory: Full conversation history including world-initiated messages
  • Emotional Authenticity: Every element reflects genuine psychological states

What we learned

Technical Lessons

  1. AI is creative, not deterministic - Use it for content generation, not spatial logic
  2. Canvas performance matters - Viewport culling and optimized draws are essential
  3. State management is complex - Managing game state across React components and refs requires careful architecture
  4. Modular code saves time - Breaking code into focused modules made debugging and iteration exponentially faster

Design Lessons

  1. Mental health needs passive engagement - Sometimes you can't initiate, so the world must
  2. Visual feedback is powerful - Colors communicate emotion faster than words
  3. Authentic relationships matter - Trust levels and descriptors create believable NPCs
  4. Context is everything - AI responses are only meaningful when given rich relational context

Problem-Solving Lessons

  1. Debug systematically - Clear logging with categorization saved countless hours
  2. Test edge cases early - Catching issues in simplified versions prevents late-stage rewrites
  3. Don't be afraid to rebuild - We rewrote world generation completely when the approach wasn't working
  4. User testing reveals truth - The "initiation problem" only became clear by watching real users hesitate

What's next for Journey Within

Immediate Roadmap

  1. Memory System: Long-term memory so the world remembers conversations across sessions
  2. Progress Tracking: Visualize mental state changes over time with graphs and insights
  3. Dynamic Zone Evolution: Zones change state based on your interactions (healing spaces, growing tensions)
  4. More Relationship Depth: Relationship arcs that develop over time with meaningful progression
  5. Audio Design: Atmospheric soundscapes and adaptive music that match zone emotional states

Advanced Features

  1. Therapist Integration: Optional sharing with real therapists for professional support
  2. Group Worlds: Shared spaces with friends/support groups for collective healing
  3. Journal Export: Export conversations as a reflection journal
  4. Mobile Version: Touch controls and responsive design for on-the-go reflection
  5. Accessibility: Screen reader support, colorblind modes, customizable text sizes

Research Direction

  1. Efficacy Studies: Partner with psychologists to measure therapeutic impact
  2. Personalization ML: Learn user patterns to improve stream generation accuracy
  3. Crisis Detection: Alert systems for severe mental health concerns with resources
  4. Cultural Adaptation: Multi-language support and culturally-aware AI responses

Journey Within - Your inner world, waiting to be explored. 🌌

Built With

Share this project:

Updates