view config/game.toml @ 14:7fda634d15ad

adjustments to wave logic, tower pivot points
author ark
date 2026-10-19 22:50 +0200
parents 22b604680c5a
children c1c7e4f54bf6
line wrap: on
line source

# game settings. tools/build.py checks this file and writes game/data/config.js.
#
# units: distances in map pixels (pixels of the map image as scanned), times
# in seconds, speeds in map pixels per second.
#
# source markers, as in doc/balance.md:
#   notes    from the original design notes or drawing sheet, decided
#   decided  decided after the notes were written
#   guess    a starting value for playtesting, expected to change
#   derived  calculated from other values
#   proto    chosen while building the prototype, not in the docs
#            (see "prototype notes" in doc/roadmap.md)


[scale]
map = 1.0           # notes
sprite = 0.25       # notes ("maps scaled approx 400%"), towers, monsters, projectiles
coin = 0.4          # guess, 0.25 makes them about 10 pixels
hp_bar = 0.25       # guess


# monsters. coins: regular monsters drop 0.2 coins per hp, bosses 1 coin per
# hp (derived). hit_radius is a share of the scaled sprite's smaller side.

[monster.m0]
hp = 5              # notes
coins = 1           # notes
speed = 35          # guess

[monster.m1]
hp = 10             # notes
coins = 2           # notes
speed = 40          # guess

[monster.m2]
hp = 15             # notes
coins = 3           # notes
speed = 45          # guess

[monster.m3]
hp = 20             # notes
coins = 4           # notes
speed = 40          # guess

[monster.m4]
hp = 30             # notes
coins = 6           # notes
speed = 35          # guess

[monster.b0]
hp = 30             # notes
coins = 30          # notes
speed = 25          # guess
boss = true

[monster.b1]
hp = 50             # notes
coins = 50          # notes
speed = 25          # guess
boss = true

[monster.b2]
hp = 70             # notes
coins = 70          # notes
speed = 25          # guess
boss = true

[monster.b3]
hp = 100            # notes
coins = 100         # notes
speed = 25          # guess
boss = true


[animation]
hop_time = 0.35     # guess
hop_height = 5      # guess
squash = 0.06       # guess, on landing, wider and flatter
stretch = 0.04      # guess, in the air
idle_bob = 0.02     # guess
hit_radius = 0.4    # proto, share of the monster sprite's smaller side
death_puff = 0.4    # guess, seconds the death puff shows


# variation between monsters, so they do not walk in single file
[movement]
speed_variation = 0.05  # guess, each monster's speed differs by up to this share either way
offset = 0.45           # guess, largest sideways offset from the centre line, share of the road half width
lean = 0.5              # guess, fixed part of a monster's offset, share of the largest offset
wander_step = 40        # guess, distance along the route between the wandering part's values
fade_in = 20            # guess, distance from the route start over which the offset grows from 0


[route_preference]
reference_speed = 40    # guess
bias = 3                # guess
min_weight = 0.1        # guess


# towers. damage and range lists are by level 1-5. attack_time is the time
# between attacks, the same at every level (decided). projectile_speed 0
# means a melee tower: each attack damages every monster in range.
# level n costs cost x n (decided).

[tower.t0]
damage = [5, 10, 15, 20, 25]        # notes
cost = 5                            # notes
range = [60, 63, 66, 69, 72]        # level 1: decided (was 45), rest: guess
attack_time = 1.5                   # guess, slower than the others (decided)
projectile = "p0"
projectile_speed = 0                # notes (melee)

[tower.t1]
damage = [3, 7, 13, 17, 23]         # notes
cost = 10                           # notes
range = [100, 104, 108, 112, 116]   # guess
attack_time = 0.7                   # guess
projectile = "p1"
projectile_speed = 300              # guess

[tower.t2]
damage = [1, 3, 5, 7, 9]            # 1-4: notes, 5: guess
cost = 20                           # notes
range = [90, 94, 98, 102, 106]      # guess
attack_time = 1.2                   # guess
projectile = "p2"
projectile_speed = 220              # guess
slow = [0.60, 0.55, 0.50, 0.45, 0.40]   # guess, share of speed left, by level
slow_time = 2.0                     # guess

