跳到正文
Skillpedia
网站与界面(前端)7.2k · #13362

build-threejs-enemy-systems

它能做什么

这个技能帮助 AI 智能体在 3D 动作游戏中设置敌人类型,使每个敌人都以数据的形式定义,并与共享的游戏系统协同工作。适合构建可复用、可测试的敌人的开发者。

适用场景

  • ✓你想为 3D 动作游戏添加新的敌人类型的时候。
  • ✓你的敌人存在时机或攻击方面的漏洞,需要更干净的设置的时候。
  • ✓你希望敌人的数值和动作与游戏的实时状态分开保存的时候。

技能链接

https://github.com/MengTo/Skills/blob/main/agent-skills/game-development/build-threejs-enemy-systems/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/MengTo/Skills/blob/main/agent-skills/game-development/build-threejs-enemy-systems/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请帮我为 3D 游戏添加三种敌人类型,每种都有自己的攻击和奖励。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会把每个敌人写成一个固定的定义,包括数值、动作和视觉效果。实时状态(例如生命值和计时器)则单独保存,并检查设置中是否有缺失或损坏的引用。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Build Three.js Enemy Systems

Make each enemy a portable authored definition consumed by shared runtime systems. Keep AI choice, combat resolution, rendering, and feedback as separate consumers of the same stable contract.

Separate content from runtime state

  • Put stable IDs, role/tags, base stats, presentation spec, move IDs, AI hints, feedback hook IDs, rewards, and variant data in immutable authored definitions.
  • Put instance ID, transform, health/posture, target, current move and phase clock, cooldowns, statuses, pathing, visibility, and LOD state in runtime instances.
  • Reference definitions by ID. Reject duplicate IDs, missing references, invalid ranges, or impossible timing during content validation.
  • Never mutate authored definitions, store live timers in content, or duplicate the combat clock across AI, animation, and rendering.

Normalize presentation contracts

Define these fields before integrating a model:

  • source or factory ID, provenance, coordinate system, forward axis, and meters-per-unit;
  • root pivot at ground contact, normalized scale, facing offset, and visual height;
  • simple movement collider plus named hurtboxes, independent of render geometry;
  • stable sockets for contact origins, weapons, projectiles, VFX, audio, UI markers, and targeting;
  • rig and semantic clip map for idle, locomotion, moves, reactions, and death;
  • LOD tiers with hysteresis, animation/update policy, and unchanged gameplay colliders.

Normalize at the asset boundary. Do not scatter scale fixes, pivot offsets, raw clip names, or compensating rotations through gameplay code.

Define moves as data

For every move, define:

  • stable ID, AI tags, eligibility range/angle/line-of-sight, weight, and state prerequisites;
  • startup and telegraph, one or more active windows, recovery, cooldown, and minimum commitment;
  • movement, facing, cancellation, armor, interrupt, stagger, and phase rules;
  • contact shape/socket, damage, posture, knockback, status, and per-target hit limits;
  • semantic animation, VFX, and audio hook IDs with cleanup rules.

Let AI select only legal move IDs; let the combat system own timing and outcomes. Resolve damage from authoritative collision/contact events using stable action and target identifiers. Apply each contact once, then drive animation, VFX, audio, and UI from the resolved event.

Provide an honest fallback

When a production model is unavailable, use a deliberate placeholder that preserves footprint, height, pivot, collider, sockets, facing, move timing, and state readability. Log the fallback once and keep it visually unmistakable. Never silently substitute a mismatched asset or call placeholder visuals production-ready.

Add a new enemy

  1. Existing archetype and moves fit? Configure a new definition; do not add runtime branches.
  2. A new behavior is essential? Add the smallest reusable move, hook, or AI tag before adding a new subsystem.
  3. Model ready? Normalize it to the shared presentation contract; otherwise use the honest fallback.
  4. Content complete? Validate references, timing, contact, cooldown, recovery, interrupts, and feedback hooks.
  5. Proof ready? Add deterministic fixtures and automated tests, then run desktop and mobile playthroughs.

Prove the system

  • Create deterministic fixtures for spawn, each move phase, wrong range/direction, obstruction, interrupt, stagger, death/reset, missing-model fallback, LOD transitions, and multiple instances sharing one definition.
  • Test content uniqueness and references, active-window boundaries, cooldown/recovery, per-target hit deduplication, lifecycle cleanup, and pause/frame-step behavior.
  • Play a representative encounter in the repository-approved browser. Confirm telegraphs, contact, state, animation, VFX/audio, targetability, and rewards agree.
  • Verify desktop and mobile camera distance, touch controls, reduced motion, console health, frame time, draw calls, memory stability, and crowded-scene LOD behavior. Report baseline failures separately.
常见问题

这能帮助敌人做决策吗?

它设置的是 AI 所使用的敌人数据。敌人如何选择行动,由另一个技能负责。

设置过程中会检查什么?

技能说明,重复的 ID、缺失的链接、错误的数值范围和不可能的时机,都应在游戏运行前被发现。

可以使用占位模型吗?

可以。技能提到了占位的备用方案,因此在最终模型准备好之前,游戏也能运行。

详情

作者的原始描述

Build or refactor reusable, data-driven enemy archetype and moveset systems for Three.js action games. Use for enemy content schemas, model and rig conventions, combat move timing and contact contracts, runtime state boundaries, placeholder fallbacks, deterministic fixtures, or production playthrough validation.

repo: MengTo/Skills

热度

GitHub 星标
7.2k
排名
#13362
许可证
MIT
更新时间
2026/11/1

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能