Expand description
Dense numeric feature extraction: build an ndarray::Array2 of replay
features for ML/analytics.
§What feature adders are
A NDArrayCollector runs the replay frame by frame and, for each sampled
frame, asks a list of feature adders to append their numbers to that
frame’s row. Each adder owns a fixed set of named columns and knows how to
compute them from the current ProcessorView (and,
for analysis-backed adders, from analysis-graph state). The collector
concatenates every adder’s columns into one wide matrix plus a header list,
so the set of adders you choose is your feature schema.
There are two flavours, each in a global and a per-player form:
FeatureAdder/PlayerFeatureAdder— compute directly from frame and processor state.AnalysisFeatureAdder/AnalysisPlayerFeatureAdder— additionally readAnalysisGraphstate, declaring their node dependencies so the collector wires up the graph.
The LengthChecked* trait variants let an adder fix its column count at
compile time. Player adders emit their columns once per player.
§Registering adders
- Explicitly: construct adders and pass them to the collector (see the
builder methods on
NDArrayCollector). - By name:
NDArrayCollector::from_strings/from_strings_typedlook up adders in a built-in string registry — convenient for the Python/JS bindings.
Recognized global (ball / game) names include BallRigidBody,
BallRigidBodyNoVelocities, BallRigidBodyQuaternions,
BallRigidBodyBasis, InterpolatedBallRigidBodyNoVelocities,
CurrentTime, FrameTime, SecondsRemaining, and BallHasBeenHit.
Recognized per-player names include PlayerRigidBody,
PlayerRigidBodyNoVelocities, PlayerRelativeBallPosition,
PlayerLocalRelativeBallVelocity, PlayerBoost, PlayerJump,
PlayerAnyJump, PlayerDodgeRefreshed, PlayerDemolishedBy, and
PlayerBallDistance. Analysis-backed per-player event features are also
addressable by mechanic name (e.g. touch, flick, whiff, bump,
pass, rotation, movement, positioning). The matching arms in
collector.rs and analysis_builtins.rs are the authoritative list.
Re-exports§
pub use ::derive_new;pub use ::paste;
Macros§
- analysis_
global_ feature_ adder - Implements the ndarray traits for an existing analysis-backed global feature type.
- analysis_
player_ feature_ adder - Implements the ndarray traits for an existing analysis-backed per-player feature type.
- build_
analysis_ global_ feature_ adder - Declares a new analysis-backed global feature-adder type.
- build_
analysis_ player_ feature_ adder - Declares a new analysis-backed per-player feature-adder type.
- build_
global_ feature_ adder - Declares a new global feature-adder type and wires it into the ndarray traits.
- build_
player_ feature_ adder - Declares a new per-player feature-adder type and wires it into the ndarray traits.
- convert_
all - Converts a fixed list of values with a caller-supplied error mapper.
- convert_
all_ floats - Converts a fixed list of float-like values using
convert_float_conversion_error. - global_
feature_ adder - Implements the ndarray feature-adder traits for an existing global feature type.
- impl_
analysis_ feature_ adder - Implements
AnalysisFeatureAdderfor a fixed-width analysis-backed type. - impl_
analysis_ player_ feature_ adder - Implements
AnalysisPlayerFeatureAdderfor a fixed-width analysis-backed type. - impl_
feature_ adder - Implements
FeatureAdderfor a type that already satisfiesLengthCheckedFeatureAdder. - impl_
player_ feature_ adder - Implements
PlayerFeatureAdderfor a type that satisfiesLengthCheckedPlayerFeatureAdder. - player_
feature_ adder - Implements the ndarray feature-adder traits for an existing per-player feature type.
Structs§
- Analysis
Feature Context - Typed, read-only view of analysis state available to analysis-backed features.
- Analysis
Player Ball Carries - Analysis
Player Boost Pickups - Analysis
Player Boost Respawns - Analysis
Player Bumps - Analysis
Player Ceiling Shots - Analysis
Player Centers - Analysis
Player Dodge Resets - Analysis
Player Double Taps - Analysis
Player Feature Input - Arguments supplied to object-safe per-player analysis feature adders.
- Analysis
Player Flicks - Analysis
Player Flip Impulses - Analysis
Player Flip Reset Dodges - Analysis
Player Half Flips - Analysis
Player Half Volleys - Analysis
Player Movement Events - Analysis
Player OneTimers - Analysis
Player Passes - Analysis
Player Positioning Events - Analysis
Player Powerslides - Analysis
Player Rotation Events - Analysis
Player Speed Flips - Analysis
Player Touches - Analysis
Player Wall Aerial Shots - Analysis
Player Wall Aerials - Analysis
Player Wavedashes - Analysis
Player Whiffs - Ball
HasBeen Hit - Ball
Rigid Body - Ball
Rigid Body Basis - Ball
Rigid Body NoVelocities - Ball
Rigid Body Quaternion Velocities - Ball
Rigid Body Quaternions - Current
Time - Dynamic
Analysis Feature Adder - Dynamic
Analysis Player Feature Adder - Frame
Time - Interpolated
Ball Rigid Body NoVelocities - Global feature adder that samples an interpolated ball rigid body.
- Interpolated
Player Rigid Body NoVelocities - Per-player feature adder that samples an interpolated car rigid body.
- NDArray
Collector - Collects replay frames into a dense 2D feature matrix.
- NDArray
Column Headers - Column headers for the frame matrix emitted by
NDArrayCollector. - Player
AnyJump - Player
Ball Distance - Player
Boost - Player
Demolished By - Player
Dodge Refreshed - Player
Jump - Player
Local Relative Ball Position - Player
Local Relative Ball Velocity - Player
Relative Ball Position - Player
Relative Ball Velocity - Player
Rigid Body - Player
Rigid Body Basis - Player
Rigid Body NoVelocities - Player
Rigid Body Quaternion Velocities - Player
Rigid Body Quaternions - Replay
Meta With Headers - Replay metadata bundled with the ndarray column layout used to produce it.
- Replicated
Game State Time Remaining - Replicated
State Name - Seconds
Remaining - Velocity
Added Ball Rigid Body NoVelocities - Velocity
Added Player Rigid Body NoVelocities
Enums§
Traits§
- Analysis
Feature Adder - Object-safe interface for frame-level features backed by the analysis graph.
- Analysis
Player Feature Adder - Object-safe interface for per-player features backed by the analysis graph.
- Feature
Adder - Object-safe interface for frame-level feature extraction.
- Length
Checked Analysis Feature Adder - Fixed-width analysis-backed feature extractor with compile-time column count validation.
- Length
Checked Analysis Player Feature Adder - Fixed-width per-player analysis-backed feature extractor.
- Length
Checked Feature Adder - Fixed-width feature extractor with compile-time column count validation.
- Length
Checked Player Feature Adder - Fixed-width per-player feature extractor with compile-time column count validation.
- Player
Feature Adder - Object-safe interface for per-player feature extraction.
Functions§
- convert_
float_ conversion_ error - Maps arbitrary conversion failures into a generic float-conversion error.
- dynamic_
analysis_ feature_ adder - dynamic_
analysis_ player_ feature_ adder - get_
rigid_ body_ properties - Converts a rigid body into position, Euler rotation, and velocity features.
- get_
rigid_ body_ properties_ basis - Converts a rigid body into position, basis vectors, and velocity features.
- get_
rigid_ body_ properties_ no_ velocities - Converts a rigid body into position and quaternion-rotation features only.
- get_
rigid_ body_ properties_ quaternion - Converts a rigid body into position, quaternion rotation, and velocity features.