LifeLoop

LifeLoop: The Game of Real Worlds

Live, Dream, Connect โ€” One Life at a Time.

LifeLoop is a 3D life simulation game built with React, Three.js, and Express.js where you can build your dream life, explore real-world cultures, and form deep emotional connections with AI-powered characters.

Features

๐ŸŒ† Live in immersive 3D cities - Explore detailed urban environments
๐Ÿง  AI-driven NPCs - Powered by OpenAI GPT-4o for realistic conversations
๐ŸŽจ Customizable homes - Build and decorate your living spaces
โค๏ธ Dynamic needs system - Manage happiness, energy, social, hunger, and hygiene
๐ŸŒ Real-time progression - Day/night cycles and character aging
๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Multiple life stages - Start as child, teen, adult, or elder

Quick Start

  1. Clone the repository
    git clone <your-repo-url>
    cd lifeloop-game
    
  2. Install dependencies
    npm install
    
  3. Set up environment variables Create a .env file and add:
    OPENAI_API_KEY=your_openai_api_key_here
    
  4. Start the game
    npm run dev
    
  5. Open your browser Navigate to http://localhost:5000

Game Controls

Technology Stack

Project Structure

โ”œโ”€โ”€ client/                 # Frontend React application
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/     # React components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ game/      # 3D game components
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ui/        # UI components
โ”‚   โ”‚   โ”œโ”€โ”€ lib/           # Game logic and stores
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ gameLogic/ # Core game mechanics
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ stores/    # Zustand state management
โ”‚   โ”‚   โ””โ”€โ”€ pages/         # Application pages
โ”‚   โ””โ”€โ”€ public/            # Static assets
โ”œโ”€โ”€ server/                # Backend Express application
โ”‚   โ”œโ”€โ”€ routes/           # API route handlers
โ”‚   โ””โ”€โ”€ storage.ts        # Data storage layer
โ””โ”€โ”€ shared/               # Shared types and schemas

Game Mechanics

Character System

Activities System

AI NPCs

Home Customization

Development

Adding New Features

  1. New Activities: Add to client/src/lib/gameLogic/activities.ts
  2. New NPCs: Update client/src/lib/stores/useNPCs.tsx
  3. New UI Components: Add to client/src/components/ui/
  4. API Routes: Add to server/routes/

Environment Setup

The game requires Node.js 18+ and an OpenAI API key for AI features.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

This project is open source. See LICENSE file for details.

Support

For questions or support, please open an issue on GitHub.


Start your life simulation journey today with LifeLoop!