Game Class
The Game class represents a generic video game in the Bluetang framework.
Core Components
Launch game through GameLauncher
Manage game window information
Control FrameGrabber instances
Feed GameFrames to GameAgent
Throttle frame feed speed
Expose game-specific API
Register and manage game sprites
Manage regions of interest
Handle OCR presets
Window Information
self.window_id: OS-specific window IDself.window_name: Window titleself.window_geometry: Window dimensions and position
Game-Specific
self.api: GameAPI instanceself.sprites: Registered Sprite collectionself.screen_regions: Named screen regionsself.ocr_presets: OCR configuration presets
Status Flags
self.is_launched: Game running statusself.is_focused: Window focus status
Key Concepts
Frame Grabbing
Game Frame Limiter
Frame dispatch to game agents is throttled to ensure:
Realistic APM (actions per minute)
Normalized intervals between actions
Natural gameplay feel
Default limit: 2 FPS (120 APM theoretical maximum) Configure in: config/config.plugins.yml
Game API
Sprites & Regions
Sprites: Auto-registered from
files/data/spritesScreen Regions: Define rectangular regions of interest
OCR Presets: Configure text recognition settings
Methods
launch
launchLaunches the game and runs callbacks.
Cannot be overwritten by plugins
play
playInitializes and runs a game agent with specified frame handler.
Cannot be overwritten by plugins
Callbacks
Last updated
