VTK Guard Drones

by VortiK

Persistent guard drones that follow the player, fight nearby enemies, and return to inventory on recall.

Content
6 days ago
2.1
17
Combat

Changelog

Version: 0.23.0
Date: 2026-06-27
  Bugfixes:
    - Fixed drones draining the roboport but never recharging (a v0.22 regression dropped the line
      that added the drained energy to the drone's battery). Recharge works again.
  Changes:
    - Disarmed drone marker is now the vanilla "low power" machine icon, and it is hidden while the
      drone is actively charging (the recharge glow shows instead) — shown only while flying back or
      when there is no roboport power.
    - Removed the abandoned ammo/reload system entirely: the Guard Drone Magazine item and recipe are
      gone, along with the dormant reload code and the v0.17 energy debug probe.
Version: 0.22.0
Date: 2026-06-27
  Changes:
    - Recharge sound is now the actual robot-charging hum (same robot-charging-*.ogg files robots use
      at a roboport), played continuously while a drone charges. Dropped the separate plug-in/unplug
      zaps. Visual glow + this hum together, like a logistic bot charging.
Version: 0.21.0
Date: 2026-06-27
  Changes:
    - Recharge FX now draw ON TOP of the drone (render layer "air-entity-info-icon"; were hidden
      behind the drone sprite).
    - Disarmed drones show the vanilla "no power / unplugged" icon (was the battery item icon).
    - Two distinct recharge sounds: a "plug in" zap when charging starts, an "unplug" zap when
      fully recharged (configurable via CHARGE_SOUND_START / CHARGE_SOUND_DONE).
Version: 0.20.0
Date: 2026-06-27
  Features:
    - Disarmed (out-of-power) drones now show a red "low battery" icon above them the whole time they
      are depleted, including while flying back to the player to recharge.
  Changes:
    - Recharge glow raised onto the drone body (was sitting below the drone).
    - Battery balance: consumption doubled (energy_per_tick 3->6kJ, energy_per_move 10->20kJ; ~28s
      idle autonomy) and recharge speed halved (RECHARGE_PER_SCAN 0.5->0.25MJ/scan).
Version: 0.19.0
Date: 2026-06-27
  Features:
    - Recharge illusion: a drone refilling its battery now shows the roboport's recharging spark glow
      (reused vanilla sprite) and plays a short electric zap when it finishes and re-arms. Toggle via
      CHARGE_FX in drone-manager.lua.
Version: 0.18.0
Date: 2026-06-27
  Features:
    - Battery system (replaces the abandoned reload). Drones carry a 10MJ battery the engine drains
      natively as they fly/fight (combat drains faster). At empty a drone disarms (hotswaps to its
      weaponless twin, truly can't fire) and flies back to orbit the player. There it recharges by
      DRAINING the player's personal roboport equipment, then re-arms once ~full. The battery charge
      is preserved across recall (no free refill). No charged roboport -> an "out of power" alert.
    - Energy probe from v0.17 turned off (ENERGY_DEBUG=false); kept for future debugging.
  Notes:
    - Recharge currently pulls only from personal roboport equipment; tune RECHARGE_PER_SCAN /
      ENERGY_* in drone-manager.lua (and max_energy in drone.lua, kept in sync). Charging visual/
      sound effect (like logistic bots) is planned next.
Version: 0.17.0
Date: 2026-06-27
  Experiment (temporary, debug):
    - Energy/battery test on the CANNON drone only: max_energy 2MJ, fast drain, slows to 20% when
      empty (no crash). A console probe (~every 2s) logs the drone's energy to check whether the
      engine actually applies energy to a combat-robot (docs say it shouldn't). Toggle off via
      ENERGY_TEST (drone.lua) and ENERGY_DEBUG (drone-manager.lua) once the question is settled.
Version: 0.16.0
Date: 2026-06-27
  Features:
    - Drones are now 100% fire-resistant (they fly): the flamethrower drone's ground fire no longer
      damages other drones or itself. (Note: the player is still flammable — see known limitation.)
  Changes:
    - Both drone recipes: destroyer-capsule 2 -> 1, plus 1 flying-robot-frame.
Version: 0.15.0
Date: 2026-06-27
  Features:
    - New "Drone Cannon" intermediate item (tank-cannon icon), crafted from steel/pipes/circuits/
      submachine-gun, and now required to build the cannon Guard Drone.
    - Composite item icons: tinted destroyer (blue cannon / yellow flamethrower) with a weapon
      badge in the bottom-right corner (cannon vs flamethrower).
    - Per-type target priority: the cannon drone steers toward the BIGGEST nearby enemy (focus big
      threats); the flamethrower drone steers toward the NEAREST enemy.
  Changes:
    - Flamethrower drone orbits much tighter (range_from_player 10 -> 4) so it closes in for
      short-range fire, and its fire origin is raised on the sprite.
Version: 0.14.0
Date: 2026-06-27
  Features:
    - New drone variant: Flamethrower Guard Drone (yellow). Uses the player flamethrower stream
      with a larger attack zone (range 22 vs cannon's 18). Separate item/recipe (unlocked by the
      same Guard Drones tech). NOTE: its fire is NOT friendly-fire-safe yet (vanilla stream burns
      all forces) — refine later.
    - Deploy now supports multiple drone types from inventory: fills up to the 5-drone limit,
      cannon first then flamethrower (mixing types). A "drone backpack" loadout is planned to
      replace this first-available selection.
  Changes:
    - Cannon drone: ROF reduced (cooldown 20 -> 30, ~2 shots/s) and HP doubled (400 -> 800).
    - Casing ejection: cannon now ejects a big artillery-style shell casing (custom particle,
      60s on-ground lifetime) instead of the small machine-gun casing.
Version: 0.13.0
Date: 2026-06-27
  Changes:
    - Reload/ammo mechanic disabled (RELOAD_ENABLED = false): too fragile (combat robots fire
      autonomously with no per-shot hook, so depletion can't be tracked accurately). Drones
      now have unlimited ammo again. Code and prototypes kept dormant for a possible redesign.
Version: 0.12.0
Date: 2026-06-27
  Features:
    - Out-of-ammo drones now hot-swap to a weaponless variant (range 0, desaturated tint),
      so they truly stop firing. They fly back to the player and only reload once close
      (RELOAD_RANGE), then re-arm. Closes the point-blank firing leak.
Version: 0.11.0
Date: 2026-06-27
  Features:
    - Reload mechanic: each drone has a 20-shot magazine that depletes while engaging.
      Empty drones return to orbit and reload from a Guard Drone Magazine item in the
      player's inventory; if none, a blinking "out of ammo" alert is shown.
    - New item Guard Drone Magazine (20 cannon shells -> 1 magazine), unlocked by the tech.
    - Health AND magazine are now preserved across recall (no free-refill exploit).
  Notes:
    - Combat robots have no native ammo or per-shot event, so depletion is a time proxy
      (while engaging). A fully-empty drone can still fire point-blank (native firing can't
      be disabled); ammo gates active hunting, not point-blank defense.
    - Dev-stage: a mod update now clears all deployed drones (clean state migration).
Version: 0.10.0
Date: 2026-06-27
  Features:
    - Aggression: each drone hunts the nearest enemy to itself, leashed to 50 tiles from the
      player; returns to orbit when none. Recall still overrides. Scan handler is dynamic
      (registered only while drones are deployed -> zero idle cost).
  Balancing:
    - Autocannon fire rate reduced to 3 shots/s (cooldown 20).
Version: 0.9.0
Date: 2026-06-26
  Features:
    - Experimental aggression: drones leave their orbit to engage enemies near the player
      (owner-swap test). Recall still overrides.
Version: 0.8.1
Date: 2026-06-26
  Balancing:
    - Autocannon now uses a dedicated ammo category: fire rate is FLAT (no ROF research
      scaling, no unrealistic cadence), while damage still scales with cannon-shell damage
      research (mirrored in data-final-fixes).
Version: 0.8.0
Date: 2026-06-26
  Features:
    - New weapon: explosive autocannon (replaces the destroyer beam). 4 shots/s, small
      blast radius, cannon-shell sound + muzzle flash. Distinct from the player's laser.
    - Friendly fire OFF: the blast never damages the player or their own drones (force = not-same).
Version: 0.7.0
Date: 2026-06-26
  Optimizations:
    - on_tick is now registered dynamically (only while drones are returning), so the
      mod has zero per-tick cost when idle. Re-established on_load from saved state.
Version: 0.6.0
Date: 2026-06-26
  Features:
    - Deploy/recall animation: drones now emerge from the player on deploy and fly
      back to the player on recall before despawning (item + saved health land on arrival).
Version: 0.5.0
Date: 2026-06-26
  Changes:
    - is_military_target is now permanent (drones correctly draw enemy aggro).
  Balancing:
    - Recipe adjusted: 2 destroyer-capsules + 10 low-density-structure + 5 processing-unit.
Version: 0.4.0
Date: 2026-06-26
  Changes:
    - Drones now have truly infinite lifetime (time_to_live = inf instead of max uint32).
    - Slowed down further (~51% slower than the destroyer overall).
    - Experiment: drones flagged as high-priority enemy targets (is_military_target).
Version: 0.3.0
Date: 2026-06-26
  Features:
    - Shortcut-bar buttons for deploy and recall (addable to the quickbar).
  Changes:
    - Guard drones are now repairable (removed the inherited "not-repairable" flag).
    - Wider orbit (range_from_player 6 -> 10), ~30% slower, max_health 200 -> 400 (+100%).
Version: 0.2.0
Date: 2026-06-26
  Changes:
    - Drone size reduced (scale 1.6 -> 1.2).
    - Drones now persist indefinitely (time_to_live set to max on deploy; removed periodic refresh).
  Features:
    - Dedicated "Guard Drones" technology (requires the Destroyer technology).
  Balancing:
    - Recipe gated behind the technology and made ~10x a single destroyer (2 destroyer-capsules + chassis).
Version: 0.1.0
Date: 2026-06-26
  Features:
    - Initial scaffold: Guard Drone item, combat-robot entity (recolored/enlarged destroyer).
    - Manual deploy (ALT+G) and recall (ALT+H) hotkeys.
    - Persistent drones via time_to_live refresh; health saved on recall.