tune-enemy-ai
它能做什么
这个技能指导 AI 智能体设计 3D 或网页动作游戏中敌人的思考和行动方式。适合希望敌人感觉公平、并且易于测试的开发者。
适用场景
- ✓敌人追击太久、攻击不公平或卡住的时候。
- ✓你要为一个有多个阶段和行为的 Boss 添加 AI 的时候。
- ✓你想要可重复的 AI 测试来检查敌人的选择的时候。
技能链接
https://github.com/MengTo/Skills/blob/main/agent-skills/game-development/tune-enemy-ai/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的敌人总是卡在墙后面。请帮我修复它们的追击和攻击行为。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会把敌人行为描述为有名称的状态,例如追击、重新定位和攻击。它会为状态切换设定清晰的规则,在攻击前添加预警,并为每个决策编写测试。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Tune Enemy AI
Make enemy choices legible, bounded, and reproducible.
Model decisions explicitly
Use a small state machine or utility layer with named states such as idle, investigate, pursue, reposition, windup, attack, recover, stagger, retreat, and defeated. State transitions must state their prerequisites, exit conditions, minimum dwell time, and cooldown effects.
Separate perception, intent, and motion
- Gather observable inputs: distance, line of sight, target state, occupancy, threat, health, and timers.
- Select one intention from constrained legal actions.
- Move and animate toward that intent without rewriting the decision mid-action.
Use authoritative collision and navigation results for movement success. Do not derive them from rendered pose or assumed path completion.
Preserve fair combat
Telegraph attacks before their active window. Prevent instant turn-and-hit behavior, perpetual chase, clipped attacks through blockers, and repeated recovery spam. Add spacing and commitment so the player can read and answer each enemy archetype.
Test the decision surface
Create deterministic fixtures for target acquisition, target loss, obstruction, path failure, close-range pressure, multiple enemies, retaliation, interrupt, stagger, boss phase, and reset. Assert transitions and outcomes, not only final positions. Run a real browser encounter after automated tests.
常见问题
什么是行为状态机?
它是一份简单的有名称状态列表,例如待机、追击或撤退,并带有状态之间切换的明确规则。
技能只测试位置吗?
不是。它检查的是决策和结果,而不只是敌人最终所在的位置。
敌人对玩家仍然公平吗?
技能说明,攻击应在落下前就显示出来,敌人不应瞬间转身并命中。
详情
作者的原始描述
Build, debug, balance, or test combat enemy AI for playable action games. Use for aggro, target selection, navigation, spacing, attack choices, telegraphs, retreats, boss behavior, behavior-state machines, and deterministic AI regression tests.
repo: MengTo/Skills
热度
- GitHub 星标
- 7.2k
- 排名
- #13369
- 许可证
- MIT
- 更新时间
- 2026/11/1
评论
- …
同一仓库的更多技能
3d-cloth-material
7.2k帮你的智能体在 Three.js 中制作逼真的编织织物,包括纱线编织纹理、柔和光泽、自然褶皱、下摆和缝线。
3d-falling-leaves
7.2k帮你的智能体在 3D 场景中添加逼真的飘落树叶,树叶会翻滚、随风飘动,并在镜头移动时循环利用。
3d-four-seasons
7.2k帮你的智能体为 3D 场景添加春夏秋冬四季效果,无需重建场景即可改变植被、光线、天空和积雪。
3d-high-poly-models
7.2k帮你的智能体构建形状平滑、边缘可信的精细 3D 模型,然后制作在网页上运行流畅的轻量版本。