|
1 | 1 | # Configuration Guide |
2 | 2 |
|
3 | | -Complete guide to configuring Balatrobot for optimal performance and functionality. |
| 3 | +Balatrobot configuration is controlled by `config.lua` in the mod directory. |
4 | 4 |
|
5 | | -## Configuration File Overview |
6 | | - |
7 | | -The main configuration is stored in `config.lua` in the mod directory. This file controls all aspects of the Balatrobot mod behavior. |
8 | | - |
9 | | -### Default Configuration |
| 5 | +## Configuration File |
10 | 6 |
|
11 | 7 | ```lua |
12 | 8 | BALATRO_BOT_CONFIG = { |
13 | | - enabled = true, -- Master enable/disable switch |
14 | | - port = '12345', -- UDP port for communication |
15 | | - dt = 8.0/60.0, -- Game update speed multiplier |
| 9 | + enabled = true, -- Enable/disable mod functionality |
| 10 | + port = '12345', -- UDP port for bot communication |
| 11 | + dt = 8.0/60.0, -- Game update speed (lower = faster) |
16 | 12 | uncap_fps = true, -- Remove FPS limitations |
17 | 13 | instant_move = true, -- Disable movement animations |
18 | 14 | disable_vsync = true, -- Disable vertical sync |
19 | 15 | disable_card_eval_status_text = true, -- Hide card scoring text |
20 | | - frame_ratio = 100, -- Render frequency (1 = every frame) |
| 16 | + frame_ratio = 100, -- Render every Nth frame (higher = faster) |
21 | 17 | } |
22 | 18 | ``` |
23 | 19 |
|
24 | | -## Core Settings |
| 20 | +## Configuration Options |
25 | 21 |
|
26 | 22 | ### enabled |
| 23 | +**Type:** `boolean` | **Default:** `true` |
27 | 24 |
|
28 | | -**Type:** `boolean` |
29 | | -**Default:** `true` |
30 | | -**Description:** Master switch for all mod functionality. |
31 | | - |
32 | | -```lua |
33 | | -enabled = true -- Mod is active |
34 | | -enabled = false -- Mod is completely disabled |
35 | | -``` |
36 | | - |
37 | | -**Usage:** |
38 | | -- Set to `false` to temporarily disable the mod without uninstalling |
39 | | -- Useful for playing the game normally without bot interference |
| 25 | +Master switch for all mod functionality. Set to `false` to disable the mod without uninstalling. |
40 | 26 |
|
41 | 27 | ### port |
| 28 | +**Type:** `string` | **Default:** `'12345'` |
42 | 29 |
|
43 | | -**Type:** `string` |
44 | | -**Default:** `'12345'` |
45 | | -**Description:** UDP port for bot communication. |
46 | | - |
47 | | -```lua |
48 | | -port = '12345' -- Default port |
49 | | -port = '12346' -- Alternative port to avoid conflicts |
50 | | -``` |
51 | | - |
52 | | -**Important Notes:** |
53 | | -- Must match the port in your Python bot configuration |
54 | | -- Change if multiple bot instances are running simultaneously |
55 | | -- Can be overridden by command line argument when launching Balatro |
56 | | - |
57 | | -**Port Selection Guidelines:** |
58 | | -- Use ports 12345-12355 for standard single-bot usage |
59 | | -- For multiple instances, increment by 1 for each instance |
60 | | -- Avoid system ports (1-1024) and common application ports |
61 | | - |
62 | | -## Performance Optimization |
63 | | - |
64 | | -### dt (Delta Time) |
65 | | - |
66 | | -**Type:** `number` |
67 | | -**Default:** `8.0/60.0` (~0.133) |
68 | | -**Description:** Game update interval in seconds. Lower values = faster game. |
69 | | - |
70 | | -```lua |
71 | | -dt = 8.0/60.0 -- Default: ~7.5 FPS equivalent |
72 | | -dt = 4.0/60.0 -- Faster: ~15 FPS equivalent |
73 | | -dt = 16.0/60.0 -- Slower: ~3.75 FPS equivalent |
74 | | -dt = 1.0/60.0 -- Maximum speed: ~60 FPS equivalent |
75 | | -``` |
| 30 | +UDP port for bot communication. Must match the port in your Python bot. Can be overridden by command line argument when launching Balatro. |
76 | 31 |
|
77 | | -**Performance Impact:** |
78 | | -- **Lower values**: Faster game execution, higher CPU usage |
79 | | -- **Higher values**: Slower execution, more visible for debugging |
80 | | -- **Recommended range**: 4.0/60.0 to 16.0/60.0 for stability |
| 32 | +### dt |
| 33 | +**Type:** `number` | **Default:** `8.0/60.0` |
81 | 34 |
|
82 | | -**Stability Considerations:** |
83 | | -- Values below 4.0/60.0 may cause game instability |
84 | | -- Very low values can overwhelm the networking stack |
85 | | -- Test thoroughly when using extreme values |
| 35 | +Game update interval in seconds. Lower values make the game run faster but use more CPU. |
86 | 36 |
|
87 | 37 | ### uncap_fps |
| 38 | +**Type:** `boolean` | **Default:** `true` |
88 | 39 |
|
89 | | -**Type:** `boolean` |
90 | | -**Default:** `true` |
91 | | -**Description:** Remove FPS limitations for maximum speed. |
92 | | - |
93 | | -```lua |
94 | | -uncap_fps = true -- Remove FPS cap (recommended for bots) |
95 | | -uncap_fps = false -- Keep normal FPS limits |
96 | | -``` |
97 | | - |
98 | | -**Effects:** |
99 | | -- `true`: Game runs as fast as possible, better for bot performance |
100 | | -- `false`: Game respects normal FPS limits, more stable visually |
101 | | - |
102 | | -### frame_ratio |
103 | | - |
104 | | -**Type:** `integer` |
105 | | -**Default:** `100` |
106 | | -**Description:** Render every Nth frame. Higher values = less rendering. |
107 | | - |
108 | | -```lua |
109 | | -frame_ratio = 1 -- Render every frame (full visual) |
110 | | -frame_ratio = 10 -- Render every 10th frame |
111 | | -frame_ratio = 100 -- Render every 100th frame (minimal visual) |
112 | | -frame_ratio = 200 -- Render every 200th frame (fastest) |
113 | | -``` |
114 | | - |
115 | | -**Performance vs Visual Quality:** |
116 | | - |
117 | | -| Value | Rendering | Performance | Use Case | |
118 | | -|-------|-----------|-------------|----------| |
119 | | -| 1 | Full visual | Slowest | Debugging, demonstrations | |
120 | | -| 10 | Reduced visual | Moderate | Development testing | |
121 | | -| 100 | Minimal visual | Fast | Production bots | |
122 | | -| 200+ | Almost no visual | Fastest | Benchmark/batch runs | |
123 | | - |
124 | | -## Visual Settings |
| 40 | +Remove FPS limitations for maximum game speed. Recommended for bot performance. |
125 | 41 |
|
126 | 42 | ### instant_move |
| 43 | +**Type:** `boolean` | **Default:** `true` |
127 | 44 |
|
128 | | -**Type:** `boolean` |
129 | | -**Default:** `true` |
130 | | -**Description:** Skip movement animations for instant card positioning. |
131 | | - |
132 | | -```lua |
133 | | -instant_move = true -- Cards move instantly (faster) |
134 | | -instant_move = false -- Cards use smooth animations (slower) |
135 | | -``` |
136 | | - |
137 | | -**Impact:** |
138 | | -- `true`: Significant performance improvement, no smooth movements |
139 | | -- `false`: Normal game animations, slower but more visually appealing |
| 45 | +Skip movement animations for instant card positioning. Provides significant performance improvement. |
140 | 46 |
|
141 | 47 | ### disable_vsync |
| 48 | +**Type:** `boolean` | **Default:** `true` |
142 | 49 |
|
143 | | -**Type:** `boolean` |
144 | | -**Default:** `true` |
145 | | -**Description:** Disable vertical synchronization. |
146 | | - |
147 | | -```lua |
148 | | -disable_vsync = true -- Disable VSync (faster, may cause tearing) |
149 | | -disable_vsync = false -- Enable VSync (smoother, frame-rate limited) |
150 | | -``` |
151 | | - |
152 | | -**Considerations:** |
153 | | -- `true`: Better performance, possible screen tearing |
154 | | -- `false`: Smoother visuals, frame rate limited to monitor refresh |
| 50 | +Disable vertical synchronization for better performance. |
155 | 51 |
|
156 | 52 | ### disable_card_eval_status_text |
| 53 | +**Type:** `boolean` | **Default:** `true` |
157 | 54 |
|
158 | | -**Type:** `boolean` |
159 | | -**Default:** `true` |
160 | | -**Description:** Hide floating text when cards are scored ("+10", etc.). |
161 | | - |
162 | | -```lua |
163 | | -disable_card_eval_status_text = true -- Hide score text (faster) |
164 | | -disable_card_eval_status_text = false -- Show score text (slower) |
165 | | -``` |
166 | | - |
167 | | -**Performance Impact:** |
168 | | -- Disabling this text provides a small but measurable performance improvement |
169 | | -- Recommended to keep `true` for production bots |
170 | | - |
171 | | -## Network Configuration |
172 | | - |
173 | | -### Command Line Port Override |
174 | | - |
175 | | -The port can be overridden when launching Balatro: |
| 55 | +Hide floating score text ("+10", etc.) when cards are scored for better performance. |
176 | 56 |
|
177 | | -```bash |
178 | | -# Windows |
179 | | -Balatro.exe 12346 |
| 57 | +### frame_ratio |
| 58 | +**Type:** `integer` | **Default:** `100` |
180 | 59 |
|
181 | | -# Launch with specific port |
182 | | -steam://rungameid/2379780//12346 |
183 | | -``` |
| 60 | +Render every Nth frame. Higher values provide better performance with less visual output. |
184 | 61 |
|
185 | | -### Multi-Instance Setup |
| 62 | +## Multi-Instance Setup |
186 | 63 |
|
187 | | -For running multiple bot instances: |
| 64 | +For multiple bot instances, use different ports: |
188 | 65 |
|
189 | | -**Instance 1 (config.lua):** |
190 | 66 | ```lua |
| 67 | +-- Instance 1 |
191 | 68 | port = '12345' |
192 | | -``` |
193 | 69 |
|
194 | | -**Instance 2 (config.lua):** |
195 | | -```lua |
| 70 | +-- Instance 2 |
196 | 71 | port = '12346' |
197 | 72 | ``` |
198 | 73 |
|
199 | | -**Instance 3 (config.lua):** |
200 | | -```lua |
201 | | -port = '12347' |
202 | | -``` |
203 | | - |
204 | | -**Python Bot Configuration:** |
205 | | -```python |
206 | | -# Bot 1 |
207 | | -bot1 = Bot(deck="Red Deck", stake=1, bot_port=12345) |
208 | | - |
209 | | -# Bot 2 |
210 | | -bot2 = Bot(deck="Blue Deck", stake=1, bot_port=12346) |
211 | | - |
212 | | -# Bot 3 |
213 | | -bot3 = Bot(deck="Yellow Deck", stake=1, bot_port=12347) |
| 74 | +Launch Balatro with specific port: |
| 75 | +```bash |
| 76 | +Balatro.exe 12346 |
214 | 77 | ``` |
215 | 78 |
|
216 | 79 | ## Bot-Specific Settings |
|
0 commit comments