用一个分层 PSD 做出游戏怪物的整套战斗动画:Spine 待机、攻击、受击、死亡
一只 RPG 游戏里的熔岩蜥蜴:输入一个分层 PSD,输出一套 Spine 4.2 骨骼和四个战斗动画——待机(idle)、攻击(attack)、受击(hurt)、死亡(death)。第一句提示词在 3 分钟内搭好了骨骼和全部四个动画。攻击一次就对,受击改了一次;其余都是打磨,主要是死亡动画——用简短的提示词,加上免费的鼠标微调。下面是原样发送的每一句提示词、之后哪里不对、又是怎么改好的。
最终效果
点击 idle、attack、hurt、death 切换动画。这是导出的 Spine 4.2 文件,在 Spine 官方 Web Player 中播放——就是你会加载进游戏的那份 JSON、atlas 和贴图页。攻击动画在击中的瞬间触发名为 hit 的事件,游戏据此结算伤害。
开始前需要准备什么
一个已经拆好图层的 PSD,每个会动的部件单独一层。有两点能让模型更省事、少用提示词:
- 图层按绘制顺序排列。上面的图层画在前面。侧面角色的近侧手臂放在躯干上面,远侧手臂放在躯干下面。
- 图层名字直白。
head、jaw、torso、arm_front_upper、thigh_back……模型会读名字,据此确定关节位置。
这只蜥蜴导入时有 16 个图层,没有任何骨骼:尾巴、两条各分两段的手臂、两条腿的大腿和小腿、一只脚、腰布、躯干、头、下巴、手和棒子。图层的更多说明见美术准备(英文)。
第 1 句:骨骼和四个动画
This is a lava salamander warrior for an RPG, facing right, holding a stone club in the front hand. Rig it and make four animations; parts that touch must stay overlapped in every frame. idle - 2 s loop: heavy breathing, the head bobs slightly on the neck, the tail sways a little. attack - about 1 s: the club arm stays almost in place and lifts only a little; the work is in the wrist - the club cocks back and snaps forward; the torso leans into the blow and the legs bend slightly. Event 'hit' at the impact. hurt - about 0.5 s: a small recoil from a blow to the chest, then a light wobble of arms and legs that settles. death - about 1.5 s, starts from the rest pose: he staggers, the knees give way one after the other, he falls backwards in phases - not as a stiff board and not as a sack; the feet stay planted, the club slips out of the hand.
在放第一根骨骼之前,模型先判断了素材类型——人形——并加载了 Riggy 针对这一类型的动画配方:人形角色的关节放在哪里(头在脖子处转动,而不是在嘴部),攻击怎么做(手臂保持形状,手腕甩出),死亡动画从静止姿势开始。然后一次性搭好了 19 根骨骼和四个动画。

