Revolutionary AI-powered CS2 demo analysis system that transforms gameplay data into actionable coaching insights, pro player comparisons, and realistic AI training scenarios.
FPS Genie is a high-performance, Rust-based system that analyzes Counter-Strike 2 demo files to provide:
- ๐ค AI-Driven Coaching: Real-time crosshair placement correction, tactical decision analysis, and personalized feedback.
- ๐ Pro Player Comparison: Compare your gameplay against professional players with detailed skill gap analysis.
- ๐ฎ AI Behavior Cloning: Train against AI that mimics professional player behaviors in realistic scenarios.
- ๐ Advanced Analytics: Deep behavioral analysis, key moment extraction, and performance tracking.
- ๐ Multi-Game Support: Extensible architecture designed for Valorant, Apex Legends, and other FPS games.
- Lightning-fast parsing: 700MB+/second demo processing on high-end hardware
- Comprehensive state tracking: 100+ player attributes per game tick
- Key moment detection: Automatic identification of clutches, aces, and tactical plays
- Behavioral vector analysis: Advanced ML-powered pattern recognition
- Crosshair placement analysis: Real-time feedback on aim positioning and pre-aiming
- Movement optimization: Guidance on positioning, rotations, and map control
- Utility usage insights: Grenades, smokes, and tactical equipment effectiveness
- Decision-making analysis: Evaluate engagement choices and tactical decisions
- Playstyle similarity scoring: Find which pro player you most resemble
- Skill gap identification: Pinpoint specific areas for improvement
- Role recommendation: Discover optimal in-game roles based on your strengths
- Benchmarking: Compare statistics against professional tournaments
- AI behavior cloning: Face off against bots that play like specific pro players
- Scenario recreation: Practice crucial match moments and clutch situations
- Adaptive difficulty: AI opponents that scale to your skill level
- Custom training: Generate specific scenarios targeting your weaknesses
graph TB
A[CS2 Demo Files] --> B[Rust Analysis Engine]
B --> C[Pro Moment Extraction]
B --> D[Player Performance Analysis]
C --> E[BehavioralVector Storage]
D --> F[AI Coaching Engine]
E --> G[Pro Scenario Rebuilder]
F --> H[Real-time Overlay]
G --> I[Ephemeral Training Servers]
H --> J[User Experience]
I --> J
subgraph "Multi-Tier Database Architecture"
K[PostgreSQL<br/>Match Metadata]
L[TimescaleDB<br/>Time-Series Data]
M[Qdrant<br/>Vector Storage]
N[Redis<br/>Caching & Queues]
O[MinIO<br/>Object Storage]
end
B --> K
D --> L
E --> M
F --> N
A --> O
The system is built as a multi-crate Rust workspace:
Crate | Purpose | Build Time | Key Features |
---|---|---|---|
cs2-demo-parser |
Core demo parsing engine | ~10s | High-performance binary parsing, 700MB+/s throughput |
cs2-ml |
Machine learning models | ~2 min | Behavior cloning, tactical analysis, PyTorch integration |
cs2-data-pipeline |
Batch processing system | ~90s | Demo discovery, processing orchestration, data ingestion |
cs2-common |
Shared utilities | ~5s | Common data structures, utilities, error handling |
cs2-demo-analyzer |
CLI analysis tool | ~60s | Command-line interface, batch analysis capabilities |
cs2-client |
Client library | ~30s | API client, data access layer |
cs2-analytics |
Advanced analytics | ~45s | Statistical analysis, reporting, visualizations |
cs2-integration-tests |
End-to-end testing | ~5-15 min | TestContainers, full system validation |
csgoproto |
Protocol definitions | ~10s | CS2 protobuf definitions, message parsing |
- Rust 1.70+ with Cargo
- Docker & Docker Compose for database infrastructure
- System dependencies:
# Ubuntu/Debian sudo apt-get update sudo apt-get install -y build-essential clang protobuf-compiler libfontconfig1-dev # macOS brew install cmake protobuf pkg-config
# Clone the repository
git clone https://github.com/kikokikok/fps-genie.git
cd fps-genie
# Setup multi-tier database infrastructure (5-10 minutes)
./setup_databases.sh
# Verify services are running
docker compose ps
# Build core components (2-3 minutes total)
cargo check --workspace
# Build individual components for faster iteration
cargo check -p cs2-demo-parser # 10 seconds
cargo check -p cs2-common # 5 seconds
cargo check -p cs2-data-pipeline # 90 seconds
# Place your demo files in the demos/ directory
mkdir -p demos/
cp your_demo.dem demos/
# Initialize the data pipeline
cd cs2-data-pipeline
cargo run -- init
# Discover and process demos
cargo run -- discover --recursive
cargo run -- process
# View processing statistics
cargo run -- stats
# Run crosshair placement analysis
cargo run -p cs2-demo-analyzer -- analyze demos/your_demo.dem --coaching
# Compare against pro players
cargo run -p cs2-demo-analyzer -- compare demos/your_demo.dem --pro-player s1mple
# Generate training scenarios
cargo run -p cs2-demo-analyzer -- extract-scenarios demos/your_demo.dem
FPS Genie uses a sophisticated multi-tier database architecture designed for scale:
- Purpose: Relational data and time-series player snapshots
- Scale: 5TB+ initial capacity, millions of snapshots per match
- Performance: 10K+ player snapshots/second ingestion rate
- Purpose: High-dimensional behavioral embeddings and similarity search
- Scale: 2TB+ vector storage capacity
- Features: Fast similarity search for pro player comparisons
- Purpose: Caching, job queues, and session management
- Features: Processing pipeline coordination, real-time data caching
- Purpose: Raw demo files, exports, and large binary objects
- Scale: 20TB+ storage capacity for demo archives
After running ./setup_databases.sh
, set these environment variables:
export DATABASE_URL="postgresql://cs2_user:cs2_password@localhost:5432/cs2_analysis"
export QDRANT_URL="http://localhost:6333"
export REDIS_URL="redis://localhost:6379"
export MINIO_URL="http://localhost:9000"
# Parse a demo file and extract player snapshots
cargo run -p cs2-demo-parser --bin parser -- path/to/demo.dem
# Analyze crosshair placement patterns
cargo run -p cs2-demo-analyzer -- crosshair-analysis demos/match.dem
# Extract key moments (clutches, aces, multi-kills)
cargo run -p cs2-demo-analyzer -- key-moments demos/match.dem --output moments.json
# Compare your gameplay to a specific pro player
cargo run -p cs2-demo-analyzer -- compare \
--demo demos/your_match.dem \
--pro s1mple \
--metrics aim,positioning,utility
# Find your playstyle similarity to all pros
cargo run -p cs2-demo-analyzer -- similarity-search demos/your_match.dem
# Generate skill gap report
cargo run -p cs2-demo-analyzer -- skill-gap \
--demo demos/your_match.dem \
--output skill_report.html
# Train AI models on professional gameplay
cd cs2-ml
cargo run -- prepare "demos/pro_matches/*.dem" ./training_data
cargo run -- train ./training_data/*.parquet ./models/behavior_model.ot --epochs 1000
# Serve trained model for ephemeral training servers
cargo run -- serve ./models/behavior_model.ot --port 8123
# Generate training scenarios
cargo run -p cs2-demo-analyzer -- generate-scenarios \
--demo demos/clutch_situations.dem \
--output training_scenarios/
# Generate comprehensive match report
cargo run -p cs2-analytics -- match-report \
--demo demos/tournament_match.dem \
--output reports/match_analysis.html
# Analyze team coordination patterns
cargo run -p cs2-analytics -- team-analysis \
--demos "demos/team_matches/*.dem" \
--team "Team Vitality"
# Track performance trends over time
cargo run -p cs2-analytics -- performance-trends \
--player "ZywOo" \
--timerange "2024-01-01:2024-12-31"
The project uses a tiered testing approach optimized for different development phases:
# Tier 1: Fast unit tests (1-2 minutes)
cargo test --lib --workspace --quiet
# Tier 2: Individual crate tests
cargo test -p cs2-demo-parser # 15 seconds, 334 tests
cargo test -p cs2-common # 5 seconds, 11 tests
cargo test -p cs2-data-pipeline # 45 seconds, integration tests
# Tier 3: Full integration tests (5-15 minutes)
cargo test --workspace --features integration-tests
# Performance benchmarks (10+ minutes)
cargo bench --workspace
# Format code (required for CI)
cargo fmt --all
# Lint with Clippy (required for CI)
cargo clippy --workspace --all-targets --all-features -- -D warnings
# Security audit
cargo audit
# Check for dependency issues
cargo deny check
-
Platform-Specific Builds:
# Linux: Use CPU-only features for cs2-ml to avoid Metal issues cargo build --workspace --no-default-features # macOS: Default Metal acceleration works cargo build --workspace
-
Incremental Development:
# Check individual crates during development cargo check -p cs2-demo-parser # Fast iteration cargo check -p cs2-ml # Slower, build when needed
-
Memory Management:
- Expect 2-8GB RAM usage for large demo processing
- Use
--release
mode for performance testing - Monitor with
cargo flamegraph
for profiling
Issue | Platform | Solution |
---|---|---|
protobuf-compiler not found |
All | Install protobuf: apt-get install protobuf-compiler or brew install protobuf |
objc_exception errors |
Linux | Edit cs2-ml/Cargo.toml : change default = ["metal"] to default = ["cpu-only"] |
Slow builds | All | Use cargo check for iteration, cargo build only when needed |
Database connection errors | All | Run ./setup_databases.sh and wait 5+ minutes for full initialization |
High memory usage | All | Expected for large demos (50MB+ files), not an error |
- Demo parsing: 700MB+/second on high-end hardware (Ryzen 5900x + NVMe SSD)
- Database ingestion: 10K+ player snapshots/second
- Memory usage: 2-8GB for large professional match demos
- ML training: 15-60 minutes depending on dataset size
- Daily processing: 50+ professional matches
- Storage capacity: 5TB TimescaleDB, 2TB vector embeddings, 20TB archives
- Concurrent analysis: Multiple demo processing pipelines
- API throughput: Sub-100ms response times for coaching insights
Component | Clean Build | Incremental | Notes |
---|---|---|---|
cs2-demo-parser |
10s | 2s | Core parsing engine |
cs2-ml |
2+ min | 30s | PyTorch compilation heavy |
cs2-data-pipeline |
90s | 15s | Database integration |
Full workspace | 3-5 min | 45s | Complete system |
โ ๏ธ Important: Never cancel long-running builds or tests. The system is designed for high-volume professional esports data processing and requires patience for large operations.
We welcome contributions from the community! Here's how to get involved:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Setup development environment:
./setup_databases.sh
- Make your changes with appropriate tests
- Test thoroughly:
cargo test --workspace
- Format and lint:
cargo fmt --all && cargo clippy --workspace
- Commit with clear messages
- Push and create a Pull Request
# Setup complete development environment
git clone https://github.com/kikokikok/fps-genie.git
cd fps-genie
# Install system dependencies
sudo apt-get install -y build-essential clang protobuf-compiler libfontconfig1-dev
# Setup databases (wait 5-10 minutes for full initialization)
./setup_databases.sh
# Setup enhanced development tools (optional)
./setup_mcp_servers.sh
# Build and test
cargo check --workspace
cargo test --lib --workspace
- ๐ฏ New Game Support: Implement Valorant or Apex Legends demo parsing
- ๐ค ML Models: Improve behavior cloning algorithms or coaching logic
- ๐ Analytics: Add new performance metrics or visualization features
- ๐ง Performance: Optimize parsing speed or memory usage
- ๐ Documentation: Improve guides, examples, or API documentation
- ๐งช Testing: Add test coverage or integration tests
- ๐ฎ UI/UX: Build web interfaces or real-time overlays
good-first-issue
: Perfect for newcomersperformance
: Speed or memory optimizationml-enhancement
: Machine learning improvementsnew-game
: Multi-game supportdocumentation
: Docs and guidesbug
: Something isn't workingenhancement
: New feature requests
This project is licensed under the MIT License - see the LICENSE file for details.
- CS2 Community: For demo files and gameplay insights
- LaihoE/demoparser: Inspiration for high-performance demo parsing
- Professional Players: Whose gameplay powers our AI training
- Rust Community: For excellent crates and tooling
- TimescaleDB: For time-series database capabilities
- Qdrant: For vector similarity search
- Contributors: Everyone who helps improve FPS Genie
- demoparser: High-performance CS2 demo parser
- awpy: CS2 spatial analysis library
- TimescaleDB: Time-series SQL database
- Qdrant: Vector similarity search engine
๐ฏ Transform your gameplay with AI-powered insights!
๐ Documentation โข ๐ Quick Start โข ๐ฌ Community โข ๐ Report Bug