GameAgent Plugin
The GameAgent
plugin extends the base GameAgent
class with game-specific functionality.
Plugin Package Structure
A GameAgent plugin package contains:
Plugin definition file
GameAgent subclass
Helper modules
Machine learning models
Creating a GameAgent Subclass
Required Components
One or more frame handler functions
Frame handler setup functions (optional)
Frame handler registrations in constructor
Frame handler setup registrations in constructor
Optional AnalyticsClient instance
You can implement additional custom instance methods. Consider using helper modules if the file becomes too large.
Registering Components
Frame Handler Registration
Frame Handler Setup Registration
Helper Modules
Create files in
files/helpers
Add desired functions and classes
Import in GameAgent subclass using relative imports
Machine Learning Models
Adding Models
Copy models to
files/ml_models
Use
.model
extension (recommended for Git LFS support)
Loading Models
Load in constructor for all frame handlers:
Last updated