Love Emulator is an AI-driven dating and social simulation game that transforms the mysterious process of dating into a computable life system. Set in Shanghai, players progress from social anxiety to becoming a "social master," ultimately achieving long-term commitment with a top-tier partner.
The game combines realistic constraints (time, money, emotions) with absurd events (misunderstandings, social drama, coincidences) to create a unique blend of realism and comedy.
- Hard Resources: Time, money, energy/health, city transportation costs
- Soft Resources: Appearance, communication skills, emotional stability, reputation, boundaries
Each NPC has multidimensional relationship parameters:
attraction- Physical and personality compatibilitytrust- Reliability perception (most important)comfort- Ease of interactionrespect- Boundary respectinvestment- Willingness to contributeconflict_meter- Accumulated tensionavailability- Schedule and availability
- Two-Stage Generation: Structured event framework + AI narrative generation
- Safety Validation: Consent-based boundaries and content filtering
- Intent-Based Resolution: Actions tagged with intent, resolved by game engine
- Deterministic Outcomes: Reproducible gameplay with RNG seeds
- Pure Love: Low drama, high trust
- Playboy: High social influence, high risk, high cost
- Self-Growth: Become a better person, relationships as byproduct
- Disaster: Reputation collapse, social circle blacklisting, emotional breakdown
- Node.js 18+
- npm or yarn
# Clone the repository
git clone https://github.com/pzy2000/LoveEmulator.git
cd LoveEmulator
# Install dependencies
npm install
# Start development server
npm run devnpm run build
npm run preview- Frontend: React 19 + TypeScript
- State Management: Zustand
- Animation: Framer Motion
- UI Components: Lucide React
- Build Tool: Vite
- AI Integration: OpenAI API
LoveEmulator/
โโโ src/
โ โโโ components/ # UI components
โ โ โโโ ActionGrid.tsx
โ โ โโโ CharacterList.tsx
โ โ โโโ Dashboard.tsx
โ โ โโโ DialogueView.tsx
โ โ โโโ ...
โ โโโ engine/ # Game engine
โ โ โโโ ActionSystem.ts
โ โ โโโ EventEngine.ts
โ โ โโโ DialogueManager.ts
โ โ โโโ RelationshipManager.ts
โ โ โโโ types.ts
โ โโโ data/ # Game data
โ โ โโโ characters.ts
โ โ โโโ locales.ts
โ โ โโโ fallbackData.ts
โ โโโ services/ # External services
โ โโโ store/ # State management
โโโ design.md # Design documentation
โโโ package.json
- Choose Action โ Dating, self-improvement, socializing, working, resting
- Resource Changes โ Money, energy, appearance, communication, reputation
- Trigger Events โ Random + conditional + event chains
- Relationship Changes โ Trust, comfort, respect, investment, conflict
- Unlock Progression โ Social circles, resources, higher-tier partners
- Repeat & Accelerate
- Self-Improvement: Fitness, fashion, communication training
- Resource Accumulation: Work, side hustles, networking
- Relationship Building: Dating, deep conversations, meeting friends/family
- Risk Behaviors: Multi-dating (reputation risk), public vs private relationships
Shanghai-themed location system with entry requirements:
- Campus / Office / Gym / Music Festival / Gallery / High-end Restaurant / Friend Gatherings / Startup Events
Each location features:
- Entry threshold (money, appearance, social status, connections)
- Unique event pool
- Character appearance weights
- Engine Layer (Deterministic): State progression, resource calculation, trigger conditions, probability sampling
- AI Narrative Layer (Generative): Event text, NPC dialogue, player options, atmosphere & humor
- AI Validation Layer (Constraint): Structure validation, consent boundaries, content filtering
- Balance Layer (Constraint): Value caps, risk penalties, event rarity control
- Engine samples situation skeleton (event type, character, location, intensity, risk tags)
- AI generates narrative (title, description, 2-4 player choices with intent tags)
- Validation checks JSON structure, safety, logical consistency
- Engine resolves outcomes based on intent tags + relationship state + world state + RNG
Create a .env file in the project root:
VITE_OPENAI_API_KEY=your_openai_api_key_here
VITE_OPENAI_BASE_URL=https://api.openai.com/v1 # Optional: custom endpointnpm run lintThis project uses ESLint for code quality. Run linting before committing:
npm run lintLove as a Computable System: Transform the mystical dating process into a multi-objective optimization problem where you're always missing one resource (time/money/energy/charisma/boundaries/reputation/social circle/career/emotional stability).
Realistic Constraints + Absurd Events: Realism comes from constraints (money, time, emotions); absurdity comes from events (misunderstandings, love triangles, social media drama, coincidental encounters).
NPCs as Subjects, Not Trophies: Characters have preferences, boundaries, lives, and reactions. They update their judgment of you based on your behavior, especially trust/safety.
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- New character archetypes and dialogue
- Event scenarios and storylines
- UI/UX improvements
- AI prompt optimization
- Localization (additional languages)
- Bug fixes and performance improvements
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by classic dating sims and life simulation games
- Special thanks to the open-source community
- Issues: GitHub Issues
- Discussions: GitHub Discussions
ไธญๆ็ README | Made with โค๏ธ in Shanghai