thedivergentai/gd-agentic-skills

godot-genre-tower-defense

Expert blueprint for tower defense games (Bloons TD, Kingdom Rush, Fieldrunners) covering wave management, tower targeting logic, path algorithms, economy balance, and mazing mechanics.

First seen Feb 10, 2026

Installation

$ npx skills add thedivergentai/gd-agentic-skills --skill godot-genre-tower-defense

Summary

  • Expert blueprint for tower defense games (Bloons TD, Kingdom Rush, Fieldrunners) covering wave management, tower targeting logic, path algorithms, economy balance, and mazing mechanics.
  • Use when building TD, lane defense, or tower placement strategy games.
  • Keywords tower defense, wave spawner, pathfinding, targeting priority, mazing, NavigationServer baking.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from thedivergentai/gd-agentic-skills · top by installs.

npx skills add thedivergentai/gd-agentic-skills

Browse all from thedivergentai/gd-agentic-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 678
License LICENSE
Default branch main
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 11,686 B
  • docs SUMMARY.md 393 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 213 installs

SKILL.md

Core Loop

  1. Prepare: Build/upgrade towers with available currency
  2. Wave: Enemies spawn and traverse path toward goal
  3. Defend: Towers auto-target and damage enemies
  4. Reward: Kills grant currency
  5. Escalate: Waves increase in difficulty/complexity

NEVER Do (Expert Anti-Patterns)

Design & Strategy

  • NEVER make all towers have the same niche; strictly ensure distinct specialties: Aura Slow, Armor Piercing, Anti-Air, Burst Sniper, and Splash Damage.
  • NEVER allow a "Death Spiral" with no exit; strictly provide small comeback bonuses or interest on saved gold to prevent early inevitable failure.
  • NEVER make early waves feel like busywork; strictly provide an "Early Call" bonus to skip wait times and accelerate engagement.
  • NEVER trust client-side economy updates; strictly require the authoritative server to validate currency addition and tower purchases in co-op.

Pathing & Placement

  • NEVER allow the player to "Seal" the exit in mazing games; strictly validate path existence with NavigationServer2D.mapgetpath() before finalizing tower placement.
  • NEVER use synchronous bakenavigationpolygon() for mazing; strictly offload to a worker thread to prevent 100ms+ frame hitches during placement.
  • NEVER use global coordinates for grid logic; strictly convert to Vector2i/Vector3i to ensure pixel-perfect tower alignment.

Performance & Systems

  • NEVER call getoverlappingbodies() every frame; strictly use signals (bodyentered/bodyexited) to maintain a local target cache.
  • NEVER use _process() for projectile movement if count > 500; strictly use the PhysicsServer2D/3D directly for high-performance bullet-hell tiers.
  • NEVER spawn hundreds of projectiles as full Nodes; strictly use Object Pooling to reuse resources and avoid garbage collection stutters.
  • NEVER use standard Strings for priorities; strictly use StringName (&"first", &"strongest") for O(1) hash comparisons in targeting loops.
  • NEVER ignore the progress property on PathFollow nodes; strictly use it as the O(1) way to identify the target closest to exit.
  • NEVER process tower search logic every frame; strictly throttle ACQUIRE searches (e.g., every 5-10 frames) to save significant CPU cycles.
  • NEVER scale Tower CollisionShape non-uniformly; strictly adjust the radius property of the Shape resource to preserve collision math.
  • NEVER delete enemies immediately on death; strictly use set_deferred("disabled", true) and wait one frame to prevent physics server crashes.
  • NEVER hardcode waves in huge switch statements; strictly use Custom Resources (.tres) for clean balancing and sequence editing.

🛠 Expert Components (scripts/)

Original Expert Patterns

  • [wavemanager.gd](scripts/wavemanager.gd) - Professional wave orchestrator with Resource-based enemy composition and cleanup.
  • [tower.gd](scripts/tower.gd) - Base turret class with FSM state management and firing logic.
  • [towertargetingsystem.gd](scripts/towertargetingsystem.gd) - Autonomous priority logic (First/Last/Strongest/Weakest) for efficient targeting.