[tower.t3]
damage = [1, 5, 7, 10, 13]          # 1-4: notes, 5: guess
cost = 25                           # decided (was 40), may go lower
range = [220, 230, 240, 250, 260]   # guess
attack_time = 1.3                   # decided, amount guessed
projectile = "p3"
projectile_speed = 800              # guess

[tower_rules]
sell_refund = 0.5       # decided, half of everything paid for the tower, rounded down


[placement]
footprint_radius = 16   # guess
max_gap = 14            # guess, largest gap between footprint and path edge
min_tower_distance = 32 # derived (two footprints)
edge_distance = 16      # guess
snap_radius = 48        # guess
grid_cell = 4           # guess


[economy]
coin_total_factor = 10  # notes, coins dropped per map = 10 x starting coins
coin_tolerance = 0.05   # notes for the build check: warn when more than 5 % off


[waves]
first_break = 40        # guess
break = 25              # guess ("longer", decided)
spawn_interval = 1.0    # guess, default for maps without their own


[hearts]
per_map = 10            # decided
monster = 1             # decided
boss = 5                # decided


[coins]
flight_time = 0.7       # guess
max_sprites = 8         # guess


[controls]
speeds = [1, 2, 4]      # decided


# sound events (doc/sound.md). the recordings come from art/sounds/, named
# after the event. per event: volume is a share of full volume. min_interval
# is the least time between two plays; plays in between are dropped. beep is
# the placeholder for an event without a recording, as notes of [frequency in
# Hz, seconds].
[sound]
enabled = true          # proto, until the player switches sound on or off in the game
volume = 0.8            # guess, all sounds
beep_wave = "square"    # proto

[sound.event]
t0_attack = { volume = 0.6 }        # guess
t1_shot = { volume = 0.4 }          # guess
t2_shot = { volume = 0.4 }          # guess
t3_shot = { volume = 0.5 }          # guess
monster_enter = { volume = 0.4 }    # guess, every monster for now (decided, to playtest)
monster_exit = { volume = 0.8 }     # guess
monster_die = { volume = 0.5 }      # guess
monster_hit = { volume = 0.2, min_interval = 0.05, beep = [[1200, 0.03]] }    # guess
boss_enter = { volume = 1.0 }       # guess
boss_exit = { volume = 1.0 }        # guess
boss_die = { volume = 1.0 }         # guess
coins_arrive = { volume = 0.25, min_interval = 0.08, beep = [[1568, 0.04], [2093, 0.06]] }    # guess
wave_start = { volume = 0.4, beep = [[440, 0.1], [660, 0.15]] }     # guess
early_bonus = { volume = 0.4, beep = [[880, 0.06], [1175, 0.06], [1760, 0.1]] }   # guess
tower_built = { volume = 0.4, beep = [[330, 0.05], [494, 0.08]] }   # guess
tower_upgraded = { volume = 0.4, beep = [[392, 0.05], [587, 0.05], [784, 0.08]] }   # guess
tower_sold = { volume = 0.4, beep = [[494, 0.05], [330, 0.08]] }    # guess
placement_refused = { volume = 0.4, beep = [[220, 0.12], [165, 0.18]] }   # guess
button_tap = { volume = 0.3, beep = [[1000, 0.02]] }    # guess
map_won = { volume = 1.0 }          # guess
map_lost = { volume = 1.0 }         # guess


# sprite drawing direction (art.md): angle the drawing points to as drawn,
# 0 right, -90 up. sprites not listed do not turn.
[art.angle]
t1 = 0
t1_2 = 0
t1_3 = 0
t1_4 = 0
t1_5 = 0
t2 = -90
t2_2 = -90
t2_3 = -90
t2_4 = -90
t2_5 = -90
t3 = -45
t3_2 = -45
t3_3 = -45
t3_4 = -45
t3_5 = -90
p0 = -90
p3 = -45

# rotation point as a share of the trimmed image's width and height, for
# sprites that do not turn around their centre (art.md). proto, checked in
# temp/preview/towers.png. t1: the centre of the base square measured on
# source_sheet_2 cutouts. t2: the middle of the rows at least 60 % as wide as
# the widest row, which leaves out the barrel. t3: the centroid of the shape
# with parts narrower than 41 pixels removed, an estimate to adjust by hand.
[art.pivot]
t1 = [0.37, 0.5]
t1_2 = [0.30, 0.5]
t1_3 = [0.33, 0.5]
t1_4 = [0.35, 0.5]
t1_5 = [0.27, 0.5]
t2 = [0.49, 0.57]
t2_2 = [0.50, 0.61]
t2_3 = [0.49, 0.64]
t2_4 = [0.50, 0.71]
t2_5 = [0.50, 0.72]
t3 = [0.40, 0.62]
t3_2 = [0.41, 0.59]
t3_3 = [0.41, 0.48]
t3_4 = [0.45, 0.46]
t3_5 = [0.49, 0.54]

