tune-enemy-ai
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTune Enemy AI
调整敌人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.
使用小型状态机或工具层,定义诸如idle、investigate、pursue、reposition、windup、attack、recover、stagger、retreat和defeated等命名状态。状态转换必须明确其前置条件、退出条件、最小停留时间以及冷却效果。
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.
在攻击生效前展示telegraphs。禁止瞬间转身攻击、持续追击、穿过障碍物的攻击以及重复恢复spam行为。增加间距和动作承诺机制,让玩家能够识别并应对每种敌人类型。
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.
为目标获取、目标丢失、障碍物阻挡、路径失败、近距离施压、多敌人场景、反击、打断、硬直、Boss阶段和重置创建确定性测试用例。断言状态转换和结果,而非仅断言最终位置。在自动化测试后运行真实浏览器中的战斗场景。