Modular Components

  • [towerdefensepatterns.gd](scripts/towerdefensepatterns.gd) - Collection of patterns for furthest-target logic and PhysicsServer projectile optimization.

Decision Trees (MANDATORY script reads)

Path style

Style Approach Scripts / APIs
Fixed lanes Path2D / PathFollow2D progress [wavemanager.gd](scripts/wavemanager.gd), [waveresourcespawner.gd](scripts/waveresourcespawner.gd)
Mazing Seal-check before place NavigationServer2D.mapgetpath / AStarGrid2D (NEVER)
Organic curves Bezier PathFollow progress Prefer PathFollow over per-frame seek

Targeting priority

Priority Sort key MANDATORY
FIRST Highest progress (closest to exit) [towertargetingsystem.gd](scripts/towertargetingsystem.gd)
LAST Lowest progress same — LAST implemented
STRONGEST / WEAKEST health desc / asc same — WEAKEST implemented

Use signal-cached range Area enter/exit + frame-sliced acquire (acquireintervalframes). Never getoverlappingbodies() every frame.

Economy

Concern Rule Script
Wave composition Resource .tres waves [wavemanager.gd](scripts/wavemanager.gd)
Co-op purchases Server validates gold [towerdefensepatterns.gd](scripts/towerdefensepatterns.gd)
Comeback Interest / early-call bonus Design-level — not tower FSM

PhysicsServer Projectile Golden Path

When count > ~500:

  1. MANDATORY [towerdefensepatterns.gd](scripts/towerdefensepatterns.gd) spawnfastbullet (PhysicsServer3D kinematic RIDs).
  2. Pool RIDs; AoE via intersect_shape; defer collision disable on death.
  3. Modest counts: [homingprojectile3d.gd](scripts/homingprojectile3d.gd) / pooled Nodes OK.

Tower FSM

MANDATORY: [tower.gd](scripts/tower.gd) for idle → acquire → windup → fire. Targeting stays in [towertargetingsystem.gd](scripts/towertargetingsystem.gd).

Deep recipes (on demand)

Topic Reference / script
Waves / towers / paths [architecture-overview.md](references/architecture-overview.md)
Projectile lead & targeting [key-mechanics.md](references/key-mechanics.md)
Maze validation & burst search [elite-technical-patterns.md](references/elite-technical-patterns.md) + [gridpathvalidator.gd](scripts/gridpathvalidator.gd)

Reference

Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing to a peer domain — do not preload the whole lattice.

Official Documentation

  • Navigation introduction (2D) — NavigationRegion2D baking and map queries for mazing TD path validity.
  • Using NavigationAgents — agent path following and avoidance when towers reshape walkable space.
  • NavigationServer2Dmapget_path seal checks before committing tower placement.
  • AStarGrid2D — integer-grid path probes that simulate build cells without a full nav bake.
  • PathFollow2Dprogress / progressratio for fixed-lane enemies and First/Last targeting.
  • PathFollow3D — 3D track followers used by wave spawners and homing aim references.
  • Using Area2D — signal-driven range caches (bodyentered / bodyexited) instead of per-frame overlap polls.
  • Physics introduction — layers/masks so tower ranges hit enemies, not other towers or walls.
  • Using servers — PhysicsServer bodies for high-count projectiles without Node overhead.
  • Resources — WaveDefinition .tres data instead of hard-coded spawn switches.
  • Using multiple threads — WorkerThreadPool / Thread patterns for async navigation rebakes during placement.
  • Using TileMaps — TileMapLayer grids for build cells, paths, and placement snapping.

Related Skills

Prerequisites

Complements

Downstream / consumers

  • godot-genre-rts — base defense and unit-placement loops that reuse path validation and economy pressure.
  • godot-multiplayer-networking — authoritative purchase validation and unreliable minion sync for co-op TD.

Master

  • godot-master — library router and mirrored module entry for cross-skill discovery.