Skip to content

This repository provides an AI-powered player engagement system with personalized recommendations, in-game rewards, and generative content for gaming scenarios.

License

Notifications You must be signed in to change notification settings

skylerseeg/player-engagement-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI-Powered Personalized Player Engagement System

Overview

This repository contains an AI-powered personalized player engagement system tailored for gaming scenarios. It includes features like a recommendation model for in-game rewards and Generative AI for personalized content generation (text, images, etc.). This system is designed to be easily integrated into any gaming app, making it a perfect base model for gaming companies or startups.

Features

  • A recommendation system built with TensorFlow/PyTorch for in-game purchases and player rewards.
  • Integration with Generative AI models (e.g., GPT, Stable Diffusion) to generate:
    • Custom messages.
    • Themed promotional banners.
    • Avatars based on player data.
  • FastAPI backend for deployment.

Folder Structure

AI-Powered Personalized Player Engagement System
├── app/
│   ├── config.py           # Configuration settings
│   ├── main.py             # FastAPI backend
│   ├── model.pkl           # Serialized model file
│   ├── model.py            # Model training script
│   ├── personalization.py  # Personalization utilities
│   ├── player_data.csv     # Synthetic data file
│   ├── recommender.py      # Recommender model script
│   ├── utils.py            # Utility functions
├── data/
│   ├── synthetic_player_data.py # Script to generate synthetic data
├── docker/
│   ├── Dockerfile           # Docker configuration
│   ├── docker-compose.yml   # Docker Compose configuration
├── examples/
│   ├── unity_examples.py    # Example integration for Unity
├── models/
│   ├── generator_model.py   # Generative AI model
│   ├── recommend_model.py   # Recommendation model
├── tests/
│   ├── tests.py             # Test cases for the system
├── .pytest_cache/           # pytest cache directory
├── LICENSE                  # License for the project
├── README.md                # Project documentation
├── requirements.txt         # Dependencies list

Prerequisites

  • Python 3.9+
  • Docker (optional, for containerization)

Installation

Option 1: Using Conda (Recommended)

  1. Clone the Repository:

    git clone https://github.com/skylerseeg/ai-player-engagement.git
    cd ai-player-engagement
  2. Set Up a Conda Environment:

    conda create -n player-engagement python=3.9 -y
    conda activate player-engagement
  3. Install Dependencies:

    pip install -r app/requirements.txt
  4. Generate Synthetic Data:

    python data/synthetic_player_data.py
  5. Train the Model:

    python app/model.py
  6. Run the FastAPI Server:

    python app/main.py

Option 2: Using pip with Virtualenv

  1. Clone the Repository:

    git clone https://github.com/your-username/ai-player-engagement.git
    cd ai-player-engagement
  2. Set Up a Virtual Environment:

    python3.9 -m venv venv
    source venv/bin/activate  # For macOS/Linux
    venv\Scripts\activate     # For Windows
  3. Install Dependencies:

    pip install -r app/requirements.txt
  4. Generate Synthetic Data:

    python data/synthetic_player_data.py
  5. Train the Model:

    python app/model.py
  6. Run the FastAPI Server:

    python app/main.py

Option 3: Using Docker (Optional)

  1. Build the Docker Image:

    docker build -t player-engagement-system .
  2. Run the Docker Container:

    docker run -d -p 8000:8000 player-engagement-system
  3. Access the API: Open http://localhost:8000 in your browser.


Usage

  • Access the FastAPI server at http://localhost:8000.
  • Use the endpoints to generate personalized player recommendations and content.

Environment Variables

If the application requires environment variables (e.g., API keys), create a .env file in the root directory:

API_KEY=your_api_key_here
DATABASE_URL=your_database_url_here

Load these variables using the python-decouple library in your application:

from decouple import config

API_KEY = config('API_KEY')
DATABASE_URL = config('DATABASE_URL')

Testing

To ensure the system works correctly:

  1. Run Unit Tests:

    python -m unittest discover tests
  2. Access the FastAPI Documentation: Open http://127.0.0.1:8000/docs to interact with the API.


Contributing

We welcome contributions! To get started:

  1. Fork the Repository:

    git clone https://github.com/yourusername/ai-player-engagement.git
  2. Create a New Branch:

    git checkout -b feature/your-feature-name
  3. Make Changes and Test Them Thoroughly.

  4. Commit and Push Changes:

    git commit -m "Description of changes"
    git push origin feature/your-feature-name
  5. Open a Pull Request.


License

This project is licensed under the MIT License.