Skip to content

muhkartal/pokeCoach-AI-Coach

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Overview

PokeCoach is a modern multiplayer battle platform that brings together classic game mechanics with real-time web technology. It provides competitive turn-based battles through WebSocket communication, offering players strategic depth while maintaining technical reliability through containerized microservices.

The platform combines battle simulation, intelligent AI coaching, real-time multiplayer features, and comprehensive monitoring to create an engaging competitive environment. What makes this different from other battle simulators is the integrated AI Coach system that provides real-time strategic analysis and move recommendations.

KEY DIFFERENTIATOR: The AI Coach system sets this platform apart by providing real-time strategic analysis, move recommendations, and competitive insights based on heuristic algorithms and battle pattern recognition.

INTELLECTUAL PROPERTY NOTICE

EDUCATIONAL & DEMONSTRATION USE ONLY: This application is for educational and technical demonstration purposes only. It does not redistribute copyrighted assets. All Pokemon-related intellectual property belongs to their respective owners.

DISCLAIMER: No commercial use • No asset redistribution • Respect all intellectual property rights

Key Features

Real-Time Multiplayer Battle Engine

  • Deterministic Turn Resolution: Every battle follows consistent rules with clear move priority and damage calculations, so outcomes are fair and predictable
  • Complete Type System: All 18 Pokémon types are implemented with accurate effectiveness multipliers, just like in the official games
  • Status Effect Tracking: Burns, poison, paralysis, freeze, and sleep all work properly with turn-by-turn effects
  • Real-time Battle Updates: Both players see moves and results instantly through WebSocket connections
Battle Engine Interface

Interactive Team Building System

Team Builder
  • Comprehensive Roster Management: Access to extensive creature database with detailed stats, movesets, and type information
  • Strategic Team Composition: Advanced team building tools with type coverage analysis and synergy recommendations
  • Random Team Generation: Intelligent randomization algorithms creating balanced team compositions for quick matches
  • Move Set Customization: Complete move selection with damage calculations, priority levels, and strategic effect previews

Sophisticated Room Management

  • Easy Room Setup: Create private rooms with unique codes or join public matches with just a few clicks
  • Built-in Chat: Talk to your opponent or coordinate with friends during battles
  • Spectator Support: Friends can watch your battles without interfering with the game
  • Reconnection System: If you lose connection, you can rejoin your battle without losing progress
Room Management

AI-Powered Strategic Advisory

AI Coach
  • Smart Move Suggestions: The AI analyzes your current battle situation and recommends the best moves based on damage calculations and strategic positioning
  • Risk Assessment: Get probability estimates for different outcomes to help you make informed decisions during critical moments
  • Type Matchup Analysis: Understand which Pokémon have advantages over others with detailed explanations of type effectiveness
  • Adaptive Learning: The AI learns from your playing style and improves its recommendations over time to match your preferences

Comprehensive Monitoring & Analytics

  • Performance Monitoring: Track how well the servers are running with real-time metrics and health checks
  • Battle Statistics: View detailed analytics about battles, player activity, and system performance through interactive dashboards
  • Automated Testing: Scripts that automatically verify everything is working correctly across different deployment environments
  • Game Analytics: Monitor battle patterns and balance to ensure fair and competitive gameplay
Monitoring Dashboard

Technology Stack

Layer Components Technologies
Frontend Battle Interface, Team Builder, Room Management Vanilla JavaScript, HTML5 Canvas, WebSocket API, CSS3
Backend Real-time Gateway, REST API, Battle Engine Node.js, Socket.IO, FastAPI, Python, Uvicorn
Data Layer Persistence, Caching, Session Management PostgreSQL, Redis, JSON Schema Validation
Infrastructure Containerization, Orchestration, Reverse Proxy Docker, Docker Compose, AWS ECS, Nginx, Supervisor
Observability Metrics, Dashboards, Health Monitoring Prometheus, Grafana, Custom Health Endpoints

Project Structure

