subtr-actor
A powerful Rust library for processing and analyzing Rocket League replay files. Built on top of the boxcars parser, subtr-actor simplifies the complex actor-based structure of replay files into easy-to-use data formats.
What is subtr-actor?
subtr-actor transforms Rocket League replay files into structured data that's perfect for:
- Data analysis - Extract detailed player statistics, ball movement, and game events
- Machine learning - Generate training datasets from replay data
- Research - Study player behavior and game dynamics
- Visualization - Create custom replay viewers and analysis tools
Key Features
- 🚀 High-performance processing - Efficiently handles large replay files
- 📊 Multiple output formats - JSON, NumPy arrays, and custom data structures
- 🎯 Frame-by-frame precision - Access every detail of gameplay
- 🔌 Language bindings - Use from JavaScript, Python, or Rust
- 🧩 Extensible architecture - Add custom data extractors and processors
Installation
Rust
Add to your Cargo.toml:
[]
= "0.1.8"
Python
JavaScript/Node.js
Quick Start
Extract JSON data (Rust)
use ReplayDataCollector;
use ParserBuilder;
Generate ML training data (Rust)
use *;
Python Example
# Load replay and extract data
=
=
JavaScript Example
import * as subtrActor from 'rl-replay-subtr-actor';
// Load replay file
const replayData = await
.
.;
// Extract structured data
const result = subtrActor.;
console.log;
Core Concepts
ReplayProcessor
The heart of subtr-actor's processing pipeline. It handles the complex task of navigating through replay frames and maintaining game state.
Collectors
Pluggable data extractors that define what information to extract from replays:
ReplayDataCollector- Extracts comprehensive replay data as JSON-serializable structuresNDArrayCollector- Generates numerical arrays perfect for machine learning- Custom collectors - Implement the
Collectortrait for specialized data extraction
Feature Adders
Configurable extractors that specify exactly what data to capture:
- Global features - Ball position, game time, score
- Player features - Position, boost, controls, team info
- Custom features - Implement
FeatureAdderorPlayerFeatureAddertraits
Advanced Usage
Custom Feature Extraction
use *;
// Create custom feature adders
build_global_feature_adder!;
Frame Rate Control
// Process at custom frame rate
let mut collector = new;
new_from_fps
.process_replay?;
String-based Configuration
Useful for language bindings or configuration files:
let collector = from_strings?;
Data Structures
ReplayData
FrameData
Language Bindings
Python (subtr-actor-py)
- Full API access through Python functions
- NumPy integration for data analysis
- Ideal for data science workflows
JavaScript (rl-replay-subtr-actor)
- WebAssembly-based for high performance
- Works in browsers and Node.js
- Perfect for web applications
Performance Tips
- Use appropriate frame rates - Higher FPS = more data but slower processing
- Select only needed features - Fewer feature adders = faster processing
- Batch processing - Process multiple replays in parallel
- Memory management - Consider streaming for very large datasets
Contributing
We welcome contributions! Please check our issues for ways to help.
Development Setup
Building Language Bindings
# Python
&&
# JavaScript
&&
License
MIT License - see LICENSE file for details.
Related Projects
- boxcars - The underlying replay parser
- ballchasing.com - Replay analysis platform