Skip to content

Commit 16933cd

Browse files
committed
docs(dev): add configuration system documentation
1 parent a25ce23 commit 16933cd

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

docs/contributing.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,57 @@ The project consists of:
208208
- **TCP Communication**: Real-time bidirectional communication
209209
- **Testing Suite**: Comprehensive API and integration tests
210210

211+
### Configuration System
212+
213+
The BalatroBot mod includes a sophisticated configuration system that optimizes Balatro for bot automation:
214+
215+
#### Environment Variables
216+
217+
Configure BalatroBot behavior using these environment variables:
218+
219+
- **`BALATROBOT_HEADLESS`**: Set to `"1"` to enable headless mode (no graphics rendering)
220+
- **`BALATROBOT_FAST`**: Set to `"1"` to enable fast mode (10x game speed, disabled visuals)
221+
- **`BALATROBOT_PORT`**: TCP port for communication (default: "12346")
222+
223+
#### Fast Mode Configuration
224+
225+
Fast mode (`BALATROBOT_FAST=1`) applies aggressive optimizations for bot training:
226+
227+
- **Performance**: Unlimited FPS, 10x game speed, 6x faster animations
228+
- **Graphics**: Disabled shadows, bloom, CRT effects, VSync, texture scaling set to nearest neighbor
229+
- **Audio**: Complete audio muting (volume, music, game sounds)
230+
- **Visual Effects**: Disabled motion blur, screen shake, rumble effects
231+
- **Resource Usage**: Optimized for maximum execution speed
232+
233+
#### Normal Mode Configuration
234+
235+
Normal mode preserves standard game experience while maintaining bot compatibility:
236+
237+
- **Performance**: 60 FPS cap, normal game speed, standard animations
238+
- **Graphics**: Full visual quality with shadows, bloom, and CRT effects enabled
239+
- **Audio**: Standard audio levels (50% main volume, 100% music/sounds)
240+
- **Visual Effects**: Normal motion and screen effects enabled
241+
242+
#### Headless Mode Configuration
243+
244+
Headless mode (`BALATROBOT_HEADLESS=1`) disables all graphics for server environments:
245+
246+
- **Window Management**: Minimizes and hides game window
247+
- **Rendering**: Completely disables Love2D graphics operations
248+
- **Resource Usage**: Minimal CPU/GPU usage for pure game logic execution
249+
- **Server Deployment**: Ideal for cloud-based bot training
250+
251+
#### Implementation Details
252+
253+
The configuration system is implemented in `src/lua/settings.lua` and provides:
254+
255+
- **Environment Detection**: Reads environment variables on mod initialization
256+
- **Love2D Patches**: Modifies game engine behavior for performance optimization
257+
- **Balatro Integration**: Configures game-specific settings through global variables
258+
- **Fallback Handling**: Graceful degradation when graphics context is unavailable
259+
260+
This configuration system enables BalatroBot to run efficiently in diverse environments, from local development with full graphics to high-performance server deployments with headless operation.
261+
211262
## Communication & Community
212263

213264
### Preferred Channels

0 commit comments

Comments
 (0)