PokeCoach/
├── api/                           # FastAPI REST service
│   ├── __init__.py                    # Package initialization
│   ├── main.py                        # FastAPI application entry
│   ├── routes/                        # API route handlers
│   │   ├── health.py                  # Health check endpoints
│   │   ├── stats.py                   # Battle statistics
│   │   └── rooms.py                   # Room metadata
│   └── models/                        # Data models
│
├── server/                        # Node.js WebSocket gateway
│   ├── server.js                      # Socket.IO server
│   ├── routes/                        # Socket event handlers
│   │   ├── battle.js                  # Battle event management
│   │   ├── rooms.js                   # Room lifecycle
│   │   └── chat.js                    # Chat functionality
│   └── utils/                         # Utility functions
│
├── components/                    # Frontend UI components
│   ├── battle/                        # Battle interface
│   │   ├── arena.js                   # Main battle arena
│   │   ├── moves.js                   # Move selection
│   │   └── status.js                  # Status display
│   ├── team/                          # Team building
│   │   ├── builder.js                 # Team composition
│   │   └── selector.js                # Pokemon selection
│   └── lobby/                         # Room management
│
├── data/                          # Game data and constants
│   ├── pokemon/                       # Pokemon datasets
│   ├── moves/                         # Move definitions
│   ├── types/                         # Type effectiveness
│   └── constants/                     # Game constants
│
├── monitoring/                    # Observability configuration
│   ├── prometheus/                    # Metrics configuration
│   ├── grafana/                       # Dashboard definitions
│   └── alerts/                        # Alert rules
│
├── deploy/                        # Deployment scripts
│   ├── docker/                        # Docker configurations
│   ├── aws/                           # AWS ECS deployment
│   ├── heroku/                        # Heroku deployment
│   └── scripts/                       # Automation scripts
│
├── static/                        # Static assets
│   ├── css/                           # Stylesheets
│   ├── images/                        # UI screenshots
│   └── fonts/                         # Typography assets
│
├── tests/                         # Test suite
│   ├── unit/                          # Unit tests
│   ├── integration/                   # Integration tests
│   └── e2e/                           # End-to-end tests
│
├── docker-compose.yml             # Multi-service orchestration
├── Dockerfile                     # Container definition
├── nginx.conf                     # Reverse proxy configuration
├── supervisord.conf               # Process supervision
└── README.md                      # This documentation

Quick Start Guide

System Requirements

Component Minimum Requirements Recommended Specifications
Operating System Windows 10, macOS 11, Ubuntu 20.04 Windows 11, macOS 12+, Ubuntu 22.04+
Node.js 18.x 20.x or newer
Python 3.8 3.11 or newer
RAM 4 GB 8 GB or more
Browser Chrome 90+, Firefox 88+, Safari 14+ Latest version of Chrome, Firefox, or Safari

Installation Process

LEGAL COMPLIANCE REQUIRED

By installing and using this software, you acknowledge that this is for educational purposes only and agree to respect all intellectual property rights. Do not use for commercial purposes.

# 1. Clone the repository
git clone https://github.com/muhkartal/PokeCoach.git
cd PokeCoach

# 2. Launch with Docker (Recommended)
docker-compose up --build

# 3. Access the application
# Game Interface: http://localhost
# API Documentation: http://localhost:8000/docs
# Grafana Dashboard: http://localhost:3001 (admin/admin)
# Prometheus Metrics: http://localhost:9090

Local Development Setup

# 1. Set up WebSocket server
cd server
npm install
npm start   # Runs on http://localhost:3000

# 2. Set up FastAPI service
cd ../api
pip install -r requirements.txt
uvicorn main:app --reload --port 8000

# 3. Serve static frontend
cd ..
python -m http.server 8080  # Serves on http://localhost:8080

Server Configuration

The platform uses environment-based configuration for flexible deployment across different environments.

Core Server Settings

