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

  1. Create files in files/helpers

  2. Add desired functions and classes

  3. Import in GameAgent subclass using relative imports

Machine Learning Models

Adding Models

  1. Copy models to files/ml_models

  2. Use .model extension (recommended for Git LFS support)

Loading Models

Load in constructor for all frame handlers:

Last updated