# where the button of each screen sits on the screen's drawing: the top left
# corner of the separate button image, in pixels of the trimmed drawing.
# proto, found by matching the button image against the drawing.
[art.screen]
splash = [479, 463]
map_won = [210, 225]
game_lost = [172, 230]
game_won = [373, 383]


# debug switches, all off by default
[debug]
start_coins = -1        # coins at the start of a map, -1 uses the map's value
unlimited_coins = false
start_map = 0
start_wave = 1          # the first wave to play, from 1
no_heart_loss = false
show_routes = false
show_grid = false
show_ranges = false
show_hit_areas = false
extra_speeds = []       # added to the game speeds, for example [8]
show_stats = false      # frame time and entity counts
seed = 0                # random seed, 0 picks a new one each run


# maps. waves: number of each monster in the wave. the boss spawns first, the
# others follow one per spawn interval, in random order. the boss is in the
# last wave.

[map.0]
starting_coins = 10                     # notes
early_bonus = 0.05                      # guess (starting coins / 200), coins per second left
wave_count = 6                          # guess
monster_share = [40, 25, 15, 10, 10]    # guess, % of regular monster coins, m0-m4
spawn_interval = 1.0                    # proto, seconds between spawns
path_half_width = 19                    # measured from the earlier masks, centre line to road edge
spawn_distance = 50                     # decided, from where the path leaves the entrance
exit_distance = 40                      # decided, from where the path enters the exit

[map.1]
starting_coins = 20                     # notes
early_bonus = 0.1                       # guess
wave_count = 8                          # guess
monster_share = [30, 25, 20, 15, 10]    # guess
spawn_interval = 1.0                    # proto, seconds between spawns
path_half_width = 17                    # measured from the earlier masks, centre line to road edge
spawn_distance = 50                     # decided, from where the path leaves the entrance
exit_distance = 40                      # decided, from where the path enters the exit

[map.2]
starting_coins = 40                     # notes
early_bonus = 0.2                       # guess
wave_count = 10                         # guess
monster_share = [20, 20, 20, 20, 20]    # guess
spawn_interval = 0.8                    # proto, seconds between spawns
path_half_width = 16                    # measured from the earlier masks, centre line to road edge
spawn_distance = 50                     # decided, from where the path leaves the entrance
exit_distance = 40                      # decided, from where the path enters the exit

[map.3]
starting_coins = 60                     # notes (the sheet says 50)
early_bonus = 0.3                       # guess
wave_count = 12                         # guess
monster_share = [15, 15, 20, 25, 25]    # guess
spawn_interval = 0.7                    # proto, seconds between spawns
path_half_width = 22                    # measured from the earlier masks, centre line to road edge
spawn_distance = 50                     # decided, from where the path leaves the entrance
exit_distance = 40                      # decided, from where the path enters the exit

# map0: draft, made from the monster shares; coin value grows with the wave number

[[map.0.wave]]   # wave 1, 4 coins
monsters = { m0 = 2, m1 = 1 }

[[map.0.wave]]   # wave 2, 7 coins
monsters = { m0 = 5, m1 = 1 }

[[map.0.wave]]   # wave 3, 10 coins
monsters = { m0 = 3, m1 = 2, m2 = 1 }

[[map.0.wave]]   # wave 4, 14 coins
monsters = { m0 = 7, m1 = 2, m2 = 1 }

[[map.0.wave]]   # wave 5, 17 coins
monsters = { m0 = 6, m1 = 2, m2 = 1, m3 = 1 }

[[map.0.wave]]   # wave 6, 20 coins + boss 30
monsters = { m0 = 5, m1 = 1, m2 = 1, m3 = 1, m4 = 1, b0 = 1 }

# map1: draft, made from the monster shares; coin value grows with the wave number

[[map.1.wave]]   # wave 1, 4 coins
monsters = { m0 = 4 }

[[map.1.wave]]   # wave 2, 8 coins
monsters = { m0 = 4, m1 = 2 }

[[map.1.wave]]   # wave 3, 12 coins
monsters = { m0 = 5, m1 = 2, m2 = 1 }

[[map.1.wave]]   # wave 4, 17 coins
monsters = { m0 = 6, m1 = 2, m2 = 1, m3 = 1 }

[[map.1.wave]]   # wave 5, 21 coins
monsters = { m0 = 5, m1 = 3, m2 = 2, m3 = 1 }

[[map.1.wave]]   # wave 6, 25 coins
monsters = { m0 = 7, m1 = 4, m2 = 2, m3 = 1 }

[[map.1.wave]]   # wave 7, 29 coins
monsters = { m0 = 7, m1 = 3, m2 = 2, m3 = 1, m4 = 1 }

[[map.1.wave]]   # wave 8, 33 coins + boss 50
monsters = { m0 = 7, m1 = 3, m2 = 2, m3 = 2, m4 = 1, b1 = 1 }

# map2: draft, made from the monster shares; coin value grows with the wave number

[[map.2.wave]]   # wave 1, 6 coins
monsters = { m0 = 6 }

[[map.2.wave]]   # wave 2, 12 coins
monsters = { m0 = 6, m1 = 3 }

[[map.2.wave]]   # wave 3, 18 coins
monsters = { m0 = 8, m1 = 5 }

[[map.2.wave]]   # wave 4, 24 coins
monsters = { m0 = 7, m1 = 4, m2 = 3 }

[[map.2.wave]]   # wave 5, 30 coins
monsters = { m0 = 5, m1 = 2, m2 = 3, m3 = 3 }

[[map.2.wave]]   # wave 6, 36 coins
monsters = { m0 = 6, m1 = 2, m2 = 2, m3 = 2, m4 = 2 }

[[map.2.wave]]   # wave 7, 42 coins
monsters = { m0 = 7, m1 = 3, m2 = 3, m3 = 2, m4 = 2 }

[[map.2.wave]]   # wave 8, 48 coins
monsters = { m0 = 7, m1 = 4, m2 = 3, m3 = 3, m4 = 2 }

[[map.2.wave]]   # wave 9, 53 coins
monsters = { m0 = 7, m1 = 5, m2 = 4, m3 = 3, m4 = 2 }

[[map.2.wave]]   # wave 10, 59 coins + boss 70
monsters = { m0 = 7, m1 = 5, m2 = 4, m3 = 3, m4 = 3, b2 = 1 }

# map3: draft, made from the monster shares; coin value grows with the wave number

[[map.3.wave]]   # wave 1, 6 coins
monsters = { m0 = 6 }

[[map.3.wave]]   # wave 2, 13 coins
monsters = { m0 = 7, m1 = 3 }

[[map.3.wave]]   # wave 3, 19 coins
monsters = { m0 = 9, m1 = 5 }

[[map.3.wave]]   # wave 4, 26 coins
monsters = { m0 = 6, m1 = 4, m2 = 4 }

[[map.3.wave]]   # wave 5, 32 coins
monsters = { m0 = 7, m1 = 5, m2 = 5 }

[[map.3.wave]]   # wave 6, 38 coins
monsters = { m0 = 5, m1 = 4, m2 = 3, m3 = 4 }

[[map.3.wave]]   # wave 7, 45 coins
monsters = { m0 = 7, m1 = 3, m2 = 4, m3 = 5 }

[[map.3.wave]]   # wave 8, 51 coins
monsters = { m0 = 4, m1 = 2, m2 = 3, m3 = 4, m4 = 3 }

[[map.3.wave]]   # wave 9, 58 coins
monsters = { m0 = 5, m1 = 2, m2 = 3, m3 = 4, m4 = 4 }

[[map.3.wave]]   # wave 10, 64 coins
monsters = { m0 = 6, m1 = 3, m2 = 4, m3 = 4, m4 = 4 }

[[map.3.wave]]   # wave 11, 71 coins
monsters = { m0 = 6, m1 = 3, m2 = 3, m3 = 5, m4 = 5 }

[[map.3.wave]]   # wave 12, 77 coins + boss 100
monsters = { m0 = 7, m1 = 4, m2 = 4, m3 = 5, m4 = 5, b3 = 1 }