LogoLogo
  • 🐟An Introduction to Bluetang
  • Features
    • 📔Overview
  • Deepseek Integration
    • 😃What are the benefits?
  • How To Use
    • ℹ️Important Information
    • 🔗Important Links
    • 📖Wiki
      • 💾Installation
        • 💿Linux
        • 🪟Windows
      • 🔃Update
      • 💻Bluetang CLI Tool
      • 👨‍💻Classes
        • GameAgent Class
        • Game Class
        • GameFrame Class
        • InputController Class
      • 🔌Plugins
        • GameAgent Plugin
        • Game Plugin
        • Training a Context Classifier
  • 📑Whitepaper
Powered by GitBook
On this page
  • Core Components
  • Frame Variants
  • Methods
  • Usage
  1. How To Use
  2. Wiki
  3. Classes

GameFrame Class

Note: This class is in beta and planned for major improvements in version 1.0

The GameFrame class represents a single frame of game footage in the Bluetang framework.

Core Components

  • Store frame image data

  • Track frame metadata

  • Provide cached frame variants

  • Compare with other frames

Metadata

  • self.offset_x: X offset in pixels (default: 0)

  • self.offset_y: Y offset in pixels (default: 0)

  • self.resize_order: Spline interpolation order (default: 1)

Frame Variants

  • self.frame: Full resolution

  • self.half_resolution_frame: 1/4 resolution

  • self.quarter_resolution_frame: 1/8 resolution

  • self.eighth_resolution_frame: 1/16 resolution

  • self.grayscale_frame: Grayscale, full resolution

  • self.ssim_frame: 100x100 grayscale for SSIM

Frame Variants

Frame variants are:

  • Transformations of the original image data

  • Lazily evaluated when first requested

  • Cached for subsequent access

  • Accessible via properties

Methods

compare_ssim

def compare_ssim(self, previous_game_frame)

Calculates structural similarity (SSIM) between two frames.

Usage

GameFrames are primarily used:

  • As input to game agents' frame handlers

  • For frame comparison and analysis

  • As the preferred way to pass game image data

Benefits of GameFrames

  • Consistent interface for frame data

  • Built-in transformations

  • Cached variants for performance

  • Comparison capabilities

  • Metadata tracking

PreviousGame ClassNextInputController Class

Last updated 4 months ago

📖
👨‍💻