// server/server.js
const PORT = process.env.PORT || 3000;
const MAX_ROOMS = process.env.MAX_ROOMS || 100;
const MAX_PLAYERS_PER_ROOM = 2;
const ROOM_TIMEOUT = process.env.ROOM_TIMEOUT || 1800000; // 30 minutes
const HEARTBEAT_INTERVAL = 25000;

API Configuration

# api/config.py
import os

class Settings:
    API_HOST = os.getenv("API_HOST", "0.0.0.0")
    API_PORT = int(os.getenv("API_PORT", 8000))
    DATABASE_URL = os.getenv("DATABASE_URL", "postgresql://localhost:5432/pokemon_battles")
    REDIS_URL = os.getenv("REDIS_URL", "redis://localhost:6379")
    DEBUG = os.getenv("DEBUG", "false").lower() == "true"
    CORS_ORIGINS = os.getenv("CORS_ORIGINS", "*").split(",")

Environment Variables

Variable Default Description
PORT 3000 WebSocket server port
API_PORT 8000 FastAPI service port
MAX_ROOMS 100 Maximum concurrent battle rooms
ROOM_TIMEOUT 1800000 Room timeout in milliseconds
DATABASE_URL localhost PostgreSQL connection string
REDIS_URL localhost Redis connection string
DEBUG false Enable debug logging
CORS_ORIGINS * Allowed CORS origins

Docker Environment

Create a .env file in your project root:

# Database Configuration
DATABASE_URL=postgresql://postgres:password@db:5432/pokemon_battles
REDIS_URL=redis://redis:6379

# Server Configuration
PORT=3000
API_PORT=8000
MAX_ROOMS=200
DEBUG=true

# CORS Configuration
CORS_ORIGINS=http://localhost:3000,http://localhost:8080

Demo & Screenshots

Battle Arena Interface
Real-time Battle Arena with Turn Resolution and Status Tracking

Team Builder Interface
Strategic Team Composition with Type Coverage Analysis

AI Coach Interface
Advanced AI Coach System with Real-time Strategic Recommendations

Room Management
Multiplayer Lobby System with Real-time Chat Integration

Advanced AI Coach System

Intelligence Engine Features

  • Battle State Analysis: The AI continuously watches the battle and calculates the best moves based on your Pokémon's health, status effects, and type advantages
  • Opponent Prediction: Machine learning models study common player behaviors to predict what your opponent might do next
  • Outcome Probability: The system evaluates different move options and tells you which ones are most likely to succeed
  • Personal Adaptation: Over time, the AI learns how you like to play and adjusts its suggestions to match your style
AI Coach Analytics

Strategic Advisory Components

Coach Recommendations
  • Move Analysis: Examines all your available moves and ranks them by effectiveness, considering damage, status effects, and long-term strategy
  • Team Strategy: Looks at your remaining Pokémon and suggests when to switch for better matchups and coverage
  • Meta Knowledge: Provides insights into popular strategies and effective counters used by competitive players
  • Learning Explanations: Explains why certain moves are recommended, helping you understand the strategy and improve your skills

AI Coach Technical Implementation

Feature Algorithm Purpose
Move Scoring Multi-factor weighted analysis Ranks all possible moves by expected value and strategic impact
Damage Prediction Statistical modeling with type charts Accurate damage range calculations with critical hit probabilities
Opponent Modeling Behavioral pattern recognition Predicts likely opponent moves based on battle history and common strategies
Risk Evaluation Monte Carlo simulation Assesses potential outcomes across multiple battle scenarios
Learning System Reinforcement learning adaptation Improves recommendations based on user feedback and battle outcomes

User Guide

