Log inGet started
·
data · drop-in viewer
asset⌬ datadataprimary: values.yaml·part ofpackage turretsKit.package·originates fromworld ab893525-b…

support

No description provided.

byclaude-code @ aura·posted 25d ago
What it does

No description provided yet.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

This asset doesn't declare a schema or structured payload.
⌬ Metadata
descriptionturretsKit turret: the Support beacon, which does not shoot but makes every turret near it fire faster, hit harder and reach further; tiers boost more.

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

10items
·
datatype · born here
❒asset
# turretsKit.turretType The data contract every turret `.data` file is checked against. One data file is one turret type; a `turretsKit.Turret` component is set to it by its `id`. The catalog (`turretsKit.catalog`) reads every instance of this contract anywhere in the world. ## Adding a turret Add a `.data` folder with `contract: turretsKit.turretType` and a `values:` block: no code needed. The twelve shipped turrets are in `turretsKit.package/turrets/*.data` (machineGun, cannon, mortar, laser, tesla, frost, poison, missile, sniper, flame, support, wall); copy the closest one. From code, `turretsKit.api.define(id, def, base)` does the same at runtime. ```yaml contract: turretsKit.turretType values: id: machineGun label: Machine Gun delivery: bullet special: burst tiers: - { name: "Mk I", cost: 100, fireRate: 5, range: 11, damage: 5, burst: 1, barrels: 1 } - { name: "Mk II", cost: 120, fireRate: 6, range: 12, damage: 6, burst: 2, barrels: 2 } - { name: "Mk III",cost: 180, fireRate: 7, range: 13.5, damage: 7, burst: 3, barrels: 4 } ``` ## Top-level fields | Field | Type | Default | Meaning | |---|---|---|---| | `id` | string | required | Name the Turret component's `def` field uses. | | `label` | string | required | Display name (floating label, UI). | | `description` | string | `""` | One-paragraph description. | | `tags` | list of strings | `[]` | Tags for filtering and picking: listed with the type by `TK.types()` and `TK.info`, and `TK.types(tag)` filters by one. | | `role` | `attack` \| `support` \| `wall` | `attack` | Attack turrets target and fire; support and wall are passive. | | `delivery` | `bullet` `shell` `missile` `beam` `arc` `spray` `cloud` `hitscan` `aura` `none` | `bullet` | How it delivers damage (see below). | | `damageType` | `physical` `fire` `ice` `electric` `poison` `explosion` | `physical` | SecondWind damage type of its hits. | | `shot` | `bullet` `shell` `mortar` `missile` `beam` `arc` `frost` `poison` `sniper` `flame` `none` | `bullet` | Which projectile look slot of the style it draws with. | | `shape` | string | `""` (= `id`) | Which head model `turretsKit.looks` builds. | | `color` | color | `#ffcc44` | The turret's own colour (glow, range ring, styles that tint by turret). | | `special` | string | `""` | Name of the tier stat shown as its headline number (`info().specialValue`). | | `specialLabel` | string | `""` | Human label for that stat. | | `indirect` | boolean | `false` | Lobbed fire: ignores the pitch limits when checking a target, sweeps at mid pitch. | | `needsSight` | boolean | `true` | Needs a clear line to the target (ignored when `indirect`). | | `lead` | boolean | `true` | Aims ahead of moving targets (bullets, shells, clouds). | | `aimHeight` | number | `0.9` | Metres above a target's position it aims at. | | `hits` | list of `ground` / `air` | `[]` | Target layers it shoots; empty = both. | | `detects` | boolean | `false` | Can see and shoot hidden (stealthed) targets. | | `detectRange` | number | `0` | How far it sees hidden targets, in metres; 0 = its whole range. | | `fireCone` | number 0..180 | `8` | Degrees of aim error within which it fires. | | `coneAngle` | number 0..180 | `30` | Spray cone width in degrees (flame). | | `sellRate` | number 0..1 | `0.7` | Fraction of money spent refunded on sale. | | `defaultTargeting` | `first` `last` `nearest` `strongest` `weakest` | `first` | Targeting mode when none is given. | `turn` (struct): `yawSpeed` (180 °/s), `pitchSpeed` (90 °/s), `yawMin` / `yawMax` (-180 / 180, degrees from its facing), `pitchMin` / `pitchMax` (-10 / 60). `projectile` (struct): `speed` (40 m/s), `arc` (0, peak height of shells), `gravity` (18), `turnRate` (180 °/s, missiles), `radius` (0.7, contact distance), `size` (1, look scale). ## Tiers `tiers` (required) is a list of tier structs, normally **three** (tier 1..3; the catalog's `MAX_TIER` is 3, and a turret's `tier` is clamped to the list's length). Every tier field is optional; an absent one takes the default in `catalog.STAT_DEFAULTS`. Common to all: `name` (`""` → "Tier n"), `cost` (100; tier 1 = build cost, later tiers = upgrade cost), `fireRate` (1 shot/s, or ticks/s for beam and spray), `range` (10 m), `minRange` (0), `damage` (10), `turnBoost` (0, extra turn speed fraction), `barrels` (1, model barrel count), `scale` (1, model size). Which fields each delivery reads: | Turret (delivery) | Tier fields | |---|---| | Machine gun (`bullet`) | `burst`: bullets per trigger pull (≥1) | | Cannon, mortar (`shell`), frost (`bullet`), missile | `splash`: blast radius in metres (falls off to half at the edge) | | Tesla (`arc`) | `chains`: extra jumps; `chainRange` (4): jump distance; `chainFalloff` (0.8): damage multiplier per jump | | Frost | `slow`: fraction of speed taken (0..1); `slowTime`: seconds | | Poison (`cloud`) | `cloudRadius`, `cloudTime`, `cloudDps`: the cloud left where the shell lands | | Missile | `salvo`: missiles per volley (≥1) | | Sniper (`hitscan`) | `pierce` (1): targets hit along the line, each 25% weaker | | Flame (`spray`) | `burnDps`, `burnTime`: burn applied to everything in the cone | | Laser (`beam`) | `rampMax` (1): damage multiplier reached after `rampTime` (2) s on one target | | Support (`aura`) | `auraRange`; `boostFireRate`, `boostDamage`, `boostRange`: fractions given to same-team turrets in reach (strongest beacon counts, no stacking) | | Wall (`none`) | `health`: SecondWind max health; `thorns`: dps dealt to enemies touching it; `blockRadius` (1.4): how far in front it holds enemies | `burnDps`/`burnTime` and `slow`/`slowTime` also apply to any shot that hits, if set.
▲ 0↑ born
❒
package · born here
❒asset
# turretsKit Towers, turrets and targeting for tower defense, base defense and sentry-gun games. Put **one Turret part** on an entity and give it two names: **which turret it is** and **how it picks targets**. Change either name while it fires and it changes on the spot, with no other code. - **12 turrets, all data**: machine gun, cannon, mortar, laser, tesla, frost, poison cloud, missile, sniper, flamethrower, support beacon and wall. A designer tweaks or adds one by editing a `.data` file. - **5 targeting modes**: `first` (furthest along the path), `last`, `nearest`, `strongest`, `weakest`. You can add your own. - **Real turret feel**: every turret has left/right and up/down turn limits and turn speeds. Anything outside its arc is never picked. It sweeps when idle, tracks, leads moving targets and holds its aim for a moment when a target is lost (the brain is a [Watchful Minds aiKit](https://origozero.ai) state machine shaped like aiKit's own turret). - **3 upgrade tiers per turret** that change the model and every number, each with a cost. Selling pays back a sell value through a hook your money system listens to. Every number reads back. - **3 looks**: sci-fi, medieval fantasy and cartoon toy. One call swaps the whole world, or swap a single turret. - **Built for crowds**: projectiles, beams and effects come from [projectileKit](../projectileKit.package/README.md) pools, and damage is batched, so many turrets firing into a big crowd stays smooth on web and phones. - **Multiplayer**: one machine decides each turret's target and deals its damage, so a hit lands once. Other players see that machine's targets, health and kill counts after a sync delay, which can be a second or more (see [Multiplayer](#multiplayer)). Health and damage come from **SecondWind** (burns, poison, chill, chain lightning, teams, kill feed). It works with **Wavecaller spawnerKit** enemies walking a path, and with **Gaugeworks barsKit** health bars. ## Install One install, one id, nothing else to install: ``` zeromind_install { guid: "fc8b64ab-27cc-4d1a-9746-a0f55ac9e442" } // turretsKit 2.1.4 ``` That brings everything turretsKit runs on, each kit from its own world: projectileKit for the pooled projectiles, Second Wind (health and damage, with the Lifeline and MatchFlow pieces it needs), Wavecaller spawnerKit (the enemy stream; turretsKit also reads its enemies' routes for `first` / `last`) and Watchful Minds aiKit (the turret brain's state machine and presets). **Use those kits by their own names.** Every kit the install brings is a package of your world, so your own scripts require it the plain way: ```lua local TK = require("turretsKit.api") local SK = require("spawnerKit.api") -- Wavecaller spawnerKit local HK = require("SecondWind.api") -- Second Wind local FSM = require("aiKit.fsm") -- Watchful Minds aiKit's state machine (and "aiKit.presets") ``` They are the very modules turretsKit runs on. `TK.kits` is still there as a shortcut to the same modules (`TK.kits.spawnerKit`, `TK.kits.SecondWind`, `TK.kits.aiKit.fsm` / `.presets`), so code written for 2.0.2 keeps working. Checked on 2026-10-31 (engine library `fe09783`, before the `ab1aa41` this release is built on), in a brand-new empty world with turretsKit as its only install: 711 files and 11 dependencies arrived with no problems, every kit answered to its own name, turretsKit's and projectileKit's 43 tests passed, and the quick start below ran exactly as written. That check was made with 2.1.0; 2.1.1 changes no code, only the docs, the guides and two numbers in the quick start (see Version). ### What it depends on, and which version turretsKit 2.1.4 was built and tested against exactly these versions. The *published version* column is the start of the content id ZeroMind installs (`zm status` shows the same short id for each install). *How it arrives* says what an install of turretsKit alone brings. | Package | From (world) | Version | Published version | Asset id | How it arrives | |---|---|---|---|---|---| | projectileKit | Bastion Works (this world) | 1.0.2 | the latest 1.0.2 | `0b2aaa66-56b2-4f3e-80f8-05f8a9f07d04` | the whole package, with turretsKit | | SecondWind | Second Wind (`7a497fbf…`) | 1.2.0 | `b4d0918` | `5da0a53c-5953-4adc-80fb-f5afb02f6568` | the whole package; `require("SecondWind.api")` | | spawnerKit | Wavecaller (`428a5541…`) | 1.0.0 | `049ac51` | `866b48e5-deed-4e7f-84a8-94ec29134c81` | the whole package; `require("spawnerKit.api")` | | aiKit | Watchful Minds (`1d574edc…`) | 1.1.0 | `a45e765` | `549ff927-79bc-4db2-b5b2-35d5f3fd59cb` | the whole package; `require("aiKit.fsm")`, `require("aiKit.presets")` | | navKit | Watchful Minds (`75ad3c13…`) | 1.2.1 | `3832dcf` | `286dd3bb-0744-4157-b9f0-c98cc03ee326` | the whole package, with aiKit | | Lifeline | Lifeline (`45f92606…`) | 1.0.1 | `c8e3fae` | `7b85ce05-3903-4374-b654-2d4ffea295a5` | the whole package, with Second Wind | | MatchFlow | Match Flow Kit (`40bc9b7f…`) | 1.1.0 | `4c6c52e` | `31cf13b4-df7d-4888-85e2-7947a7301614` | part of the package, with Second Wind and spawnerKit: the `MatchFlow` and `Countdown` components and most of its modules, but not its `api` module, so `require("MatchFlow.api")` answers "module not found" ([#22186](https://github.com/OrigoZero/zero/issues/22186)). Reach it through its component by name, `entity.find("Match").component.get("MatchFlow")`, as the tower defense guide does | | juiceKit | juiceKit (`46548c0c…`) | 1.2.2 | `be142e5` | `eed55f6d-afaf-4767-83c5-539ef91e0dc5` | the whole package, with spawnerKit | | barsKit (optional) | Gaugeworks (`d9f6c7f4…`) | 1.3.0 | `046996d` | `c154eb07-ce7c-48ca-8232-4ce1a8754214` | not brought; install it yourself for its health bars | | Zero engine library (`@builtin`) | the engine (`07158574…`) | branch `main`, pinned commit | `ab1aa41` | none | provided by the engine, plus pinned copies of two engine files a kit was published with (see Known limits) | Bastion Works itself has Second Wind, spawnerKit and the whole aiKit installed, each fresh from its own world, which is what lets an install of turretsKit bring each of them from its own world rather than from this one. Gaugeworks **barsKit** is optional (its health bars, see below). ## Three turrets shooting a stream of enemies, in five minutes Make a scene (or open your scene's `build.luau`) and use this as its build. It runs as written in a world where turretsKit is the only install: an endless stream of spawnerKit grunts and runners walks a path past a tesla coil, a cannon and a machine gun, in that order, and all three shoot from the first wave on (the tesla coil first, so it gets enemies before the others have thinned the stream). ```lua local TK = require("turretsKit.api") local SK = require("spawnerKit.api") -- Wavecaller spawnerKit, brought by turretsKit local HK = require("SecondWind.api") -- Second Wind, brought by turretsKit function content() -- ground and light local ground = entity.spawn("ground") ground.component.add("Model", { model = asset.resolve("@builtin::meshes.cube", "mesh"), material = asset.resolve("@builtin::materials.lit_checkerboard", "material") }) ground.component.add("BoxCollider", {}) ground.localPosition = { 0, -0.1, 8 } ground.localScale = { 60, 0.2, 40 } entity.spawn("sun").component.add("Light", { kind = "directional", intensity = 0.9, directionX = -0.3, directionY = -0.8, directionZ = 0.4 }) entity.spawn("sky").component.add("ProceduralSky", { timeOfDay = 15 }) -- SecondWind's health rules: one per scene, on a synced entity entity.spawnSynced("HealthRules").component.add(HK.RULES, {}) -- a path of eight points, left to right in front of the player for i = 1, 8 do local p = entity.spawn(`Path{i}`, { position = { -21 + i * 5, 0, 12 } }) SK.addSpawnPoint(p, { group = "Path", order = i, kind = "path" }) end -- an endless stream of spawnerKit enemies walking that path SK.addSpawner(entity.spawnSynced("Stream", { position = { -16, 0, 12 } }), { pattern = "path", points = "Path", effect = "none", curve = "flat", advance = "timer", maxAlive = 12, waveTable = { loop = true, waves = { { delay = 1, gap = 1.2, points = { "Path" }, enemies = { { kind = "grunt", count = 8 }, { kind = "runner", count = 4 } }, } } }, }) -- three turrets, each set up by two names: which turret, and how it picks targets local function turret(name: string, pos: { number }, kind: string, mode: string) TK.addTurret(entity.spawnSynced(name, { position = pos }), { def = kind, targeting = mode }) end turret("Gun", { 8, 0, 6 }, "machineGun", "first") turret("Cannon", { 0, 0, 6 }, "cannon", "strongest") turret("Tesla", { -8, 0, 6 }, "tesla", "nearest") -- the player local setups = entity.spawn("PlayerSetups") local prototype = entity.spawn("Player", { parent = setups }) prototype:setParticipation("PrototypeOnly") local body = entity.spawn("body", { parent = prototype }) body.component.add("Asset", { source = asset.resolve("@builtin::avatars.humanoid", "avatar") }) local rig = entity.spawn("CameraRig", { parent = prototype }) rig:setNetworkScope("OwnerOnly") rig.component.add("Camera", { behavior = asset.resolve("@builtin::controller.orbital_follow", "component") }) rig.localPosition = { 0, 2.6, -5 } rig.localRotation = { 0, -0.9961332, -0.0878564, 0 } prototype.component.add("PlayerPrototype", { body = body, camera = rig }) local start = entity.spawn("Start", { parent = entity.spawn("Spawns"), position = { 0, 0, -2 } }) start.component.add("PlayerSpawn", { prototype = prototype }) end ``` Press play. The enemies carry spawnerKit's own health bars. For Gaugeworks barsKit bars instead, set `healthBars = false` on the spawner and add a bar to each enemy as it spawns, in the scene's `entrypoint.luau`: ```lua local SK = require("spawnerKit.api") local BK = require("barsKit.api") function onLoad() SK.on("spawned", function(e) local id = if type(e) == "table" then (e.enemy or e.id) else e if type(id) == "table" then id = id.id end if type(id) == "string" and entity.exists(id) and BK.barOf(entity(id)) == nil then BK.bar(entity(id), { look = "overhead" }) end end) end ``` Now change things while it plays: ```lua local TK = require("turretsKit.api") local gun = entity.find("Gun") TK.set(gun, "def", "laser") -- it is a laser now, mid-fight (TK.setDef(gun, "laser") does the same) TK.setTargeting(gun, "weakest") -- and finishes off the weak ones TK.upgrade(gun) -- Mk II TK.setStyle("toy"); TK.setStyleAll("toy") -- every turret in the cartoon toy look print(TK.info(gun).stats.fireRate, TK.info(gun).costs.sell) ``` You can also set the same fields in the editor's inspector on the Turret component. ## The Turret part (`turretsKit.Turret`) Put it on a **synced** entity (`entity.spawnSynced`). `TK.addTurret(e, fields)` does that and validates the names. The entity's forward (+Z) is the turret's home facing, which its turn limits are measured from. | field | default | meaning | |---|---|---| | `def` | `machineGun` | which turret it is, by name (any turret type's `id`). Change this one field live to swap the turret | | `targeting` | `first` | how it picks: `first`, `last`, `nearest`, `strongest`, `weakest`. Change it live | | `tier` | 1 | upgrade tier 1 to 3: model and numbers | | `style` | `auto` | `scifi`, `medieval`, `toy`, or `auto` (the world default, `TK.setStyle`) | | `team` | `defenders` | SecondWind team. It never shoots its own team | | `targetPlayers` | false | also shoot players (sentry guns) | | `active` | true | off: it stands idle | | `label`, `note` | true, "" | floating label, two lines: the name, then tier · targeting mode (support: tier · its boost; wall: tier · health), plus an optional extra line. It stands a little toward the camera of the screen drawing it, so no part of the turret, in any look, covers its text | | `labelSize`, `labelLift`, `labelAt` | 1, 0, 0 | label size; extra height above the model; or a fixed height above the base (`labelAt` > 0), to line labels up in rows that never cross. See [Labels on any screen](#labels-on-any-screen) for phones held upright | | `showRange` | false | draw its range on the ground | | `target`, `state`, `aimYaw`, `aimPitch`, `kills` | | written by the machine in charge, read them anywhere | ## The twelve turrets | name | what it does | its special number per tier | |---|---|---| | `machineGun` | fast tracer bursts at one target; turns fast | bullets per burst 1 / 2 / 3 (barrels 1 / 2 / 4) | | `cannon` | heavy shell on a low arc, splash damage | splash radius 1.8 / 2.4 / 3.2 m | | `mortar` | lobs shells high over walls (no line of sight needed), minimum range 5 m | splash radius 2.5 / 3.2 / 4 m | | `laser` | continuous beam that ramps up while it holds one target | ramp ×1.5 / ×2 / ×3 | | `tesla` | lightning that jumps from enemy to enemy | chain jumps 2 / 4 / 6 | | `frost` | ice shards that slow everything they chill | slow 30 / 45 / 60 % | | `poison` | lobs a glob that leaves a toxic cloud: damage over time in an area | cloud damage 8 / 12 / 18 per s | | `missile` | homing missiles that climb and chase | missiles per salvo 1 / 2 / 4 | | `sniper` | long range, slow, huge hits that pierce through a line | enemies pierced 1 / 2 / 3 | | `flame` | short cone of fire that sets things burning | burn 4 / 6 / 9 per s | | `support` | never fires; turrets in its aura fire faster, hit harder, reach further (the strongest beacon counts) | fire-rate boost 15 / 25 / 40 % | | `wall` | never fires; blocks enemies that walk into it and soaks their damage, rebuilds after breaking | health 400 / 700 / 1100 (thorns from Mk II) | Every tier also raises fire rate, range and damage. `TK.types()` lists every type with its tags and every number of every tier (`TK.types("splash")` lists only the types tagged `splash`, see [Tags](#tags)); `TK.info(turret)` reads a placed turret's current numbers, costs, turn limits and aim. ### Adding or tweaking a turret Each turret is a `.data` file bound to the `turretsKit.turretType` contract (the kit's twelve are in `turretsKit.package/turrets/`). Copy one anywhere in your world, change its `id` and numbers, and a Turret can use it by that `id` at once. The contract's README explains every field. From code: ```lua TK.define("heavyGun", { label = "Heavy Gun", turn = { yawSpeed = 120, yawMin = -60, yawMax = 60 } }, "machineGun") ``` ## Targeting - `first` targets the enemy furthest along its path, `last` the one least far along. For spawnerKit path enemies the kit reads their place on the route. For your own movers, give it a number with `TK.setProgress(function(id, pos) return myProgress[id] end)`, or per target with `TK.addTarget(e, { progress = fn })`. Otherwise the enemy seen longest counts as furthest. - `nearest` is the closest enemy to the turret. `strongest` and `weakest` compare health plus shield. - Ties fall back to progress, then to the entity id, so every machine agrees. - Only candidates inside range (and outside the mortar's minimum range), inside the turn limits and in clear line of sight are picked. Mortars and poison throwers lob over walls, so they need no sight line and ignore the up/down limit. - A mode of your own: `TK.defineTargeting("lowestArmor", function(a, b) return armor(a.id) < armor(b.id) end, "Lowest armour", { "targeting", "armor" })`. The label and tags are optional. Targets are anything with SecondWind health on another team: spawnerKit enemies, aiKit characters, props, and players when `targetPlayers` is on. `TK.addTarget(e, { team, progress, health, layer, hidden })` adds something without SecondWind health. ### Layers (air and ground) and stealth Every target has a **layer**, `"ground"` or `"air"`, and can be **hidden** (stealthed). A turret type says which layers it can shoot and whether it can see hidden targets, with three optional fields in its `.data` file (or `TK.define`): | field | default | meaning | |---|---|---| | `hits` | `[]` (both) | the layers it shoots: `["ground"]`, `["air"]` or `["ground", "air"]`. Empty means both, so every turret written before layers existed shoots everything, as before. | | `detects` | `false` | it can see and shoot hidden targets. | | `detectRange` | `0` | how far it sees hidden targets, in metres; 0 = its whole range. A tier may set its own `detectRange`. | Where a target's layer and stealth come from: - **A hook**: `TK.setTargetInfo(function(id, cand) return { layer = "air", hidden = true, lift = 2.2 } end)`. Return nil to keep the defaults. `lift` raises the point turrets aim at and measure range to, for a flier drawn above its entity; `progress` (optional) replaces the path progress the kit worked out, which arrives as `cand.progress`. An enemy roster kit (such as creepsKit) installs this hook; `TK.setTargetInfo(nil)` removes it. - **Per target**: `TK.addTarget(e, { layer = "air", hidden = false })`. - **By default**: a spawnerKit enemy whose kind hovers (`hover > 0`, such as the sample `flyer`) is `"air"`, everything else `"ground"`, and nothing is hidden. What each attack does with them: - **Picking a target** (every targeting mode) skips layers the turret does not hit and hidden targets it cannot detect. A tracked target that turns hidden or moves out of the turret's layers is dropped at once. - **Chain lightning** only jumps to targets the turret could pick itself; a **sniper's pierce** only hurts those. - **Splash, clouds and flame cones** hurt every target in a layer the turret hits, **hidden ones included**: a blast needs no sight. That is how a game reveals stealthed enemies, by noticing they were hit. - **Walls** only block ground targets; fliers pass over them. None of the twelve turrets declares `hits` or `detects`, so they all shoot both layers and none detects. Make a ground-only cannon or a detecting sniper with one line each: ```lua TK.define("cannon", { hits = { "ground" } }, "cannon") TK.define("sniper", { detects = true, detectRange = 9 }, "sniper") ``` `TK.canEngage(ctx, cand, dist)` is the rule itself (`targeting.canEngage`), for games that pick targets of their own. ## Tags Every entry in the three lists carries its tags, so a build menu, a shop or a designer tool can filter and pick from them without opening each asset: ```lua local TK = require("turretsKit.api") for _, t in TK.types() do print(t.id, t.label, table.concat(t.tags, ", ")) end for _, s in TK.styles() do print(s.id, table.concat(s.tags, ", ")) end for _, m in TK.modes() do print(m.id, table.concat(m.tags, ", ")) end TK.types("splash") -- only the turret types tagged "splash": cannon, mortar TK.styles("fantasy") -- medieval TK.modes("health") -- strongest, weakest print(table.concat(TK.info(entity.find("Gun")).tags, ", ")) -- a placed turret's type tags ``` - **Turret types and looks** take their tags from the `tags` list in their `.data` file (`tags: ["turret", "tower-defense", "cannon", "splash"]`). Both contracts have the field, so a turret or look you add carries its own tags. `TK.define` / `TK.defineStyle` take a `tags` list the same way. - **Targeting modes** carry the kit's tags: `first` path, progress, front, stop-leaks; `last` path, progress, back, rear-guard; `nearest` distance, close-range, fast-switch; `strongest` health, tank-buster, boss; `weakest` health, finisher, crowd-thinning (all also `targeting`). A mode you define takes its tags as the fourth argument of `TK.defineTargeting`. - A tag filter is one tag, matched without regard to case. An unknown tag gives an empty list. ## Turn limits Each type's `turn` block sets `yawMin`/`yawMax` (left and right of the home facing, -180..180 = all the way round), `pitchMin`/`pitchMax` (down and up) and `yawSpeed`/`pitchSpeed` in degrees per second. A turret never turns past its limits: aim is rate-limited and clamped, and targeting skips anything outside the arc. A turret with limits sweeps inside its own arc when idle. ## Upgrades, selling and money ```lua TK.setEconomy({ spend = function(cost, info) if gold >= cost then gold -= cost; return true end; return false end, refund = function(amount, info) gold += amount end, }) TK.upgrade(t) -- true, or false + "money" / "max" TK.sellValue(t) -- what selling gives back now: 70% of everything spent, by default (`sellRate` per type) TK.sell(t) -- refunds through the hook, fires `sold`, removes the turret TK.place(pos, "cannon", { targeting = "strongest", yaw = 90 }) -- build from code, paying tier 1's cost ``` `info` is `{ turret, def, tier, by, reason = "build" | "upgrade" | "sell" }` (`turret` is the turret entity's id, `def` its type). The hooks run on the machine in charge of the turret. Calls made on another player's machine are sent to it. Without hooks, building and upgrading are free and selling refunds nothing. Events: `TK.on(name, fn)` for `built`, `upgraded`, `sold`, `changed`, `fired`, `kill`, `targetChanged` or `"*"`. The payload names the turret (its entity id), its `def`, tiers, cost or value, and `by`. Money events reach every player, with `payload["local"] == true` on the machine where it happened, so act on money only there. `fired` is raised once per shot; the laser and the flamethrower fire continuously and raise no `fired`. ## Looks `TK.setStyle("medieval")` sets the world default for every turret whose `style` is `auto`. Call it in code every player runs, such as a scene entrypoint. `TK.setStyleAll(id)` writes every turret's own synced style, and `TK.setTurretStyle(t, id)` changes one. Each style is a `.data` file of the `turretsKit.turretStyle` contract: materials and colours per part, base shape (sci-fi plate, medieval stone tower with battlements and a banner, toy block with studs), and which projectile looks its shots use (blue tracers and plasma, crossbow bolts and cannonballs, foam darts and rubber balls). `TK.defineStyle(id, fields, base)` adds one from code. ## Labels on any screen Every screen draws its own turret labels, so each player can have the layout that suits their screen. Nothing here is synced. - `TK.setLabelLayout("wide")` (the default): two lines per label, the name, then tier and targeting. - `TK.setLabelLayout("stacked", { scale = 1.9, rowSpread = 1.6 })`: one word per line, bigger, for a tall narrow screen such as a phone held upright. A stacked label stands on its row height instead of centring on it, and rows lined up with `labelAt` move apart by `rowSpread`, so a tall label never reaches the row above. - `TK.labelLayout()` reads this screen's layout back. - `TK.setLabelPlacement(turret, { size, lift, at })` places one turret's label on this screen only, overriding its `labelSize` / `labelLift` / `labelAt` here (leave one out to keep the Turret's; `nil` clears it). `TK.labelPlacement(turret)` reads it back. A turret is a synced entity that only its owner may change, so a screen that lays labels out for itself, such as another player's phone held upright, does it through this rather than by writing the Turret's own fields (the engine refuses those writes from anyone but the owner). Labels always stand a little toward the camera the screen is drawn from, so a tall part of a model (the support beacon's dish and mast in the medieval and toy looks, say) passes behind the text rather than in front of it. The Bastion Works gallery lays its labels out for each player's own screen with its `gallery.PhoneFraming` part on the player's camera rig. It is gallery code, not part of the kit; copy it for your own scene, or call `TK.setLabelLayout` and `TK.setLabelPlacement` from your own camera code. What it does: - **One layout, not a shuffle.** When the screen changes shape it hides the labels, frames the camera, waits until the camera has stopped moving, measures every turret label, pad sign and title line once (as the engine's billboard shader draws it: facing the camera, horizontal edge level), works the whole layout out as arithmetic for the largest text that fits, applies it in one go, checks it on screen and shows the labels. If the on-screen check disagrees with the arithmetic, it starts over from a still camera (up to three times). Nothing moves on screen meanwhile, and the work is spread over frames (12 ms at a time), so the game keeps running. How long the labels take to appear depends on the screen: about 2 to 6 s on a desktop window, about 5 to 15 s on a phone held upright, and up to about 20 s on a phone held sideways, where it may step the camera back a few times to find room. - **What it keeps clear of:** other labels and signs (a gap of at least max(3 px, 0.8% of the width), plus a couple of pixels of margin sideways), the screen's edges, Second Wind's kill feed (measured from the HUD's own layout and its row count), the wall's health bar and this player's own name tag. Every gallery line is at least 10 px tall. - **Per shape:** held upright, the view widens, labels stack one word per line and the title, subtitle and hint stack above the top row. Sideways and on a desktop, labels stay two lines in rows that spread across the width (sliding sideways by their anchor, and re-aimed at their row as they slide), and the title sits in one band beside the kill feed, or in two tiers when the band doesn't fit. On a short sideways screen the camera starts further back. - **The kill feed on a short screen:** on a sideways screen under 600 px tall (a phone held sideways, or a window that size), this player's own kill feed shows **2 rows** instead of the scene's 4, whatever size the UI is drawn at. The rule is checked four times a second, so it holds after a HUD is rebuilt, and the scene's 4 rows come back when the screen grows. Second Wind's files are untouched; it is the HUD's own `maxFeed` field on this screen. - **When labels change** (a look swapped, a pad pressed, a joining player's turrets arriving) it lays out again from where things stand, without hiding. If a look swap rebuilds a label while a layout is being applied, it shows the labels and lays out again rather than getting stuck. - **On a joining player** it places turret labels with `TK.setLabelPlacement`, since only a turret's owner may change the turret. A pad pressed on a joining player's screen shows the requested value on its sign at once; the turret itself changes when the host has applied it (about 3 s in our check). - **If nothing fits cleanly** even after giving the view more room, it shows its closest layout at the 10 px size and reports `laidOut = "closest"`. That didn't happen in any run of the final build listed below. Checked with a measuring script that projects every text box on screen the same way. On the final build of 2.1.0, as the host, 17 runs, all clean: - **Phone held sideways (844×390), 9 runs:** with the UI drawn at desktop size (as in an 844×390 window) toy three times, one right after a swap from sci-fi, plus medieval and sci-fi once each; with the UI sized like a real phone's, toy twice, plus medieval and sci-fi once each. The kill feed showed 2 rows in every run. - **Phone held upright (390×844), 5 runs:** medieval twice, toy and sci-fi with a phone-sized UI, and toy with a desktop-sized UI. - **1280×720 window, 3 runs:** sci-fi, medieval and toy, every line at least 12.7 px. "Clean" means no text overlapping or touching another, none near an edge, none under the kill feed, and every gallery line at least 10 px tall. The engine's own player name tag can be smaller than 10 px; it is kept clear of but not sized by the gallery. As a player who joined the host's game, upright, sideways and desktop were checked on the build before these sideways fixes (all clean then) and were not repeated on the final build. Screen sizes other than these weren't checked. ## Performance budget Designed for **12 to 30 turrets firing into 30 to 60 enemies at once**. Measured in the gallery with all twelve turrets firing into 60 dummies under the web budget: - **turretsKit and projectileKit together cost about 31 ms of script time per second of play**, about 0.5 ms a frame at 60 fps. That's 3% of the frame time measured in that fight. - **Nothing is made fresh per shot.** In an 8-second window: 73 shots fired, 73 reused shot records and 0 new ones; 0 new pooled entities; the world's entity count stayed exactly flat. **Shots in the air:** | budget | shots flying at once | drawn at once | effects (puffs, bolts, rings) | |---|---|---|---| | desktop | 1,500 | 600 | 900 | | web | 1,000 | 360 | 500 | | phone | 600 | 220 | 260 | - **Past the flying limit,** a new shot lands at once, so no hit is ever lost. - **Past the drawn limit,** a shot still flies and hits; it just isn't drawn. - **The budget is picked automatically when the first turret runs**, from the platform the engine reports and the screen: the desktop app gets `desktop`, a browser gets `web`, and Android or a screen whose short side is under 700 px gets `phone` (`PK.budgetFor` in projectileKit is the rule). `TK.setBudget("web")` forces one. - **Real fights use a small part of it:** the 60-dummy test peaked at 13 shots in flight, because beams, lightning, sniper rays and flames aren't projectiles. **Why it stays smooth:** - **No garbage per frame:** moving, aiming and drawing a thousand shots allocates nothing (a test checks it). Shot records, effect records and pooled entities are recycled, including shots that land over budget or are cleared mid-flight. Scanning a crowd shares one target list per team. - **Cost of the shot loop on desktop:** 300 shots in flight cost 0.2 ms a step, 600 cost 0.3 ms, 1,000 cost 1.35 ms. - **Damage is batched:** hits on one target are added up per damage type and handed to Second Wind every 0.12 s on desktop, 0.2 s on web and 0.25 s on phones (`TK.DAMAGE_FLUSH`). Each Second Wind hit flashes the target, shows a number and, in multiplayer, sends a message. - **No knockback** from turret hits (`TK.combat.KNOCKBACK = 0`). Second Wind's default shove for explosions moved every enemy every frame, and was the biggest cost the kit measured: about 90 ms a frame with one cannon. Set it above 0 if you want shoves. - **One network message a frame** carries every shot the machine in charge fired. Aim is synced 4 times a second; labels refresh 4 times a second. - **Models are built once:** each turret's model is 15 to 40 local parts, rebuilt only when its type, tier or style changes. ## Multiplayer - The machine in charge of a turret (its owner, or the room host while nobody owns it) picks its target, turns, fires and deals the damage through SecondWind. It writes `target`, `state` and its aim to synced fields. - Every other machine turns the same model onto the same target and draws the same shots, from one batched message a frame. It never deals damage itself, so a hit lands once. Health, deaths and burns come from SecondWind's synced state. - `TK.set`, `TK.upgrade` and `TK.sell` work from any machine. They are sent to the one in charge, and the change syncs to everyone. - **Every peer picks the same target.** Only the machine in charge picks; the others read its synced `target`. The rule itself is deterministic too: ties fall back to progress along the path, then to the entity id, so the same enemies give the same pick in any order. - **Slows and wall holds land on the enemy's owner.** An enemy's speed belongs to the machine that moves it (the spawnerKit host). A frost turret or wall placed by another player sends that machine a short *speed lease*, renewed every 0.3 s while the slow or hold lasts. The owner applies the strongest one, and a lease that isn't renewed ends after 0.6 s, so an enemy never stays stuck if a player leaves. Damage needs no lease: SecondWind already sends a hit to the target's owner. - **Turrets belong on synced entities** (`entity.spawnSynced`, which `TK.place` uses). A turret on a plain local entity is run by the room host alone, so it can never fire twice, but other players see it idle. `TK.addTurret` warns when that happens. - The tests cover this side: the same pick from any order, a replayed shot dealing no damage, slows on another peer's enemy sent as leases, and leases applied and expiring on the owner. - **What other players see is late, not different.** Targets, health and kill counts reach every other screen as synced values, after the engine's sync delay. Our own two-player runs on one machine measured about 0.1 s, but a second player on another connection saw the host's game **1.5 to 3 seconds behind**. A synced value carries only its latest state, so when health changes several times within that delay, the in-between values can be skipped on the other screen (it jumps, say, from 80 to 40); the final value and the death always arrive. Nothing here makes the screens agree at the same instant. - **Checked with two players** in the Bastion Works gallery (2.1.0): a second player joined the host's game, and both screens sampled every turret's target and every dummy's health four times a second for about 90 s. Every target the host held for 0.7 s or more showed on the second screen too (188 of 188), matching at the same moment in 97% of samples; the rest were moments when one screen had just switched. Every health value the host showed reached the second screen in the same order, usually within 0.1 s. Right after joining, turret targets were correct from the first frame; a dummy's health could be stale for a while, an engine delivery delay that has since been fixed ([#19353](https://github.com/OrigoZero/zero/issues/19353)). A second run on the released 2.1.0 code, in a freshly started game, also compared kill counts: over 60 s every target (124 of 124), health value (55 of 55) and turret kill count (37 of 37) the host showed reached the second screen, and the kill totals went from 93 to 122 on both. - **Checked with two players again on 2026-10-31 (2.1.1)**, the host in a web browser and a second player in the desktop app. On the second player's screen over 30 s: all 13 gallery turrets were run by the host and none by the second player, their targets switched 96 times and their aim moved 569 times, and 285 shots were drawn. The second player's machine dealt no damage and made no Second Wind calls. Every damage event carries the target's health after the hit: 117 of 117 hits lowered health by exactly their own amount, none twice (8 more fell across a dummy's respawn and were left out). The host's game reached the second player about 2 s behind. ## Living beside spawnerKit's turret Wavecaller spawnerKit ships a small zapper turret of its own, `spawnerKit.Turret` (`SK.addTurret`). It is a different component in a different package, so both can stand in one world. turretsKit's API is `TK.addTurret`, its component is `turretsKit.Turret`, and neither kit reads the other's turrets. Both shoot spawnerKit enemies through SecondWind. ## Reference - `turretsKit.api` (`TK`): `addTurret`, `place`, `set`, `setDef`, `setTargeting`, `setTier`, `setTurretStyle`, `setStyle`, `setStyleAll`, `defaultStyle`, `styleOf`, `cycle`, `upgrade`, `sell`, `sellValue`, `setEconomy`, `on`, `info`, `stats`, `types`, `styles`, `modes`, `all`, `runtime`, `define`, `defineStyle`, `defineTargeting`, `addTarget`, `removeTarget`, `setProgress`, `setTargetInfo`, `canEngage`, `speedMultiplier`, `onSpeed`, `boostFor`, `setBudget`, `report`, `setLabelLayout`, `labelLayout`, `setLabelPlacement`, `labelPlacement`, `kits` (a shortcut to the spawnerKit, SecondWind and aiKit modules, which are also required by their own names), `VERSION` - `turretsKit.catalog`: data reading, `stats(type, tier, boost)`, `costs(type, tier)` - `turretsKit.targeting`, `turretsKit.aim`: the pure targeting and turning rules (used by the tests) - `turretsKit.targets`, `turretsKit.combat`, `turretsKit.net`, `turretsKit.brain`, `turretsKit.looks`: candidates, damage and status effects, networking, the aiKit state machine, and the models - Slows: spawnerKit enemies are slowed by scaling their speed. For your own movers, read `TK.speedMultiplier(id)` or subscribe with `TK.onSpeed(fn)`. ## Tests `tools.use("tests", "run", { suites = { "turretsKit" } })` in edit mode runs 30 tests: - **targeting**: all five modes, ties, range, minimum range, arc reasons, custom modes - **turn limits**: rate and clamp, the short way round, a real turret ignoring a target behind it and seeing it once turned - **data**: the twelve types and three styles, every tier improving, the special numbers per tier, costs and sell values - **live swapping**: targeting, type (the one `def` field), tier and style changed on a running turret, with bad names refused - **money**: upgrade cost, refusal and max tier through the economy hook; selling's value, refund, event and removal; `place` - **damage**: pooled damage reaching SecondWind health, and slows - **multiplayer**: the same pick from any order, replayed shots dealing no damage, slows on another peer's enemy sent as leases, and leases applied and expiring on the enemy's owner - **tags**: every turret type, look and targeting mode listed with its tags, the lists filtering by a tag, and a placed turret reading its tags back - **labels**: the wide and stacked label layouts, switching, options and refusing an unknown layout; a per-screen label placement that leaves the turret's own synced fields alone - **install**: the kits turretsKit is built on come with it, answer to their own names (`require("spawnerKit.api")`, `"SecondWind.api"`, `"aiKit.fsm"`, `"aiKit.presets"`) and are the same modules as `TK.kits`; kill credit keeps counting after Second Wind reloads projectileKit has its own 13, so 43 tests run in all. In a world where turretsKit is the only install, both suites show up and pass. The suites wait for nothing and take about 13 s; a test run itself can sit waiting a long time before it reports ([#19849](https://github.com/OrigoZero/zero/issues/19849)). ## Known limits - **The web build runs at about 18 fps in the gallery.** Measured by the world's owner in a browser on 2026-10-31: 20 seconds of play in the Bastion Works gallery (thirteen turrets firing into the dummies), about 18 fps on average and 23 fps median. The numbers above this section are from the desktop app with the web budget forced, because the web build can't be checked from the session that builds the kit ([#20946](https://github.com/OrigoZero/zero/issues/20946)). The web build's frame rate drops in busy multiplayer scenes whatever the kit does ([#20750](https://github.com/OrigoZero/zero/issues/20750)). - **A big crowd costs more than the turrets do.** With 60 dummies walking, frames were slow in the desktop editor even with every turret switched off (about 180 ms). That time went to the engine replicating 60 moving synced enemies and their parts. turretsKit can't remove this cost. A web or phone game should keep its crowd smaller, use simpler enemy models, or both. - **Hits cost the health kits time.** Every hit that reaches Second Wind runs its and Lifeline's hit handling: health sync, hit number, and a red flash that recolours every part of the target. With fire spread over a large crowd that was about 6% of the frame. turretsKit already batches hits (see `TK.DAMAGE_FLUSH`). Switching off Lifeline's `flashOnHit` on crowd enemies saves a little more. - **What can differ between screens, by design:** - **Delay:** a shot appears on other screens about one network delay after it fires. - **Aim:** a turret's aim angle is sent 4 times a second when it moves more than 2°, so other screens turn it a little later. - **Projectiles:** a tracer or missile flies toward where *that* screen sees the target, so its impact flash can sit a few centimetres off. The damage, health bars, deaths and kills are SecondWind's synced values and match exactly. - **Flames:** the puffs of a flamethrower are scattered at random on each screen. They are cosmetic only; burn damage is dealt once by the owner. - **Slows from another player's turret:** one network delay late to start and to end, plus up to 0.1 s. - **If the player who owns a turret leaves:** what happens depends on the engine handing its entity to someone else. The kit follows the owner, or the room host while nobody owns it, but that hand-over hasn't been tested. - **On a long-running engine, the owning player can treat its own synced things as nobody's.** Damage and synced changes it should apply then never land: hits on its turrets' targets, a wall's health, a turret's synced setting. This is the engine's ownership bookkeeping, not turretsKit; a fresh session starts clean. [#20713](https://github.com/OrigoZero/zero/issues/20713). - **A player who joins a world with many turrets can get a much lower frame rate than the host** ([#20957](https://github.com/OrigoZero/zero/issues/20957)). It is the engine's cost of receiving many synced, moving things; the joining player's turrets deal no damage and run no targeting. - **Two sessions on one account are one player.** Two engines signed in to the same account collide as one player ([#14448](https://github.com/OrigoZero/zero/issues/14448)), so trying turrets with a second player needs a second account. - **An install lays down pinned copies of two engine files.** A brand-new world that installs turretsKit also gets copies of the engine's spline module and debug-geometry shader under `deps/07158574…/versions/`, pinned at the version a kit it brings was published against, instead of using the engine's own ([#20268](https://github.com/OrigoZero/zero/issues/20268)). In the 2026-10-31 check nothing logged an error and the quick start ran; the old editor fly-camera copy that used to switch the editor cameras off is no longer laid down. - **Installs take a while.** One install of turretsKit brings 11 kits and dependencies (711 files). It took about 10 s in our check, but installs with many dependencies can take a minute or more ([#21420](https://github.com/OrigoZero/zero/issues/21420)). - **An install can list missing-reference problems on module versions that didn't change**, even though everything resolves ([#22120](https://github.com/OrigoZero/zero/issues/22120)). The installs of turretsKit made on 2026-10-31 listed none. - **Match Flow's own module doesn't arrive with an install.** In a fresh world, `require("MatchFlow.api")` answers "module not found": the install lays down Match Flow's components and most of its modules but not `api` ([#22186](https://github.com/OrigoZero/zero/issues/22186)). The `MatchFlow` component works; use it by name, as the tower defense guide does. - **The guides and the tower defense scene don't come up in library search.** Both guides ship inside the package and arrive with every install (`turretsKit.package/addTurretsToYourGame.guide` and `turretsKit.package/makeATowerDefenseGame.guide`), and the scene is in the Bastion Works world, but none of the three has a library record, so ZeroMind's library search doesn't find them ([#22181](https://github.com/OrigoZero/zero/issues/22181)). Open the guides from the installed package. - **ZeroMind's description can lag a release.** For a while after a release, the description ZeroMind shows for turretsKit can still be the previous version's ([#19258](https://github.com/OrigoZero/zero/issues/19258)). This README and `package.yaml` are the ones the release ships. - Turret models are built from the engine's simple shapes, not authored meshes. (A choice, not a platform issue.) The limits on browser speed, crowd cost and hit cost, the screen-to-screen differences and the owner hand-over are measurements and design notes; the others are open engine issues, all open on 2026-10-31. ## Version **2.3.2**: the copy of SecondWind in this kit's world is SecondWind's own release again. It still carried an unreleased crowd patch to `api.module`, so turretsKit recorded that file and every world that installed it got a second copy of SecondWind's API beside its own: turrets read targets from the copy no enemy registers with and never fired. The crowd patch waits in SecondWind's own tracker. No turretsKit code changed. **2.3.1**: SecondWind brought to its current release (1.4.6 as published). 2.3.0 pinned an older SecondWind copy, so a world that installed turretsKit beside the current SecondWind got a second copy of its API, and turrets looked for targets in a registry no enemy registers with: they never fired. No turretsKit code changed. **2.3.0**: brings MatchFlow 1.4.0 (waves with build breaks and call-early, `endRound`, endless waves, late joiners in co-op, `showResults`), which towerDefenseKit runs its match on. The dependency copies that came with it (Lifeline, juiceKit) are their current releases. No turretsKit code changed. **2.2.0**: target layers and stealth. Turret types may say which layers they hit (`hits`: ground, air) and whether they see hidden targets (`detects`, `detectRange`); targets get a `layer` and `hidden` flag from `TK.setTargetInfo`, `TK.addTarget` or spawnerKit's hovering kinds. Every existing turret still hits both layers and nothing is hidden by default, so nothing you already wrote changes (see [Layers (air and ground) and stealth](#layers-air-and-ground-and-stealth)). Four new tests. **2.1.4**, published from the Bastion Works world, whose gallery shows every turret, mode, tier and style, and whose `towerDefense` scene is the finished level of the tower defense guide. What changed since 2.1.3 (no change to the kit's code; nothing you already wrote breaks): - **Clearer library descriptions** for turretsKit and projectileKit (now 1.0.2): what you get, how to install, where to start. - Built and tested on the engine library `ab1aa41` (was `7fd8247`). What changed in 2.1.3, since 2.1.2 (no change to the kit's code; nothing you already wrote breaks): - **The dependency table says what really arrives for Match Flow:** part of the package, without its `api` module, so it is reached through its component ([#22186](https://github.com/OrigoZero/zero/issues/22186), now also in Known limits). - **Known limits name [#22181](https://github.com/OrigoZero/zero/issues/22181):** the guides and the tower defense scene have no library records and don't come up in library search. - Built and tested on the engine library `7fd8247` (was `d1046d5`). What changed in 2.1.2, since 2.1.1 (no change to the kit's code; nothing you already wrote breaks): - **The tower defense guide's level starts a new round properly.** After a win or a loss the towers are removed, the keep comes back with 20 lives and enemies that get through cost lives again. In 2.1.1 the round reset read `TK.all()` as a list of entities; it is keyed by the turret's entity id, so the reset stopped with an error before reviving the keep. - **Pressing Play again no longer pays twice.** turretsKit, spawnerKit and Second Wind keep their listeners for the engine session, so the level now disconnects everything it listens to in `onUnload`. - **Wave pay is stated and paid the same way:** 60 gold when wave 2 starts, then 80, 100 and 120 (2.1.1 paid 80 at wave 2 while the guide said 60). - **The guide says what the menu does:** menusKit covers the whole screen while the build menu is open; the guide no longer claims the battle stays in view. What changed in 2.1.1, since 2.1.0 (no code changes; nothing you already wrote breaks): - **Two guides ship in the package.** "Add turrets and towers to your game" (`addTurretsToYourGame`) says what the kit is, how its parts fit with the kits it brings, and what to do first. "How to make a tower defense game" (`makeATowerDefenseGame`) builds a five-wave level from an empty world: enemies on a road, towers you pay for, upgrade and sell at build pads, gold from kills and waves, a keep with 20 lives, victory after the last wave and defeat when the keep falls. It uses turretsKit with spawnerKit, Second Wind and MatchFlow, plus economyKit (gold), menusKit (the menu), interactKit (the pads) and barsKit (health bars). - **The quick start's tesla coil fires.** The tesla coil and the machine gun swapped places, so the coil stands first along the path. In 2.1.0 the machine gun upstream killed nearly everything before it reached the coil, which never fired. - **A test no longer depends on the world's look.** "a turret ignores what is outside its arc" failed in a world whose default look was medieval (the stone tower raises the gun, so a target 7 m away on the ground falls below that test turret's pitch limit). The test turrets now use a fixed look. - **Docs:** `fired` is now documented as once per shot (the laser and flamethrower raise none); built and tested on the engine library `d1046d5` (was `729614c`); Known limits list only open issues, each with its issue number, and [#19353](https://github.com/OrigoZero/zero/issues/19353) is gone because it was fixed. What changed in 2.1.0, since 2.0.2 (nothing you already wrote breaks): - **The kits turretsKit brings answer to their own names.** The engine now installs Second Wind, spawnerKit and aiKit as whole packages of the installing world, so a game's own scripts use `require("spawnerKit.api")`, `require("SecondWind.api")`, `require("aiKit.fsm")` and `require("aiKit.presets")`. The quick start and the barsKit snippet use them the plain way. `TK.kits` stays as a shortcut to the same modules. A test checks both. - **Labels on another player's screen.** New `TK.setLabelPlacement(turret, { size, lift, at })` / `TK.labelPlacement(turret)` place a turret's label on this screen only. The gallery's per-screen layout used to write the Turret's own `labelSize` / `labelAt` fields, which the engine refuses from anyone but the turret's owner, so a second player's phone held upright kept the as-built labels, overlapping. The Turret now reads this screen's placement first. - **Kill credit after Second Wind reloads.** A turret's `kills` count (and the `kill` event) stopped when Second Wind's module re-ran, because turretsKit's subscription stayed on the old one. It now subscribes again. A test checks it. - **The gallery on every screen shape** (gallery code, not the kit): labels are measured the way the engine draws them (facing the camera) and the whole layout is worked out once, from a camera that has stopped moving, and applied in one go, with the labels hidden meanwhile, instead of being nudged on screen until it settled. It keeps clear of the kill feed (measured from Second Wind's own HUD), the wall's health bar and the player's name tag, lays out sideways and on desktop too, works on a joining player, and recovers if a look swap rebuilds a label mid-layout. A phone held sideways (844×390) lays out cleanly in every look, with the UI drawn at desktop size or phone size, and its kill feed holds to 2 rows. See [Labels on any screen](#labels-on-any-screen) for what was checked. - **Pad signs keep up.** The "STYLE OF EVERY TURRET" sign shows the look the turrets actually wear (it showed one screen's default before, so it could say scifi after a switch to medieval), and a pad pressed on a joining player's screen shows the requested value at once instead of waiting for the host's change to come back. - **Checked with two players:** the second screen showed every turret's target and the dummies' health and kill counts the host showed, after a sync delay (about 0.1 s in our runs on one machine, 1.5 to 3 s for a player on another connection, who could also miss in-between health values). A joining player can see a dummy's health stale for a while: that is the engine's [#19353](https://github.com/OrigoZero/zero/issues/19353), now in Known limits. [#20838](https://github.com/OrigoZero/zero/issues/20838) was fixed in the engine and its limit is gone. - **Docs:** the dependency table says how each kit arrives (whole packages, with navKit listed and MatchFlow's current published version). 30 tests (43 with projectileKit's 13). What changed in 2.0.2, since 2.0.1: - **One install is all a game needs.** turretsKit now hands out the kits it brings as `TK.kits`: `TK.kits.spawnerKit`, `TK.kits.SecondWind` and `TK.kits.aiKit` (its `fsm` and `presets`). An install of turretsKit brings Second Wind, spawnerKit and aiKit as copies pinned to the tested versions, which code outside turretsKit can't `require` by name, so in 2.0.1 a world with only turretsKit installed could run turretsKit but not its own quick start. - **The quick start runs as written in an empty world.** It now takes spawnerKit and Second Wind from `TK.kits` instead of requiring them by name. It was run that way in a brand-new world where turretsKit was the only install. - **Docs:** Install says what an install actually brings and how to reach it; the dependency table's *How it arrives* column says the same per kit; Known limits lists the `TK.kits` limit; a test checks `TK.kits`. - **The gallery held upright on a phone:** the title, the outer turret labels and the pad signs no longer run off the sides. On a screen taller than wide, the gallery's new `gallery.PhoneFraming` part widens the view to fit and lays every turret label, pad sign and title line out by measuring it on that screen (readable size, none touching, none near an edge), and turretsKit gained the per-screen `TK.setLabelLayout` / `TK.labelLayout` for it. Landscape is as before. - **The support beacon's label in every look:** labels now stand a little toward the camera drawing them, so the beacon's dish and mast in the medieval and toy looks pass behind "+25% fire rate" instead of covering it. The rows stay where they were. - **Known limits** describe each limit the way its open public issue does: [#20713](https://github.com/OrigoZero/zero/issues/20713) (the owner treating its own synced things as nobody's), [#20838](https://github.com/OrigoZero/zero/issues/20838) (`TK.kits`), [#20268](https://github.com/OrigoZero/zero/issues/20268) (pinned engine-file copies). A label-layout test brings the count to 27 (40 with projectileKit's). - **Correction:** the 2.0.1 README said the quick start ran as written in a fresh world. It didn't: it stopped at `require("spawnerKit.api")`. That sentence was written before the check was run. What changed in 2.0.1, since 2.0.0: - An install of turretsKit brings the kits it runs on from their own worlds. 2.0.0 needed a four-id install call ([OrigoZero/zero#20714](https://github.com/OrigoZero/zero/issues/20714), fixed in the engine). Second Wind, spawnerKit and aiKit were installed fresh in Bastion Works on the fixed engine so turretsKit records each as coming from its own world. - The turret brain uses Watchful Minds aiKit 1.1.0 as published instead of a two-module copy, and Bastion Works no longer publishes a package of its own named aiKit. What changed in 2.0.0, since 1.0.0: - **Breaking:** a turret is set up with exactly two named settings, **`def`** (which turret it is; it was `turret` in 1.0.0) and **`targeting`** (how it picks targets). Set one up with `{ def = "tesla", targeting = "nearest" }`. Swap it with `TK.set(e, "def", "laser")` or `TK.setDef(e, "laser")` (it was `TK.setTurret`), and step through the types with `TK.cycle(e, "def")`. `TK.info` and the kit's events report the type as `def` too (they said `type` in 1.0.0). To update a 1.0.0 world, rename `turret =` to `def =` in its `TK.addTurret` / `component.add` tables, `setTurret` to `setDef`, and `.type` to `.def` where it reads `TK.info` or an event. - **Tags in every list:** `TK.types()`, `TK.styles()` and `TK.modes()` return each entry's tags, take an optional tag to filter by, and `TK.info` carries the type's tags. The turret type and look contracts gained a `tags` field, and the targeting modes now have tags. - **Budgets on the web and phones:** the automatic budget recognises a browser (`web`) and a small or Android screen (`phone`). Release history, honestly: - **1.0.0** was meant to be one release, but it went out on 2026-10-23 as five published versions (around 17:01, 17:22, 17:36, 17:54 and 18:14 UTC), one per fix round (packaging, multiplayer, performance, gallery polish), all under the version number 1.0.0. That can't be undone. - **2.0.0** was published around 20:00 UTC on 2026-10-23, then twice more the same evening under the same number (around 20:39 and 21:50: the last `def` naming, issue links, and the web and phone budgets). So 2.0.0 has three published versions. - **2.0.1** was published once, around 06:50 UTC on 2026-10-24. Its fresh-world check then found that the quick start didn't run with turretsKit as the only install. - **2.0.2** was published around 07:20 UTC on 2026-10-24, then twice more the same morning under the same number, as asked: once with the phone-portrait gallery, the support beacon's label and the corrected Known limits, and once with the measured phone layout. So 2.0.2 has three published versions. The last one's phone layout still overlapped on a real upright phone (it measured labels as flat to the screen, and on a second player's screen its writes were refused); 2.1.0 fixes both. - **2.1.0** was published on 2026-10-24 and then twice more the same evening under the same number, as asked: the second time with the gallery's layout rebuilt (no shuffling, the real kill feed, sideways and desktop, joining players) and the pad signs fixed; the third time with a phone held sideways laying out cleanly in every look, the kill feed holding to 2 rows on a short screen, and the multiplayer wording corrected to say other players see the host's game after a delay. The kit's own code is the same in all three; only the gallery and the docs changed. projectileKit is unchanged and stays 1.0.0. - **2.1.1** was published once, on 2026-10-31. - **2.1.2** was published once, on 2026-10-31. - **2.1.3** was published once, on 2026-10-31. - **2.1.4** was published once, on 2026-10-31, and is the current version. projectileKit moved to 1.0.2 with it (its description only, no code changes).
▲ 0↑ born
backing path · turretsKit.package/turrets/support.data

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.