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