build-threejs-enemy-systems
Skill này làm gì
Skill này hướng dẫn agent thiết lập các loại kẻ địch trong game hành động 3D để mỗi kẻ địch được định nghĩa như dữ liệu và chạy được với các hệ thống chung của game. Nó dành cho lập trình viên xây dựng kẻ địch có thể tái sử dụng và kiểm thử.
Khi nào nên dùng
- ✓Khi bạn muốn thêm một loại kẻ địch mới vào game hành động 3D.
- ✓Khi kẻ địch của bạn có lỗi về thời điểm hoặc tấn công và cần một thiết lập gọn hơn.
- ✓Khi bạn muốn chỉ số và chiêu thức của kẻ địch tách khỏi trạng thái sống của game.
Liên kết skill
https://github.com/MengTo/Skills/blob/main/agent-skills/game-development/build-threejs-enemy-systems/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Giúp tôi thêm ba loại kẻ địch vào game 3D của mình, mỗi loại có đòn tấn công và phần thưởng riêng.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent viết mỗi kẻ địch thành một định nghĩa cố định gồm chỉ số, chiêu thức và hình ảnh. Trạng thái sống, như máu và bộ đếm thời gian, được tách riêng, và thiết lập được kiểm tra để tìm tham chiếu thiếu hoặc hỏng.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
- Existing archetype and moves fit? Configure a new definition; do not add runtime branches.
- A new behavior is essential? Add the smallest reusable move, hook, or AI tag before adding a new subsystem.
- Model ready? Normalize it to the shared presentation contract; otherwise use the honest fallback.
- Content complete? Validate references, timing, contact, cooldown, recovery, interrupts, and feedback hooks.
- 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.
Câu hỏi thường gặp
Skill này có giúp phần quyết định của kẻ địch không?
Nó thiết lập dữ liệu kẻ địch mà AI dùng. Một skill riêng bao gồm cách kẻ địch chọn hành động của chúng.
Điều gì được kiểm tra khi thiết lập?
Skill nói các ID trùng, liên kết thiếu, khoảng số sai và thời điểm không thể phải được phát hiện trước khi game chạy.
Có dùng mô hình tạm được không?
Có. Skill nhắc đến phương án dự phòng bằng mô hình tạm, để game chạy được trước khi có mô hình cuối cùng.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 7.2k
- Vị trí xếp hạng
- #13362
- Giấy phép
- MIT
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
3d-cloth-material
7.2kGiúp agent của bạn tạo vải dệt 3D trông thật trong Three.js, với sợi dệt, ánh bóng nhẹ, nếp gấp tự nhiên, viền gấu và đường may.
3d-falling-leaves
7.2kGiúp agent của bạn thêm lá rơi chân thực vào cảnh 3D, với lá xoay tròn, trôi theo gió và được tái sử dụng khi máy quay di chuyển.
3d-four-seasons
7.2kGiúp agent của bạn thêm diện mạo xuân, hạ, thu, đông vào cảnh 3D, thay đổi cây cối, ánh sáng, bầu trời và tuyết mà không cần dựng lại cảnh.
3d-high-poly-models
7.2kGiúp agent của bạn dựng mô hình 3D chi tiết với hình dạng mượt và cạnh trông thật, rồi tạo các phiên bản nhẹ hơn chạy tốt trên web.
Skill tương tự
angular-developer
280kGiúp agent của bạn viết code Angular và tư vấn cấu trúc dự án, hữu ích khi bắt đầu dự án mới hoặc cải thiện hiệu suất.
frontend-a11y
280kGiúp agent của bạn làm cho giao diện web dễ tiếp cận với mọi người. Đảm bảo website và ứng dụng hoạt động tốt với trình đọc màn hình và điều hướng bằng bàn phím.
frontend-patterns
280kGiúp agent của bạn áp dụng các mẫu hiện đại trong phát triển frontend. Tối ưu hiệu năng, quản lý trạng thái và tuân theo thực hành tốt nhất với React và Next.js.