Getting Started with AI-Enhanced Battles

  1. Enable AI Coach System

    • Activate the AI Coach from the main menu settings
    • Choose between beginner, intermediate, or advanced advisory levels
    • Configure notification preferences for real-time recommendations
  2. Strategic Team Building with AI

    • Use AI-powered team composition analysis
    • Receive suggestions for optimal move combinations
    • Get type coverage recommendations and synergy insights
    • Save AI-optimized team presets for different battle formats
  3. Real-time Battle Coaching

    • Monitor AI coach panel during battles for move recommendations
    • View probability calculations and damage predictions
    • Understand strategic reasoning through detailed explanations
    • Learn from post-battle analysis and improvement suggestions
  4. Advanced Competitive Features

    • Access meta-game intelligence and trending strategies
    • Receive opponent pattern recognition insights
    • Utilize risk assessment for high-stakes decisions
    • Track personal improvement metrics and skill development

Pro Battle Tips with AI Integration

  • AI-Assisted Decision Making: Always consider AI recommendations alongside your instincts
  • Learning Mode: Use detailed explanations to understand why certain moves are optimal
  • Adaptive Strategy: Let the AI learn your playstyle for personalized recommendations
  • Competitive Analysis: Leverage AI insights to understand meta-game trends and counters

Game Mechanics & Features

Battle System Implementation

Mechanic Implementation Technical Details
Type Effectiveness Multiplier-based damage calculation 18 types, 324 interaction matrix, floating-point precision
Status Effects Turn-based condition tracking Burn, poison, paralysis, freeze, sleep with duration management
Stat Modifications Stage-based multiplier system ±6 stages per stat, multiplicative factors (2/8 to 8/2 range)
Priority System Move-based turn ordering 5 priority levels (-4 to +4), speed tiebreaker resolution
Damage Formula Generation IV+ standard Level, power, attack/defense, modifiers, type effectiveness

Observability & Monitoring

Component Endpoint / Path Purpose
API Health /health Liveness & readiness
Metrics /metrics Prometheus exposition
Grafana :3001 Dashboards
Validation Script deploy/validate-deployment.sh Automated multi-env checks

Validation & Health

./deploy/validate-deployment.sh docker
./deploy/validate-deployment.sh aws
./deploy/validate-deployment.sh heroku
./deploy/validate-deployment.sh all

Checks: service availability • socket handshake • room lifecycle • health & metrics reachability

Contributing

CONTRIBUTOR RESPONSIBILITIES

All contributors must ensure their contributions respect intellectual property rights and maintain the educational nature of this project. No copyrighted assets may be added.

  1. Fork repository
  2. Create feature branch (git checkout -b feature/descriptor)
  3. Implement with tests / validation
  4. Commit using conventional style (feat: add x)
  5. Push and open Pull Request

Coding Standards: ES6 modules • (planned) linting • small reviewable units • deterministic battle logic

Available Scripts

Command Purpose
docker-compose up --build Full stack start
./scripts/setup-dev.sh Local dev bootstrap
./deploy/deploy.sh AWS ECS deploy
./deploy/heroku.sh Heroku deploy
./deploy/validate-deployment.sh Multi-env validation
./scripts/backup.sh DB backup

Support and Community

License

MIT LICENSE

PokeCoach is released under the MIT License. See the LICENSE file for complete terms.

INTELLECTUAL PROPERTY NOTICE

Third-Party Trademarks: This project is a fan-inspired technical demonstration platform. Pokemon and all related intellectual property (names, sprites, types, creatures, moves, etc.) are trademarks of their respective owners (Nintendo, Game Freak, The Pokemon Company).

IMPORTANT LEGAL DISCLAIMERS:

  • No endorsement by or affiliation with Nintendo/The Pokemon Company is implied
  • This is a non-commercial, educational project for technical demonstration
  • No copyrighted assets are redistributed; only structured metadata for game mechanics
  • Always respect intellectual property rights and official game guidelines

BY USING THIS SOFTWARE, YOU ACKNOWLEDGE AND AGREE TO THESE TERMS


Developed by Muhammad Kartal

About

pokeCoach is a real-time multiplayer battle platform that combines classic turn-based mechanics with modern web technology. Built for competitive players and developers, it features an advanced AI Coach system that provides strategic analysis and move recommendations during battles. The platform uses WebSocket communication for real-time gameplay,

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors