annotate doc/roadmap.md @ 1:5492efd60e2c

first prototype + updated art sheet
author ark
date 2026-10-18 14:50 +0200
parents 7af9dd4e2595
children 3dd5b745fa08
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
1 roadmap
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
2 -------
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
3
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
4 steps in order. each ends with something that runs and can be looked at.
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
5
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
6 1. build basics
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
7 - directory layout, config/game.toml with the values from balance.md
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
8 - build script: sprites, tower level split and fill, map copies,
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
9 config.js
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
10 - check: the processed tower levels look right
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
11 2. maps and routes
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
12 - mask classification, placement grid, route extraction, routes.toml
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
13 corrections
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
14 - previews in temp/preview/
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
15 - check: routes on all four maps follow the paths, placement grid looks
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
16 sensible
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
17 3. map and walking monsters
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
18 - index.html, main loop, scaling to the window, map drawing
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
19 - monsters walk their routes with hop animation and route preference
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
20 - check: hop and squash feel; speeds against path lengths
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
21 4. waves and hearts
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
22 - wave timing, countdown, early start and bonus, hearts, win and loss
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
23 5. towers
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
24 - shop, placement with snapping and preview, targeting, projectiles,
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
25 damage, hp bars, coin drops and flying coins
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
26 - first playable version of map0
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
27 6. tower details
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
28 - upgrades, selling with the pause refund rule, t0 melee and spike sides,
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
29 t2 slow, boss with its bar
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
30 7. game flow
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
31 - title and map selection, unlocking, localStorage, restart
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
32 8. tuning on all maps
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
33 - wave lists for maps 1-3, playtesting, balance changes in config only
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
34 9. supplied art and sound
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
35 - icons, screens and digits as the drawings arrive (art.md)
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
36 - voice recordings as they arrive (sound.md)
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
37 10. publishing
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
38 - publish script, www/, dist/ zip, hosting for tablet play
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
39
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
40 debug switches (architecture.md) are added as each step needs them, starting
7af9dd4e2595 initial art and design/planning docs
ark
parents:
diff changeset
41 with step 3.
1
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
42
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
43
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
44 prototype notes
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
45 ---------------
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
46
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
47 decisions taken while building steps 1-5 that the other documents do not
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
48 cover. values marked proto in config/game.toml refer to this list.
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
49
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
50 build:
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
51
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
52 - runs on python 3.11 or later with pillow; numpy is not used. a full build
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
53 takes about 5 s, most of it in the mask step
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
54 - a step is skipped when its outputs are newer than its inputs and the build
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
55 scripts. the mask step also reruns when the placement settings in
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
56 game.toml change; it keeps its result in temp/build/maps.json for the
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
57 checks and previews
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
58 - map images are written as jpeg, quality 88. the maps have no transparency
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
59 - tower strips are split at columns without pencil. pencil is anything darker
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
60 than luminance 225. outline gaps of up to about 4 pixels are closed before
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
61 the fill. the white paper edge outside the outline fades to transparent
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
62 - the empty part of the hp bars is a darkened copy made by the build
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
63 (hpm_empty, hpb_empty)
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
64 - sprite sizes go into config.js, so the game knows them before the images
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
65 load
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
66 - mask pixels count when at least half opaque, and take the class of their
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
67 strongest colour. entrance or exit areas under 50 pixels are ignored
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
68 - the placement test draws discs around the path edge instead of keeping a
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
69 distance for every pixel. the result is the same. edge_distance applies to
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
70 the tower centre
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
71 - the centre line runs through the entrance and exit areas, so routes start
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
72 and end inside them. dead ends shorter than 0.8 path widths are dropped.
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
73 junctions closer together than 0.75 path widths count as one
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
74 - map2 has three loops (the round one at the top left, two squares at the
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
75 bottom). each leaves the path at a junction and comes back to the same
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
76 junction, so the rule "no junction twice" would never walk them. a route
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
77 may walk such a loop once. of its two directions, the one that turns less
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
78 is kept. map2 gives 8 routes, all kept; map1 gives 3
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
79 - route smoothing: moving average over 17 points, applied twice, then
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
80 simplified to 0.8 pixel tolerance
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
81 - straightness for the route value is the least turning of the map's routes
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
82 divided by the route's turning. turning is the total, not per length
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
83 - routes.toml names routes by their number in the build output. the numbers
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
84 change when a mask changes
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
85 - measured path widths are lower than in balance.md (map1 38, map2 38, map3
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
86 46) because the centre line length includes the entrance and exit areas.
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
87 map0's route is 2020 long
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
88 - the coin check compares all coins dropped, boss included, with 10 x
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
89 starting coins
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
90 - the build prints the early start bonus for skipping every break, including
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
91 the one before the first wave: 8, 21, 53, 94. balance.md gives 6, 17, 45,
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
92 82, which leaves that break out. the game pays the bonus before the first
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
93 wave too. to decide
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
94
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
95 config:
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
96
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
97 - per map: [map.N] holds starting_coins, early_bonus, wave_count and
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
98 monster_share, followed by the [[map.N.wave]] lists
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
99 - added: hit_radius in [animation] (0.4 of the monster sprite's smaller
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
100 side), min_weight in [route_preference] (the "at least 0.1" of the rule),
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
101 [art.angle] and [art.pivot]. t1 turns around the middle of its box, not
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
102 the middle of the image; the pivots for levels 1-5 are set by eye
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
103 - draft waves: monster counts per level from the coin shares. each level is
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
104 spread over the waves by the coin budget still open, with wave n worth n
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
105 shares. higher levels start later: m1 after 15 % of the waves, m2 35 %, m3
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
106 50 %, m4 65 %. groups hold at most 5 monsters and alternate between
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
107 levels. spawn interval 1.0 s on maps 0 and 1, 0.8 s on map2, 0.7 s on
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
108 map3. 2 s between groups, 4 s before the boss. totals: 102, 199, 398, 600
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
109 coins
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
110
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
111 game:
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
112
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
113 - scripts share the namespace object MM. audio.js and storage.js are not
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
114 written yet
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
115 - the simulation runs on wall clock time: at 60 frames per second, 2x gives
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
116 two steps per frame. at most 4 steps per frame and speed step; a longer
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
117 frame drops the rest
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
118 - there is no title or map selection yet. the game starts on
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
119 debug.start_map. the won and lost screens offer a restart only
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
120 - a break starts when all monsters of the wave are gone, killed or escaped,
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
121 not when the last one has spawned. during a break the wave counter shows
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
122 the next wave
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
123 - monsters move at constant speed; the hop is drawn only. a hop spends 80 %
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
124 of its time in the air and 20 % landing. the idle bob is a slow breathing
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
125 (1.3 s) on top of the hops, as monsters never stand still
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
126 - route choice weighs all routes of the map. on map2 this also picks the
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
127 entrance
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
128 - "furthest along" means the least distance left to the exit. a monster is in
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
129 range when its centre is. projectiles hit on reaching the target's hit
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
130 radius. a new tower attacks at once
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
131 - turning towers face their target at once and keep the last direction when
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
132 idle
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
133 - t0's melee attack is in place, since without it t0 does nothing. it draws
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
134 spikes on all four sides and pushes them out for 0.3 s. spike sides, t2
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
135 slow, upgrades, selling and the boss bar are left for step 6; the boss uses
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
136 hpm for now
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
137 - placement: a tap within the footprint radius or 28 css pixels of the
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
138 preview builds. the shop choice is cleared after building, and a second tap
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
139 on the chosen shop button cancels it. a tap on a built tower selects it and
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
140 shows its range. a refused tap shows a red cross for 0.5 s. shop buttons
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
141 the player cannot afford are dimmed and do nothing
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
142 - flying coins: one sprite per coin, at most 8, started 0.05 s apart, flying
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
143 in game time on an arc. they are dropped when the map ends
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
144 - placeholder icons: c0 for coins, m0 for waves, a drawn heart, one triangle
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
145 per game speed step (digits for debug speeds), a skip icon with countdown
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
146 and bonus for the early start. the top bar needs about 500 css pixels of
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
147 width; narrower screens are not handled
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
148 - debug switches: all from architecture.md except unlocking maps, which waits
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
149 for step 7. start_coins -1 means the map's own value, seed 0 a new seed per
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
150 run
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
151 - towers at scale 0.25 are small: t1 level 1 is about 43 x 30 map pixels.
5492efd60e2c first prototype + updated art sheet
ark
parents: 0
diff changeset
152 worth a look with the hop and squash check of step 3