You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
user story : As a Player, I want to play Pong against an AI opponent so that I can practice or play when no human opponents are available.
Details
We need to implement a new microservice (pong-ai) that runs a pre-trained Reinforcement Learning model to control the opponent paddle.
Architecture
Service: Python (FastAPI)
Communication: The Game Service (Node.js) will send the current game state (ball position, velocity, paddle positions) to the AI Service via HTTP POST.
Model: PPO (Proximal Policy Optimization) using stable-baselines3.
Requirements
The AI must respond in <50ms to ensure real-time gameplay.
The model should be pre-trained (loaded from a .zip file on startup).
Additional context (screenshots, links, ...)
Note
The AI service endpoint should look like: POST /join-game
Body: { "ball_x": float, "ball_y": float, ... }
Response: { "action": 0 | 1 | 2 } (STOP, UP, DOWN)
Priority and estimates
Priority: High (Core Feature)
Estimate: 3 days
Definition of done
functional
Testing details :
Manual: Start a "Vs AI" game. Verify the opponent paddle tracks the ball and attempts to hit it.
Manual: Verify the game ends correctly when score limit is reached.
Manual: Ensure no lag/jitter in the paddle movement.
technical
Tests are written using Pytest (for the Python service) and Vitest (for the Node integration)
Tests are passing
API endpoint /join-game
others
Documentation is updated (Wiki: [[AI Service]], [[API Documentation]])
docker-compose.yml includes the new pong-ai container
Out of scope
Training the model from scratch during deployment (use pre-trained weights).
Adjustable difficulty levels (v1 will have a single difficulty).
Subtasks
DevOps: Create Dockerfile for Python service (install FastAPI, Stable Baselines3).
AI: Implement server.py with FastAPI and load the PPO model.
Backend: Add "Vs AI" game mode logic in Game Service (Node.js).
Backend: Implement HTTP client in Game Service to query AI Service.
Description
user story : As a Player, I want to play Pong against an AI opponent so that I can practice or play when no human opponents are available.
Details
We need to implement a new microservice (
pong-ai) that runs a pre-trained Reinforcement Learning model to control the opponent paddle.Architecture
stable-baselines3.Requirements
.zipfile on startup).Additional context (screenshots, links, ...)
Note
The AI service endpoint should look like:
POST /join-gameBody:
{ "ball_x": float, "ball_y": float, ... }Response:
{ "action": 0 | 1 | 2 }(STOP, UP, DOWN)Priority and estimates
Definition of done
functional
Testing details :
technical
/join-gameothers
docker-compose.ymlincludes the newpong-aicontainerOut of scope
Subtasks
Dockerfilefor Python service (install FastAPI, Stable Baselines3).server.pywith FastAPI and load the PPO model.