How sam230230/balatro-auto-game-play-data-acquisition works
Balatro gameplay automation is driven by BLTR_controller.py: it observes the game screen, chooses hand/discard actions, executes clicks, tracks scores and endings, and records sessions. Hand-card detection and game-stat OCR provide observations; card selection and Markov-parameter optimization support decisions and learning. The README also describes gameplay-data generation and optimization. Evidence is strongest for the controller’s integrations; the templates directory is present, but its runtime path is hard-coded elsewhere, so that link is not inferred.
Main entry points: BLTR_controller.py Gameplay controller · cards_detect_fn.py Hand-card detection · game_end_info_detect.py Game-stat OCR · auto_card_selector.py Card selector
Components 9
Gameplay automation
- Gameplay controller
BLTR_controller.py - Card selector
auto_card_selector.py
Screen perception
- Hand-card detection
cards_detect_fn.py - Game-stat OCR
game_end_info_detect.py
Decision learning
- Markov optimizer
play_balatro_par_optim.py
Session state
- Gameplay session log
BLTR_controller.py - Learned parameters
BLTR_controller.py
Other components
- Operator
- Balatro game
Connections 11
- Operator → Gameplay controller: starts
README.md - Gameplay controller → Hand-card detection: detects cards
BLTR_controller.py - Gameplay controller → Game-stat OCR: reads game stats
BLTR_controller.py - Gameplay controller → Card selector: selects cards
BLTR_controller.py - Gameplay controller → Balatro game: clicks controls
BLTR_controller.py - Hand-card detection → Balatro game: captures hand
cards_detect_fn.py - Game-stat OCR → Balatro game: captures stats
game_end_info_detect.py - Gameplay controller → Markov optimizer: fits parameters
BLTR_controller.py - Gameplay controller → Gameplay session log: appends sessions
BLTR_controller.py - Gameplay controller → Learned parameters: loads parameters
BLTR_controller.py - Gameplay controller → Learned parameters: saves parameters
BLTR_controller.py