攻击一开始就对了,待机后来只是加了点生气。受击和死亡需要修改——这就是本文剩下的内容。我们逐帧查看每个动画:点击时间轴上的标记,播放器就会停在那个瞬间(见Motion(英文))。
第 2 句:受击抖得太厉害,死亡掉到地面以下
受击时拿棒子的手臂甩得太大。死亡时整个身体在踉跄阶段向左滑,最后沉到地面以下,棒子还飞到了空中。
idle and attack look good. Fix two things. death: in the stagger the whole body slides to the left, and by the end he sinks below the ground line - the legs and back go under y=0, and the club flies up into the air instead of falling. He must end lying on his back ON the ground line, nothing below y=0, feet where they stood; the club drops down and lands on the ground beside him. Please look at the frames of death before you answer. hurt: the club arm jerks too much on the hit - keep it to a few degrees, the recoil should come from the torso.
受击一次改好:手臂只动几度,后仰来自躯干。死亡变好了一些,但还不够。
第 3 句:逐秒描述死亡,并合上手腕的缝
死亡时拿棒子的手臂仍然举过头顶,腿穿到地面以下。我们还发现拳头和前臂之间有一条细缝——是美术本身的问题,不是动画的问题。
hurt is good now. death is still wrong, here is what I see: at 0.6-0.8 s the club arm swings up over the head - keep it down by his side. From 0.95 s the legs stay vertical and go under the ground line while the body tips over them; at 1.5 s the legs hang below the ground, the head is the lowest point on the left and the club floats in the air above him, away from the hand. Wanted end pose: he lies flat on his back along the ground line - head on the left, legs stretched out to the right, the feet near where he stood, nothing below y=0; the club lies on the ground next to the hand. One more fix in the setup pose: the fist with the club sits a bit apart from the forearm, there is a gap at the wrist - move hand_front together with the club about 14 px left and 8 px up so the fist sits on the end of the forearm.
拳头在静止姿势里移到了前臂末端,所有动画里的缝都一起消失了。死亡最后能躺下了,但有几个部件还在地面以下,棒子悬在空中。
第 4 句:让待机更生动,死亡按秒修正
待机的呼吸不错,但整个身体像一整块在晃。死亡的问题我们逐一写明时间:0.5–0.7 秒怎样、1.0 秒起怎样、1.3–1.5 秒怎样。
Much better - attack and hurt are approved, don't touch them. Small tuning only. idle: right now the whole body sways as one big piece - add a slight independent sway of both arms (2-3 degrees at the shoulder, a little behind the breath) and of the hips/thighs, so it feels alive. death, small fixes, keep the rest: (1) at 0.5-0.7 s both feet lift off the ground and the club arm bends up so the club is next to the head - keep the feet on the ground until the body tips, and keep the club arm low by the side; (2) from 1.0 s to the end the club sticks straight up into the air - lay it down so at 1.5 s it rests flat on the ground next to the hand; (3) at 1.3-1.5 s the back arm and the tail hang below the ground line - lift them so they rest on the ground, nothing below y=0.
手臂和大腿现在各自摆动,比呼吸稍晚一点。死亡时双脚踩住地面直到身体后倒,棒子落在手边。
鼠标修改 1:没跟上的腰带
攻击时躯干向前压,腰带却留在原地,从腰上滑开了。原因是腰带挂在髋骨上,而躯干在它上方弯曲。不用写提示词:在骨骼树里把 loincloth 拖到 torso 上。画布上什么都不会跳——部件保持原位,从此跟着躯干动,四个动画都一样。免费,几秒钟。做法见把骨骼换到新的父骨骼(英文)。
第 5 句:近侧手臂藏到了身体后面
左边那条粗手臂是怪物的近侧手臂,但它的图层在躯干下面,所以受击时会滑到身体后面。死亡时拿棒子的手臂在关节处散开,棒子从拳头里滑出去。
Next round of small fixes. (1) Draw order: the big arm on the left of the picture (arm_back_upper + arm_back_lower) is actually his NEAR arm - in the original art it is in front of the torso, the back thigh and the loincloth. Right now it goes behind the torso, very visible in hurt. Move both of those parts above torso, thigh_back and loincloth (still below jaw and head). (2) death 1.0-1.5 s: the club arm falls apart - the fist separates from the forearm and the forearm from the shoulder, and the club slides out of the fist so the handle lies apart from the hand. Keep that chain joined: rotate only at the joints, no translate on arm_front_upper/arm_front_lower/hand_front/club; let him keep the club in the fist and land with it, club flat on the ground. (3) death 1.15-1.5 s: the near arm's forearm with the claws sticks out horizontally into the air to the right - lay it along the body. (4) at the end the near arm and the tail still dip a bit below the ground line - lift them onto it. attack, hurt and idle are approved, don't change their motion.
近侧手臂现在画在躯干前面,拿棒子的手臂保持完整,棒子握在拳头里。只有一处方向反了:死亡时近侧手臂指向了头的另一边。
第 6 句:一个方向,一个数字
Good progress: the draw order is right now, and the club arm stays in one piece with the club in the fist - keep both. Two things left in death, from about 1.1 s to the end: (1) the near arm (arm_back_upper + arm_back_lower) turned the wrong way - it now points past his head to the left and partly goes under the ground. Turn it the other way: lying on his back with the head on the left, the near arm should lie along his side pointing toward his feet (to the right), resting on the ground. The -138 degrees at the shoulder is the wrong direction; something like +40..+60 from rest should do. (2) the belly and the lower torso dip about 40 px below the ground line in the final pose - lift the whole body (fall translate) so the lowest point is on y=0. Nothing else changes.
一句短提示词,手臂就沿着身体放好了,他躺在地面上。
第 7 句和鼠标修改 2:腿
death is almost there, only the legs in the fall and the final pose (about 0.9-1.5 s): (1) the club-side leg (thigh_front, shin_front, foot_front): lower the thigh a bit toward the other leg, as if the legs close together; foot_front must not twist on its own - keep it at roughly its rest angle relative to the shin (offset near 0) all the way. (2) the other leg (thigh_back + shin_back) ends up sticking up into the air - by the end of the animation it should come back down to a natural relaxed pose, close to its rest angles relative to the body, lying next to the first leg. Everything else stays as it is.
脚现在保持与小腿的角度。最后姿势里的腿还有点偏——一条在空中,一条在地面以下——我们用鼠标收尾:在 Motion 模式下点击 death 在 1.15、1.25、1.4 和 1.5 秒的瞬间,用鼠标转动两条大腿——在死亡动画里改了几个关键帧,免费。做法见修改某一瞬间的姿势(英文)。
第 8 句和鼠标修改 3:地面在哪里
审稿时又发现两处问题。死亡不再从静止姿势开始:后侧大腿在 0 秒时就已经转了 20°。原因是我们自己在最后一个瞬间做的鼠标修改——那条大腿的时间轴首尾数值相同,Riggy 把它当成了循环,把修改也复制到了第一帧(我们正在改:不循环的动画不会再这样)。另外,我们一直以画布底边作为地面,而这只怪物的脚站在它上方约 70 像素处。
Last fixes in death, nothing else changes: (1) frame 0 must be exactly the rest pose - right now thigh_back starts already rotated by about +20 degrees at 0 s; make its death track start at 0 offset and keep its end pose as it is now. (2) at 0.2-0.9 s the knees bend but the hips stay where they are, so both feet lift about 70 px off the ground - lower the body together with the knee bend so the feet stay on y=0 until he tips over. (3) at 1.5 s the tail and the near upper arm (arm_back_upper) still dip about 20 px below the ground line - lift them just enough to rest on y=0.
第 0 帧回到了静止姿势。但第 (2) 点是我们的错:脚本来就没有离地,把身体压低反而让脚陷进了地面。我们手动改正,把静止姿势下脚底所在的线当作地面:在 Motion 模式下去掉下沉,设定落地时的身体高度,从着地瞬间起把尾巴和近侧手臂放平——都是 Motion 模式里的关键帧修改,免费。现在双脚踩住地面直到后倒,落地时轻轻一弹,躺在他原来站着的那条线上。

