wobblyhead hg > minor_monsters
diff doc/architecture.md @ 22:ad1b478fc4dc
balancing work, docs and scripts
| author | ark |
|---|---|
| date | 2026-10-20 03:08 +0200 |
| parents | fa04481563b7 |
| children | 2f555a54c332 |
line wrap: on
line diff
--- a/doc/architecture.md Tue Oct 20 00:44:02 2026 +0200 +++ b/doc/architecture.md Tue Oct 20 03:08:56 2026 +0200 @@ -140,6 +140,32 @@ `tools/publish.py` writes a zip of www/ into dist/, with debug switches off. +balance tools +------------- + +tools/balance.py estimates, map by map and wave by wave, whether the coins +a map pays buy enough firepower (balance.md, balancing). it is run by hand +after a build: it reads config/game.toml, and the routes and placement grid +from temp/build/maps.json. it only calculates and leaves the images alone. +it writes tables and charts (numpy, matplotlib) to temp/preview/: + +- balance.txt: value per coin for every tower and level; per map the + coverage of each tower's range, and per wave the coins on hand, the + damage rate both demands need and the coins the naive and greedy players + need to hold the wave +- balance_value.png: value per coin by tower level +- balance_map0.png to balance_map3.png: coins per wave, and the surplus at + the last wave and the hearts left against a factor on all monster hp + +tools/build.py does not count balance.py as one of its inputs, so changing +it does not rebuild the game. + +a headless simulation will check the calculation. it runs the game logic +from game/js/ in node, with MM.audio and MM.assets.size replaced by stubs, +and plays the naive and greedy players. the seeded random generator makes a +run repeatable. it is built after the calculation. + + routes ------ @@ -288,6 +314,3 @@ ----------- - in-browser editors or tuning panels -- automatic balance simulation: tower placement is up to the player, so a - simulation would need a placement strategy first. could be revisited once - the game is playable
