WIKI

Mods

Rules and balance

Rules live in JSON files beside mod.json, and each one is a patch: write only the values you change. The _vanilla_reference folder in your Mods folder holds the game's own copy of each, with every key and the shipped numbers; look a key up there instead of guessing its name. Any of these files makes your mod a gameplay mod.

  • balance.json: the game's numbers (towers, money, enemies, cards, skill costs, weather, game modes).
  • map_data.json: the skill tree's nodes and the rubble on the board.
  • tower_data.json: the towers themselves, on your own towers.
  • material_data.json: the factory's materials and recipes.

Tower numbers

Each level's numbers live under towers.stat_overrides, by tower and level:

{
  "towers": {
    "stat_overrides": {
      "Gun": {"1": {"damage": 40, "range": 260, "price": 15}}
    },
    "accuracy": {"Gun": 0.9, "Sniper": 1.0},
    "accuracy_miss_spread": 32
  }
}

Use this path for a tower's final numbers: the balance has the last word over a number written in tower_data.json. towers.accuracy is each projectile tower's or fusion's chance to hit, from 0 to 1; a miss still lands within accuracy_miss_spread and can hit whoever is there.

Money, lives and difficulty

{
  "general": {"starting_gold": 100, "starting_lives": 20},
  "multiplayer": {"starting_gold": 100},
  "difficulty": {"levels": {"2": {"health_mult": 1.3}}}
}

economy holds the rewards and the towers' upkeep, enemies the waves' health, speed and numbers, bosses the bosses, and difficulty.levels each difficulty's multipliers, from "1" to "3".

Cards

  • cards.pool holds the card groups (bonus_cards, feature_cards, tower_cards, recipe_cards…). A group you write replaces the game's whole group.
  • cards.pool_add adds cards by id, or replaces the game's card with that id, without restating the group, so several mods can add side by side:
    {"cards": {"pool_add": {"tower_cards": [{"id": "unlock_bunker", "rarity": "rare", "min_wave": 20}]}}}
  • cards.effects holds each card's strength, and cards.exclude lists card ids to keep out of the draw.
  • "cards": {"enabled": false} removes the cards altogether: the next wave starts straight away.

Skill tree

The nodes are PurchasableStats in map_data.json. Each has a value, a limit of ranks, a minLevel, a dependency (the node before it, or null) and an icon. Point a node's icon at a picture in your folder ("Assets/skill_dmg.png") to change it; a node that opens a tower you replaced shows your model by itself. The final costs, limits and minimum levels come from skill_tree in balance.json.

How a run starts

{
  "general": {"starting_gold": 10000, "starting_lives": 99},
  "cockpit": {"unlimited_time": true},
  "run_start": {
    "unlock_everything": true,
    "all_materials": 999,
    "materials": {"debris": 9999},
    "player_level": 99,
    "skill_points": "all"
  }
}
  • unlock_everything opens every tower and feature from the first wave.
  • all_materials gives that stock of every material, and materials sets single ones.
  • player_level (up to 99) and skill_points: "all" raise your mod's own profile, so its skill tree can be bought.
  • cockpit.unlimited_time takes the cockpit's stopwatch away.

A Continue keeps what its run was given. All resources does all of this.

Which towers play

{
  "towers": {"disabled": ["Collect"], "upgrades_need_skills": false},
  "run_start": {"towers": ["Gun", "Cannon", "MachineGun"], "cockpit": true},
  "factory": {"tower_material_mult": 0}
}
  • towers.disabled: towers that never appear. Without the Collector the factory stays closed.
  • towers.upgrades_need_skills: false: levels 2 and 3 no longer wait for their skill-tree node.
  • run_start.towers and run_start.cockpit: open from the first wave.
  • factory.tower_material_mult: 0: towers cost money only, to build and to upgrade.

Traditional path plays this way.

Rubble

{"MapCoords": {"rubble": {
  "initial_min": 3, "initial_max": 10, "blocks_enemies": false,
  "removal": {"natural": {"trips": 4, "trip_time_scale": 1.0}, "wreck": {"trips": 1, "trip_time_scale": 1.0}}
}}}

In map_data.json: how many rock piles a new run scatters (0 for none), whether the towers' wrecks block the insects as rock does, and how many Collector trips a pile takes (1 to 32; trip_time_scale stretches each trip). A difficulty can have its own scatter, or an exact layout of piles that is the same on every seed, under difficulty.levels in balance.json:

{"difficulty": {"levels": {"1": {"rubble": {"layout": [{"x": 12, "y": 6, "variant": 0}]}}}}}

Factory materials and recipes

material_data.json merges your materials and recipes over the game's; copy the shape of an entry from the reference copy. Then:

  • null removes a material, a recipe or a tower's cost: "biological": null.
  • A material's name and description may be texts by language: {"en": "Rifle rounds", "pt_br": "Balas de fuzil"}.
  • A recipe's default_cap raises its default stock limit, max_stock holds it to a number, and requires_tower keeps it shut until that tower's card.
  • A new material gets a counter in the top bar; "hud_row": 1 puts it in the first row.
  • factory.recipe_output_multipliers in balance.json makes a recipe yield more per batch: {"factory": {"recipe_output_multipliers": {"ammo_2": 2}}}.
  • Fusions pay tower_fusion.cost_materials in balance.json.

A new material can have its own cargo model, Factory/Items/<material>. Towers can also fire only on the factory's ammunition: see your own towers. Factory ammunition rebuilds the factory this way.