费用怎么算
每句提示词按实际用掉的 token 计费,价格就显示在聊天里的回复旁边,随时心里有数。每个项目可以自己选模型;这个项目用的是 Claude Sonnet 5。所有鼠标修改都免费。
怎样少用提示词
- 描述动作,而不只是说出动作名。“做一个攻击动画”等于把所有决定都交给模型,它就会自己发挥。写清楚动作多长、哪些部件动、哪些不动、从哪里开始、按什么顺序、看起来像什么。我们的攻击提示词是:“about 1 s: the club arm stays almost in place and lifts only a little; the work is in the wrist — the club cocks back and snaps forward; the torso leans into the blow and the legs bend slightly”——攻击一次就对了。感觉也一样可以写:“heavy breathing”、“falls backwards in phases — not as a stiff board and not as a sack”。更多例子见怎样写提示词(英文)。
- 图层要排好序、起好名。我们有两处修改——近侧手臂藏到身体后面、手腕的缝——来自美术本身,而不是动画。
- 说明哪些已经通过。“attack and hurt are approved, don't touch them”会告诉模型哪些动画不要动。但改骨架本身——部件挂在哪根骨骼上、谁画在前面——仍会影响所有动画,这类修改之后要再检查一遍。
- 说出第几秒、往哪个方向。“At 1.3–1.5 s the tail hangs below the ground line”一次就能改好;“死亡看着不对”要来回好几次。
- 知道地面在哪里。地面是静止姿势下脚底所在的线,不是图片的底边。把这个高度告诉模型,并用它检查倒地动画的最后一帧。
- 小事用鼠标更快。把部件挂到另一根骨骼、在某个瞬间微调姿势,鼠标几秒钟就能做完,而且免费——全部鼠标和键盘操作(英文)。
继续加工
导出的是标准的 Spine 4.2 JSON 和 atlas——可以在 Spine 编辑器里继续手工打磨,也可以直接加载进游戏:Phaser 4(英文)、PixiJS 8(英文)、Unity(英文)。蜥蜴的文件在示例页(英文)。待机动画的时长和幅度怎么定,见Spine 待机动画的实测数据。用 Spine 运行库发布游戏,需要 Esoteric Software 的 Spine 授权,与骨架由谁制作无关——见授权说明(英文)。
下一步:从一张图到分层
现在 Riggy 需要从分层 PSD 开始。我们正在做一个工具:把一张角色图自动拆成按正确顺序排列、命名好的图层,并补画被遮住的部分——这样从一张图到会动的骨骼动画,不用打开 Photoshop。