NeatRL Playground AI Games Showcase powered by Reinforcement Learning

Date:

๐ŸŽฎ AI Games Showcase

A beautiful, interactive website showcasing AI-powered games with reinforcement learning agents.

AI Games Vercel Python

๐ŸŒŸ Live Demo

  • Website: Deploy on Vercel
  • Game Server: Deploy on Render
  • Game: Pong AI with Deep Q-Learning

๐Ÿ—๏ธ Project Structure

youtube-dueling-ai-pong/
โ”œโ”€โ”€ Website/                    # Main showcase website
โ”‚   โ”œโ”€โ”€ index.html             # Landing page
โ”‚   โ”œโ”€โ”€ style.css              # Styling
โ”‚   โ””โ”€โ”€ script.js              # Interactions
โ”‚
โ”œโ”€โ”€ Games/                      # Game collection
โ”‚   โ””โ”€โ”€ RL-PongGame/           # Pong AI game
โ”‚       โ”œโ”€โ”€ frontend/          # Game UI
โ”‚       โ”œโ”€โ”€ backend/           # WebSocket server (aiohttp)
โ”‚       โ”œโ”€โ”€ training/          # RL training code
โ”‚       โ””โ”€โ”€ models/            # Trained models
โ”‚
โ”œโ”€โ”€ vercel.json                # Vercel config (website)
โ”œโ”€โ”€ render.yaml                # Render config (game server)
โ””โ”€โ”€ README.md                  # This file

๐Ÿš€ Quick Start

Local Development

  1. Clone the repository
    git clone https://github.com/YuvrajSingh-mist/NeatRL-Website.git
    cd NeatRL-Website
    
  2. Start the game server
    cd Games/RL-PongGame
    pip install -r requirements.txt
    python backend/server.py
    # Server runs on http://localhost:8765
    # WebSocket at ws://localhost:8765/ws
    
  3. Open the game
    # Open frontend/index_websocket.html in your browser
    

๐Ÿ“ฆ Deployment

Deploy Website (Vercel)

Deploy with Vercel

The website deploys automatically on every push to master.

Deploy Game Server (Render)

The game server is configured via render.yaml for automatic deployment:

  1. Go to https://render.com โ†’ Sign in with GitHub
  2. Click โ€œNew +โ€ โ†’ โ€œBlueprintโ€
  3. Select your repository
  4. Render will detect render.yaml and configure automatically
  5. Click โ€œApplyโ€ to deploy

What gets deployed:

  • HTTP server on port 8765 (set by Renderโ€™s PORT env variable)
  • Health check endpoint at /health
  • Status endpoint at /status
  • WebSocket endpoint at /ws
  • AI model loaded from models/latest.pt

Environment (automatically configured):

  • Python 3.13
  • Headless mode (no display/audio required)
  • All dependencies from requirements.txt

The server will:

  • โœ… Pass Renderโ€™s health checks
  • โœ… Handle WebSocket connections
  • โœ… Run the AI game loop
  • โœ… Serve multiple concurrent clients

๐ŸŽฎ Features

  • โœจ Beautiful UI - Modern, responsive design
  • ๐Ÿค– AI-Powered - Deep Q-Learning trained agents
  • โšก Real-time - WebSocket communication
  • ๐Ÿ“ฑ Responsive - Works on all devices
  • ๐ŸŽจ Smooth Animations - Parallax effects and transitions
  • ๐Ÿฅ Production Ready - Health checks, error handling, headless mode

๐Ÿ› ๏ธ Tech Stack

Frontend

  • HTML5 Canvas
  • CSS3 (Grid, Flexbox, Animations)
  • Vanilla JavaScript
  • WebSocket API

Backend

  • Python 3.13
  • aiohttp (HTTP + WebSocket server)
  • PyTorch (Deep Learning)
  • Gymnasium (RL environment)
  • Pygame (headless game engine)

Deployment

  • Vercel (Static website)
  • Render (Python game server)

๐Ÿ› Troubleshooting

Server Issues

If deployment fails:

  1. Check logs in Render dashboard
  2. Verify model file exists at Games/RL-PongGame/models/latest.pt
  3. Test locally first:
    cd Games/RL-PongGame
    PORT=8765 python backend/server.py
    # Should see: "Server running on http://0.0.0.0:8765"
    

WebSocket Connection Issues

If the game doesnโ€™t connect:

  1. Check server status: Visit https://your-app.onrender.com/status
  2. Verify WebSocket URL in browser console
  3. Check CORS if hosting frontend elsewhere

๐Ÿค Contributing

Contributions welcome! Feel free to:

  • Add new AI games
  • Improve UI/UX
  • Optimize performance
  • Fix bugs

๐Ÿ“„ License

MIT License - feel free to use this project for learning and building!

๐ŸŒŸ Show Your Support

Give a โญ๏ธ if you like this project!


Built with โค๏ธ using Reinforcement Learning