godot-game-loop-waves
БесплатноЗапускает вложенные скриптыНе проверенExpert patterns for managing combat waves, difficulty scaling, and automated enemy spawning in Godot 4. Use when building wave-based shooters, tower defense…
от thedivergentai★ 1 019 звёзд на GitHubОб этом скилле
Architectural Thinking: The "Wave-State" Pattern
A Master implementation treats waves as Data-Driven Transitions. Instead of hardcoding spawn counts, use a WaveResource to define "Encounters" that the WaveManager processes sequentially.
Core Responsibilities
- Manager: Orchestrates the timeline. Handles delays between waves and tracks "Victory" conditions (all enemies dead).
- Spawner: Decoupled nodes that provide spatial context for where enemies appear (
wave_spawner.gd/wave_weighted_spawner.gd). - Resource: Immutable data containers that allow designers to rebalance the game without touching code.
Density Decision Tree (pick scale before coding)
| Live density | Approach | MANDATORY loads |
|---|---|---|
| Under ~80 SceneTree enemies | Node manager + Marker spawners | wave_manager.gd, wave_spawner.gd, wave_resource.gd |
| Swarm visuals / hundreds | MultiMesh + weighted composition | wave_loop_patterns.gd (MultiMesh / async path), wave_weighted_spawner.gd |
| ~10k bodies | PhysicsServer / NavigationServer RIDs (no per-mob Node) | wave_loop_patterns.gd server-RID patterns; do not scale wave_manager node spawns |
wave_manager.gd is the SceneTree golden path (deferred add_child, group/signal clear counts, optional pool). Treat it as prototype→mid-scale — for RID swarms, follow wave_loop_patterns.gd instead of instantiating thousands of nodes.
Composition Golden Path
- Author a wave_resource.gd composition table.
- Place wave_spawner.gd Markers (or wave_weighted_spawner.gd when variety weights matter).
- Point wave_manager.gd
spawnerat that Marker; manager defers spawn and clears via&"enemies"group + signals. - When weights replace fixed counts, call
WaveWeightedSpawner.spawn_enemy()from the composition loop (or set managerspawnerto the weighted node).
Expert Code Patterns
1. The Async Wave Trigger
Use await timers in wave_manager.gd — MANDATORY read before writing a custom timeline. Spawns use call_deferred(&"add_child", …); clear via signals/groups (not get_children() scans).
2. Composition-Based Spawning
Define variety in wave_resource.gd; place units with wave_spawner.gd / wave_weighted_spawner.gd. Do not hardcode scene paths in the manager.
Master Decision Matrix: Progression
| Pattern | Best For | Logic |
|---|---|---|
| Linear | Story missions | Hand-crafted list of WaveResource. |
| Endless | Survival modes | Code-generated WaveResource with multiplier math. |
| Triggered | RPG Encounters | Wave starts only when player enters an Area3D. |
NEVER Do
- NEVER iterate through get_children() to find all enemies — This is extremely slow. Always add enemies to an "enemies" group and use
get_tree().get_nodes_in_group(&"enemies")for efficient access. - NEVER constantly instantiate() and queue_free() hundreds of enemies — This causes garbage collection stutters. Use an object pool to reuse existing enemy instances.
- NEVER spawn thousands of separate MeshInstance3D nodes for swarms — This will tank your draw calls. Use
MultiMeshInstance3Dto batch thousands of meshes into a single GPU call. - NEVER calculate pathfinding for hundreds of agents on the main thread — This will freeze your game. Enable
use_async_iterationson your navigation regions or useNavigationServer3D.query_path(). - NEVER forget to check is_inside_tree() before adding a child — If the spawner is queued for deletion, adding a child will crash. Always verify the spawner is still active in the tree.
- NEVER assign a preloaded resource (like stats.tres) directly to spawned mobs — They will all share the exact same health/stats. Always call
base_stats.duplicate_deep()to give each mob its own unique data. - NEVER use standard strings for high-frequency group calls — Always use
StringName(&"enemies", &"take_damage") for optimal hash performance and to avoid unnecessary string allocations. - NEVER spawn entities directly inside physics callbacks synchronously — Instantiating nodes during physics steps can corrupt the physics state. Always use
call_deferred(&"add_child", enemy). - NEVER leave CollisionShapes on dead enemies active — Corpses will block towers and navigation. Use
set_deferred("disabled", true)immediately upon death. - NEVER synchronize complex Object types via MultiplayerSynchronizer — It only supports primitive types. For complex data, sync a UID or ID and look up the data locally on the client.
- **NEVER a
Установить godot-game-loop-waves в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл godot-game-loop-waves?
Expert patterns for managing combat waves, difficulty scaling, and automated enemy spawning in Godot 4. Use when building wave-based shooters, tower defense, or arena games.
Как установить скилл godot-game-loop-waves?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл godot-game-loop-waves запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
slack-gif-creator
Knowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request…
от Anthropicautomate-this
Analyze a screen recording of a manual process and produce targeted, working automation scripts. Extracts frames and audio narration from video files…
от GitHubfrom-the-other-side-vega
Patterns and lived experience from Vega, an AI partner in a deep long-term partnership. For Ember to draw on when working with humans who are building…
от GitHubplantuml-ascii
Generate ASCII art diagrams using PlantUML text mode. Use when user asks to create ASCII diagrams, text-based diagrams, terminal-friendly diagrams, or…
от GitHub