comparison config/game.toml @ 36:a464bd43b76c 1.0.0

clean documentation rewrite
author ark
date 2026-10-21 22:34 +0200
parents 85d23328a215
children
comparison
equal deleted inserted replaced
35:0d40f346059c 36:a464bd43b76c
1 # game settings. tools/build.py checks this file and writes www/data/config.js. 1 # game settings. tools/build.py checks this file and writes www/data/config.js.
2 # 2 #
3 # units: distances in map pixels (pixels of the map image as scanned), times 3 # units: distances in map pixels (pixels of the map image as scanned), times
4 # in seconds, speeds in map pixels per second. 4 # in seconds, speeds in map pixels per second. doc/architecture.md lists
5 # 5 # the sections.
6 # source markers, as in doc/balance.md:
7 # notes from the original design notes or drawing sheet, decided
8 # decided decided after the notes were written
9 # guess a starting value for playtesting, expected to change
10 # derived calculated from other values
11 # proto chosen while building the prototype, not in the docs
12 # (see "prototype notes" in doc/roadmap.md)
13 6
14 7
15 [scale] 8 [scale]
16 map = 1.0 # notes 9 map = 1.0
17 sprite = 0.25 # notes ("maps scaled approx 400%"), towers, monsters, projectiles 10 sprite = 0.25 # towers, monsters, projectiles
18 coin = 0.4 # guess, 0.25 makes them about 10 pixels 11 coin = 0.4
19 hp_bar = 0.25 # guess 12 hp_bar = 0.25
20 13
21 14
22 # monsters. coins are set apart from hp (decided): regular monsters drop 15 # monsters: hp, coins dropped on death, speed. boss marks the boss of a
23 # 0.10 to 0.20 coins per hp, bosses 0.2. 16 # map, b0 for map0 and so on.
24 # hit_radius is a share of the scaled sprite's smaller side.
25 17
26 [monster.m0] 18 [monster.m0]
27 hp = 5 19 hp = 5
28 coins = 1 20 coins = 1
29 speed = 35 21 speed = 35
101 93
102 # towers have 5 levels. damage, range, slow and cost give the values at 94 # towers have 5 levels. damage, range, slow and cost give the values at
103 # level 1 and level 5; the build fills in the levels between in equal steps, 95 # level 1 and level 5; the build fills in the levels between in equal steps,
104 # rounded to whole numbers when both ends are whole. cost is the price of 96 # rounded to whole numbers when both ends are whole. cost is the price of
105 # building (level 1) or of upgrading to that level. attack_time is the time 97 # building (level 1) or of upgrading to that level. attack_time is the time
106 # between attacks, the same at every level (decided). projectile_speed 0 98 # between attacks, the same at every level. projectile_speed 0
107 # means a melee tower: each attack damages every monster in range. damage 99 # means a melee tower: each attack damages every monster in range. damage
108 # may be left out for a tower that only slows. 100 # may be left out for a tower that only slows.
109 101
110 # melee tower. low damage because it often hits multiple monsters. 102 # melee tower. low damage because it often hits multiple monsters.
111 [tower.t0] 103 [tower.t0]
179 171
180 [controls] 172 [controls]
181 speeds = [1, 2, 4] 173 speeds = [1, 2, 4]
182 174
183 175
184 # sound events (doc/sound.md). the recordings come from art/sounds/, named 176 # sound events (doc/art.md, sound). the recordings come from art/sounds/, named
185 # after the event. per event: volume is a share of full volume. min_interval 177 # after the event. per event: volume is a share of full volume. min_interval
186 # is the least time between two plays; plays in between are dropped. beep is 178 # is the least time between two plays; plays in between are dropped. beep is
187 # the placeholder for an event without a recording, as notes of [frequency in 179 # the placeholder for an event without a recording, as notes of [frequency in
188 # Hz, seconds]. 180 # Hz, seconds].
189 [sound] 181 [sound]
190 enabled = true # until the player switches sound on or off in the game 182 enabled = true # until the player switches sound on or off in the game
191 volume = 0.8 # base for all sounds 183 volume = 0.8 # base for all sounds
192 beep_wave = "square" 184 beep_wave = "square"
193 music_fade = 0.4 # seconds the splash screen music takes to fade out. proto 185 music_fade = 0.4 # seconds the splash screen music takes to fade out
194 186
195 [sound.event] 187 [sound.event]
196 t0_attack = { volume = 0.6 } 188 t0_attack = { volume = 0.6 }
197 t1_shot = { volume = 0.4 } 189 t1_shot = { volume = 0.4 }
198 t2_shot = { volume = 0.4 } 190 t2_shot = { volume = 0.4 }
212 tower_sold = { volume = 0.4, beep = [[494, 0.05], [330, 0.08]] } 204 tower_sold = { volume = 0.4, beep = [[494, 0.05], [330, 0.08]] }
213 placement_refused = { volume = 0.4, beep = [[220, 0.12], [165, 0.18]] } 205 placement_refused = { volume = 0.4, beep = [[220, 0.12], [165, 0.18]] }
214 button_tap = { volume = 0.3, beep = [[1000, 0.02]] } 206 button_tap = { volume = 0.3, beep = [[1000, 0.02]] }
215 map_won = { volume = 1.0 } 207 map_won = { volume = 1.0 }
216 map_lost = { volume = 1.0 } 208 map_lost = { volume = 1.0 }
217 intro = { volume = 1.0 } # splash screen music, looped. proto 209 intro = { volume = 1.0 } # splash screen music, looped
218 210
219 211
220 # sprite drawing direction (art.md): angle the drawing points to as drawn, 212 # sprite drawing direction (doc/art.md): angle the drawing points to as
221 # 0 right, -90 up. sprites not listed do not turn. set by hand, the towers 213 # drawn, 0 right, -90 up. sprites not listed do not turn. set by hand, the
222 # checked in temp/preview/towers.png. 214 # towers checked in temp/preview/towers.png.
223 # adjusted by hand.
224 [art.angle] 215 [art.angle]
225 t1 = -2 216 t1 = -2
226 t1_2 = -3 217 t1_2 = -3
227 t1_3 = -6 218 t1_3 = -6
228 t1_4 = 0 219 t1_4 = 0
240 p0 = -90 231 p0 = -90
241 p1 = 0 232 p1 = 0
242 p3 = -45 233 p3 = -45
243 234
244 # rotation point as a share of the trimmed image's width and height, for 235 # rotation point as a share of the trimmed image's width and height, for
245 # sprites that do not turn around their centre (art.md). proto, checked in 236 # sprites that do not turn around their centre (doc/art.md): the middle of
246 # temp/preview/towers.png. t1: the centre of the base square measured on 237 # the tower's body. set by hand, checked in temp/preview/towers.png.
247 # source_sheet_2 cutouts. t2: the middle of the rows at least 60 % as wide as
248 # the widest row, which leaves out the barrel. t3: the centroid of the shape
249 # with parts narrower than 41 pixels removed.
250 # adjusted by hand.
251 [art.pivot] 238 [art.pivot]
252 t1 = [0.37, 0.5] 239 t1 = [0.37, 0.5]
253 t1_2 = [0.30, 0.5] 240 t1_2 = [0.30, 0.5]
254 t1_3 = [0.33, 0.48] 241 t1_3 = [0.33, 0.48]
255 t1_4 = [0.35, 0.52] 242 t1_4 = [0.35, 0.52]
265 t3_4 = [0.45, 0.46] 252 t3_4 = [0.45, 0.46]
266 t3_5 = [0.49, 0.54] 253 t3_5 = [0.49, 0.54]
267 254
268 # where the button of each screen sits on the screen's drawing: the top left 255 # where the button of each screen sits on the screen's drawing: the top left
269 # corner of the separate button image, in pixels of the trimmed drawing. 256 # corner of the separate button image, in pixels of the trimmed drawing.
270 # proto, found by matching the button image against the drawing.
271 [art.screen] 257 [art.screen]
272 splash = [479, 463] 258 splash = [479, 463]
273 map_won = [210, 225] 259 map_won = [210, 225]
274 game_lost = [172, 230] 260 game_lost = [172, 230]
275 game_won = [373, 383] 261 game_won = [373, 383]
276 # the logo and help buttons beside the play button on the splash screen: 262 # the logo and help buttons beside the play button on the splash screen:
277 # top left corner and height, in pixels of the trimmed splash drawing. proto 263 # top left corner and height, in pixels of the trimmed splash drawing
278 splash_logo = [119, 463, 164] 264 splash_logo = [119, 463, 164]
279 splash_help = [896, 463, 164] 265 splash_help = [896, 463, 164]
280 # the email address on the help popup, a tap on it writes a mail: top left 266 # the email address on the help popup, a tap on it writes a mail: top left
281 # corner, width and height, in pixels of the drawing. measured, with a margin 267 # corner, width and height, in pixels of the drawing, with a margin
282 help_email = [690, 1505, 665, 100] 268 help_email = [690, 1505, 665, 100]
283 269
284 270
285 # web page the logo on the splash screen opens in a new tab. empty: the 271 # web page the logo on the splash screen opens in a new tab. empty: the
286 # logo does nothing. the address and subject of the mail written from the 272 # logo does nothing. the address and subject of the mail written from the
313 299
314 [map.0] 300 [map.0]
315 starting_coins = 10 301 starting_coins = 10
316 early_bonus = 0.05 302 early_bonus = 0.05
317 wave_count = 6 303 wave_count = 6
318 monster_share = [36, 25, 18, 12, 9] # fitted in tools/simulate.js; % of regular monsters by count, m0-m4 304 monster_share = [36, 25, 18, 12, 9] # draft: % of regular monsters by count, m0-m4
319 wave_size = [4, 7] # fitted; regular monsters in the first and the last wave (draft, tools/balance.py) 305 wave_size = [4, 7] # draft: regular monsters in the first and the last wave
320 first_wave = [1, 2, 2, 4, 5] # fitted; wave in which each monster level first appears, m0-m4 (draft) 306 first_wave = [1, 2, 2, 4, 5] # draft: wave in which each monster first appears, m0-m4
321 spawn_interval = 1.0 # fitted; seconds between spawns 307 spawn_interval = 1.0 # seconds between spawns
322 path_half_width = 19 # measured from the earlier masks, centre line to road edge 308 path_half_width = 19 # centre line to road edge
323 spawn_distance = 50 309 spawn_distance = 50
324 exit_distance = 40 310 exit_distance = 40
325 311
326 [map.1] 312 [map.1]
327 starting_coins = 20 313 starting_coins = 20
357 spawn_interval = 0.5 343 spawn_interval = 0.5
358 path_half_width = 22 344 path_half_width = 22
359 spawn_distance = 50 345 spawn_distance = 50
360 exit_distance = 40 346 exit_distance = 40
361 347
362 # map0: drafted by tools/balance.py --draft from wave_count 6, wave_size [4, 7], 348 # map0 waves
363 # monster_share [36, 25, 18, 12, 9], first_wave [1, 2, 2, 4, 5] 349
364 350 [[map.0.wave]] # wave 1
365 [[map.0.wave]] # wave 1, 4 monsters, 20 hp, 4 coins
366 monsters = { m0 = 4 } 351 monsters = { m0 = 4 }
367 352
368 [[map.0.wave]] # wave 2, 5 monsters, 45 hp, 6 coins 353 [[map.0.wave]] # wave 2
369 monsters = { m0 = 2, m1 = 2, m2 = 1 } 354 monsters = { m0 = 2, m1 = 2, m2 = 1 }
370 355
371 [[map.0.wave]] # wave 3, 5 monsters, 45 hp, 6 coins 356 [[map.0.wave]] # wave 3
372 monsters = { m0 = 2, m1 = 2, m2 = 1 } 357 monsters = { m0 = 2, m1 = 2, m2 = 1 }
373 358
374 [[map.0.wave]] # wave 4, 6 monsters, 65 hp, 8 coins 359 [[map.0.wave]] # wave 4
375 monsters = { m0 = 2, m1 = 2, m2 = 1, m3 = 1 } 360 monsters = { m0 = 2, m1 = 2, m2 = 1, m3 = 1 }
376 361
377 [[map.0.wave]] # wave 5, 6 monsters, 90 hp, 10 coins 362 [[map.0.wave]] # wave 5
378 monsters = { m0 = 1, m1 = 2, m2 = 1, m3 = 1, m4 = 1 } 363 monsters = { m0 = 1, m1 = 2, m2 = 1, m3 = 1, m4 = 1 }
379 364
380 [[map.0.wave]] # wave 6, 7 monsters, 130 hp, 14 coins + boss 30 365 [[map.0.wave]] # wave 6
381 monsters = { m0 = 1, m1 = 1, m2 = 1, m3 = 2, m4 = 2, b0 = 1 } 366 monsters = { m0 = 1, m1 = 1, m2 = 1, m3 = 2, m4 = 2, b0 = 1 }
382 367
383 # map1: drafted by tools/balance.py --draft from wave_count 8, wave_size [6, 17], 368 # map1 waves
384 # monster_share [36, 25, 18, 12, 9], first_wave [1, 2, 3, 5, 6] 369
385 370 [[map.1.wave]] # wave 1
386 [[map.1.wave]] # wave 1, 6 monsters, 30 hp, 6 coins
387 monsters = { m0 = 6 } 371 monsters = { m0 = 6 }
388 372
389 [[map.1.wave]] # wave 2, 8 monsters, 55 hp, 8 coins 373 [[map.1.wave]] # wave 2
390 monsters = { m0 = 5, m1 = 3 } 374 monsters = { m0 = 5, m1 = 3 }
391 375
392 [[map.1.wave]] # wave 3, 9 monsters, 80 hp, 11 coins 376 [[map.1.wave]] # wave 3
393 monsters = { m0 = 4, m1 = 3, m2 = 2 } 377 monsters = { m0 = 4, m1 = 3, m2 = 2 }
394 378
395 [[map.1.wave]] # wave 4, 11 monsters, 105 hp, 14 coins 379 [[map.1.wave]] # wave 4
396 monsters = { m0 = 4, m1 = 4, m2 = 3 } 380 monsters = { m0 = 4, m1 = 4, m2 = 3 }
397 381
398 [[map.1.wave]] # wave 5, 12 monsters, 135 hp, 17 coins 382 [[map.1.wave]] # wave 5
399 monsters = { m0 = 4, m1 = 3, m2 = 3, m3 = 2 } 383 monsters = { m0 = 4, m1 = 3, m2 = 3, m3 = 2 }
400 384
401 [[map.1.wave]] # wave 6, 14 monsters, 210 hp, 24 coins 385 [[map.1.wave]] # wave 6
402 monsters = { m0 = 3, m1 = 3, m2 = 3, m3 = 3, m4 = 2 } 386 monsters = { m0 = 3, m1 = 3, m2 = 3, m3 = 3, m4 = 2 }
403 387
404 [[map.1.wave]] # wave 7, 15 monsters, 240 hp, 27 coins 388 [[map.1.wave]] # wave 7
405 monsters = { m0 = 3, m1 = 3, m2 = 3, m3 = 3, m4 = 3 } 389 monsters = { m0 = 3, m1 = 3, m2 = 3, m3 = 3, m4 = 3 }
406 390
407 [[map.1.wave]] # wave 8, 17 monsters, 290 hp, 32 coins + boss 50 391 [[map.1.wave]] # wave 8
408 monsters = { m0 = 3, m1 = 3, m2 = 3, m3 = 4, m4 = 4, b1 = 1 } 392 monsters = { m0 = 3, m1 = 3, m2 = 3, m3 = 4, m4 = 4, b1 = 1 }
409 393
410 # map2: drafted by tools/balance.py --draft from wave_count 10, wave_size [10, 36], 394 # map2 waves
411 # monster_share [39, 26, 17, 11, 7], first_wave [1, 2, 4, 6, 8] 395
412 396 [[map.2.wave]] # wave 1
413 [[map.2.wave]] # wave 1, 10 monsters, 50 hp, 10 coins
414 monsters = { m0 = 10 } 397 monsters = { m0 = 10 }
415 398
416 [[map.2.wave]] # wave 2, 13 monsters, 85 hp, 13 coins 399 [[map.2.wave]] # wave 2
417 monsters = { m0 = 9, m1 = 4 } 400 monsters = { m0 = 9, m1 = 4 }
418 401
419 [[map.2.wave]] # wave 3, 16 monsters, 110 hp, 16 coins 402 [[map.2.wave]] # wave 3
420 monsters = { m0 = 10, m1 = 6 } 403 monsters = { m0 = 10, m1 = 6 }
421 404
422 [[map.2.wave]] # wave 4, 19 monsters, 160 hp, 22 coins 405 [[map.2.wave]] # wave 4
423 monsters = { m0 = 9, m1 = 7, m2 = 3 } 406 monsters = { m0 = 9, m1 = 7, m2 = 3 }
424 407
425 [[map.2.wave]] # wave 5, 22 monsters, 195 hp, 27 coins 408 [[map.2.wave]] # wave 5
426 monsters = { m0 = 10, m1 = 7, m2 = 5 } 409 monsters = { m0 = 10, m1 = 7, m2 = 5 }
427 410
428 [[map.2.wave]] # wave 6, 24 monsters, 250 hp, 32 coins 411 [[map.2.wave]] # wave 6
429 monsters = { m0 = 9, m1 = 7, m2 = 5, m3 = 3 } 412 monsters = { m0 = 9, m1 = 7, m2 = 5, m3 = 3 }
430 413
431 [[map.2.wave]] # wave 7, 27 monsters, 305 hp, 38 coins 414 [[map.2.wave]] # wave 7
432 monsters = { m0 = 9, m1 = 7, m2 = 6, m3 = 5 } 415 monsters = { m0 = 9, m1 = 7, m2 = 6, m3 = 5 }
433 416
434 [[map.2.wave]] # wave 8, 30 monsters, 410 hp, 48 coins 417 [[map.2.wave]] # wave 8
435 monsters = { m0 = 8, m1 = 7, m2 = 6, m3 = 6, m4 = 3 } 418 monsters = { m0 = 8, m1 = 7, m2 = 6, m3 = 6, m4 = 3 }
436 419
437 [[map.2.wave]] # wave 9, 33 monsters, 485 hp, 56 coins 420 [[map.2.wave]] # wave 9
438 monsters = { m0 = 8, m1 = 7, m2 = 7, m3 = 6, m4 = 5 } 421 monsters = { m0 = 8, m1 = 7, m2 = 7, m3 = 6, m4 = 5 }
439 422
440 [[map.2.wave]] # wave 10, 36 monsters, 565 hp, 64 coins + boss 70 423 [[map.2.wave]] # wave 10
441 monsters = { m0 = 8, m1 = 7, m2 = 7, m3 = 7, m4 = 7, b2 = 1 } 424 monsters = { m0 = 8, m1 = 7, m2 = 7, m3 = 7, m4 = 7, b2 = 1 }
442 425
443 # map3: drafted by tools/balance.py --draft from wave_count 12, wave_size [5, 16], 426 # map3 waves
444 # monster_share [52, 26, 13, 6, 3], first_wave [1, 2, 4, 6, 9] 427
445 428 [[map.3.wave]] # wave 1
446 [[map.3.wave]] # wave 1, 5 monsters, 25 hp, 5 coins
447 monsters = { m0 = 5 } 429 monsters = { m0 = 5 }
448 430
449 [[map.3.wave]] # wave 2, 6 monsters, 35 hp, 6 coins 431 [[map.3.wave]] # wave 2
450 monsters = { m0 = 5, m1 = 1 } 432 monsters = { m0 = 5, m1 = 1 }
451 433
452 [[map.3.wave]] # wave 3, 7 monsters, 45 hp, 7 coins 434 [[map.3.wave]] # wave 3
453 monsters = { m0 = 5, m1 = 2 } 435 monsters = { m0 = 5, m1 = 2 }
454 436
455 [[map.3.wave]] # wave 4, 8 monsters, 60 hp, 9 coins 437 [[map.3.wave]] # wave 4
456 monsters = { m0 = 5, m1 = 2, m2 = 1 } 438 monsters = { m0 = 5, m1 = 2, m2 = 1 }
457 439
458 [[map.3.wave]] # wave 5, 9 monsters, 70 hp, 10 coins 440 [[map.3.wave]] # wave 5
459 monsters = { m0 = 5, m1 = 3, m2 = 1 } 441 monsters = { m0 = 5, m1 = 3, m2 = 1 }
460 442
461 [[map.3.wave]] # wave 6, 10 monsters, 85 hp, 12 coins 443 [[map.3.wave]] # wave 6
462 monsters = { m0 = 5, m1 = 3, m2 = 2 } 444 monsters = { m0 = 5, m1 = 3, m2 = 2 }
463 445
464 [[map.3.wave]] # wave 7, 11 monsters, 105 hp, 14 coins 446 [[map.3.wave]] # wave 7
465 monsters = { m0 = 5, m1 = 3, m2 = 2, m3 = 1 } 447 monsters = { m0 = 5, m1 = 3, m2 = 2, m3 = 1 }
466 448
467 [[map.3.wave]] # wave 8, 12 monsters, 110 hp, 15 coins 449 [[map.3.wave]] # wave 8
468 monsters = { m0 = 6, m1 = 3, m2 = 2, m3 = 1 } 450 monsters = { m0 = 6, m1 = 3, m2 = 2, m3 = 1 }
469 451
470 [[map.3.wave]] # wave 9, 13 monsters, 120 hp, 16 coins 452 [[map.3.wave]] # wave 9
471 monsters = { m0 = 6, m1 = 4, m2 = 2, m3 = 1 } 453 monsters = { m0 = 6, m1 = 4, m2 = 2, m3 = 1 }
472 454
473 [[map.3.wave]] # wave 10, 14 monsters, 150 hp, 19 coins 455 [[map.3.wave]] # wave 10
474 monsters = { m0 = 6, m1 = 4, m2 = 2, m3 = 1, m4 = 1 } 456 monsters = { m0 = 6, m1 = 4, m2 = 2, m3 = 1, m4 = 1 }
475 457
476 [[map.3.wave]] # wave 11, 15 monsters, 170 hp, 21 coins 458 [[map.3.wave]] # wave 11
477 monsters = { m0 = 6, m1 = 4, m2 = 2, m3 = 2, m4 = 1 } 459 monsters = { m0 = 6, m1 = 4, m2 = 2, m3 = 2, m4 = 1 }
478 460
479 [[map.3.wave]] # wave 12, 16 monsters, 185 hp, 23 coins + boss 100 461 [[map.3.wave]] # wave 12
480 monsters = { m0 = 6, m1 = 4, m2 = 3, m3 = 2, m4 = 1, b3 = 1 } 462 monsters = { m0 = 6, m1 = 4, m2 = 3, m3 = 2, m4 = 1, b3 = 1 }