PvP bots under mods
모드 가이드는 게임에 포함된 그대로 영어로 작성되어 있습니다.
When a PvP lobby is short of players, the host's game fills the empty seats with bots and plays them itself. A bot is numbers, not a second game: its maze as cells, its towers as damage per second along the route, its insects as distances walked. It reads every rule through the active balance profile, so a mod's numbers reach it by themselves, and it plays the mod TD kit's rules too (below). The rule for lobbies is:
- Vanilla, or cosmetic mods only: bots fill the seats as usual.
- A gameplay mod: no bots, unless the mod enables them in a
bots.jsonwith"enabled": true. - Several gameplay mods: each must enable bots, or there are none.
Without bots the lobby simply waits for players, as before bots existed.
Every sample gameplay mod ships a bots.json (owner, 10/10: "always give every mod that supports multiplayer its bots.json"). Give your mod one too when it plays in PvP.
What the bots play
Besides the vanilla rules (prices, health curves, rewards, cards and their worm, the factory, the barrack, sabotage), a bot plays:
| Mod rule | What the bot does |
|---|---|
waves.json types and list | Its waves spawn the written groups after their delay, each insect with its type's health, shield, speed, reward, kind, cloak and leak cost. |
Layers (children) | A popped insect leaves its children on its spot. |
immune / resist | Its towers' hits go by the tower's weakness group, as a player's do. |
cloaked_waves | Camouflage as enemy_visibility rules it: the roster (detection_towers) or the detection level sees; with shared_detection an insect inside any detector's range is open to every tower. In the three waves before camouflage comes it covers 60% of the route with spotters (the cheapest roster tower that sees from level 1). |
Upgrade paths | It buys tiers in place by damage per gold, plus the gold a farm tier returns over the waves left and camouflage sight when camouflaged insects are coming. Damage, rate, range, splash, sight and the level model follow the towers' own rules (Scripts/tower_paths.gd). |
income / income_add | Paid at each wave's end. |
A level's ammo | The tower fires only while the bot's factory has that ammunition; the factory makes it from debris, the scarcest kind first, and the bot saves for that line once something it has or may buy fires on ammunition. |
A level's soldiers, "fires": false | A barracks never shoots; its soldiers hold walking insects at the route point nearest it, trade blows and come back after respawn. |
allies.hero and allies.abilities | The hero holds three quarters of a fixed route and heals while idle. A strike goes where the most insects stand; reinforcements go just ahead of an insect past half its way. |
run_start, towers.disabled, cards.enabled | It opens what the run opens (all of it, the barrack and the stock with unlock_everything), never a retired tower, and takes no card when they are off. |
scenarios.json tiles and routes | It builds only where the tiles allow, beside an authored route, and follows a stage change. Flyers walk the route when enemies.flyers_follow_route says so. |
cores | Its lives are cores: its insects at the cave take one and walk home, a killed carrier drops it, a dropped core drifts back and a passing insect takes it; a carrier that gets home costs one life. |
route_growth (a living route) | It opens on its own shortest way and grows it after each of its waves around its own towers, with the game's rule (Scripts/living_route.gd). |
What it does not model: weather's tower effects, fusion, elemental links, the cockpit and the barrier. A mod that rests on those still works with bots, but they will not use them.
bots.json
{
"version": 1,
"enabled": true,
"card_values": {
"dmg_plus": 70,
"money_plus": 10
},
"blueprints": [
{"id": "my_short_lane", "skill": 0.0, "cells": [[15, 4], [14, 8], [16, 4]]},
{"id": "my_long_maze", "skill": 0.6, "cells": [[14, 3], [15, 4], [16, 4]]}
]
}
| Key | Meaning |
|---|---|
enabled | true lets bots play under this mod. Missing or false means no bots. |
card_values | Optional. A card id's worth to a bot, replacing the built-in value. The stock values run from about 3 (a card the bot does not use) to 95 (the Collector with worm wrecks on the board); damage is 58. The worm's risk is still subtracted. |
blueprints | Optional. Replaces the stock mazes (Data/bot_blueprints.json): ordered tile cells a bot builds its towers on, in that order, so put first the cells that already reach the insects' way. A bot of strength s (0..1, from the players' levels) draws among the entries with skill <= s + 0.05, not one the last four bots drew, a strong bot leaning to the entries with a higher path_tiles (the finished route's length, optional). A mod's mazes are built as written; only the stock ones are mirrored or turned upside down. When a maze is used up, or a cell is not buildable, the bot falls back to cells beside the route. |
The stock mazes are drawn for the stock pit. A mod with its own board should give its own, or an empty list ("blueprints": []): then a bot on an authored route builds beside it, and a bot on open tiles builds its own maze, each tower where the whole board would fire longest on the insects' new way. The Tidal Coast, Traditional path, Banana Brigade, Iron Kingdom and Living Trail samples do that.
Later mods in the load order override earlier ones: the last blueprints list wins, and card_values merge key by key.
Only gameplay mods are read. A cosmetic mod plays on the vanilla profile, where bot matches earn XP, so its bots.json is ignored: a mod cannot make the bots easier without filing itself as a gameplay mod.
bots.json does not make a mod a gameplay mod by itself. Like every json file, it is part of the mod's content hash, so players in one lobby run the same copy.
How the bots time their moves
It buys towers and upgrades and picks a card every wave, with the same prices, offers and worm a player has. It also times its moves:
- Fire per gold. Every tower, upgrade and path tier is weighed by the fire it adds: damage per second times the length of the insects' way within reach, a wall by what its new way adds to every tower's reach.
- The flyers' line. Before a flyer wave it expects (after the gap between the ones it has seen), it builds along the straight nest-to-cave line, unless the mod's flyers follow its route (
enemies.flyers_follow_route). - The cave's door. Once its maze stands it keeps three cheap towers' worth of gold for an insect about to reach the cave.
- The worm's gaps walled. A wreck in its maze is walkable and blocks building until a Collector takes it, so the bot walls the gap beside it with its cheapest tower, where that gives the insects back the most way.
- The worm's wrecks first. It places a Collector over any wreck no Collector reaches before buying anything else, and rebuilds each hole once the cell is clear.
- Production when safe. With the barrack, a troop recipe and a Collector it buys assemblers, but only while it has lives to spare and its maze holds.
- Troops at the right moment. It holds what it makes and sends it together when a rival plays a boss wave or is low on lives.
- Sabotage at the right moment. A sabotage is worth most just before a rival's boss, weighed against the worm's 70-90% risk.
The design and its measurements are in docs/features/2026-10-09/pvp-bots/README.md; the mod kit's are in docs/features/2026-10-10/td-mod-kit/README.md. Scenes/Maps/bot_mods_check.tscn checks the bots under any mod you enable for it. Scenes/Maps/bot_balance_sweep.tscn reads a mod's difficulty through bots playing its campaign alone, and Scenes/Maps/bot_fidelity_check.tscn measures the bot model against the real game on the mod's board; trust a sweep where the fidelity check agrees (docs/balance/2026-10-10-mod-samples/README.md).
A gameplay mod plays on its own profile, which stays at level 1: no level reward's starting gold or damage reaches it. Give your mod a starting gold (general.starting_gold, multiplayer.starting_gold) that its first rounds need.
