Projectile 是"一个东西" A Projectile Is a Thing, Not a Pellet
关于我们怎么理解抛射物 · 2026-11-21How we read a projectile · 2026-11-21
系列这些文章写给人和他的 agent 一起看。这套文档怎么读 →SeriesThese posts are for you and your agent. How to read these docs →
框架里其实只有两类实体 There Are Really Only Two Kinds of Entity
前面说过 Agent:一个有自主行为的智能体,能跑、能转向、能指哪打哪。Projectile 是另一类,用不着那么高的智能,主要按物理规律动。它就是一个东西:只要会碰撞、会造成伤害,这套机制就能表达它。
We covered the agent earlier: an autonomous body that runs, turns, and points at what it attacks. The projectile is the other kind. It needs far less intelligence and mostly just moves under physics. It is a thing: anything that collides and deals damage can be expressed with it.
名字有点误导。叫它 projectile,是因为最显眼的用法是"被打出去";但发射只是它的一个状态,这个类型本身不靠发射成立。
The name misleads a little. We call it a projectile because the most visible use is getting fired; but firing is one state it can be in, and it does not define the type.
一个东西的几种活法 The Same Thing, Several Lives
把"会碰撞、会伤害"当成定义,能装下的东西一下就多了。同一套机制可以是下面这几种:
Once "collides and deals damage" is the definition, the category gets wide. The same mechanism covers all of these:
| 形态Form | 怎么用How it is used |
|---|---|
| 握在手里挥Held and swung | 近战武器:一把刀、一杆长枪。它不飞出去,运动关掉,命中体跟着手走,挥到谁身上谁掉血A melee weapon — a sword, a spear. It never leaves the hand: motion is off, its hit volumes follow the grip, and whoever the swing reaches takes the damage |
| 扔出去Thrown | 投掷武器:标枪、飞斧。同一个东西,只是允许运动A thrown weapon — a javelin, an axe. The same thing, with motion allowed |
| 让它再生一个东西A thing that spawns things | 枪、炮、导弹发射架:它自己不飞,飞的是它生成的那个东西。子弹、炮弹、导弹为什么长得不一样,是运动模型不同,不是换了一套系统A gun, a cannon, a missile launcher: it does not travel, what travels is what it spawns. Why a bullet, a shell and a missile behave differently is the motion model, not a different system |
第三行最容易被低估。一个东西能生成东西,"武器"和"弹药"就成了同一种东西的两个实例,不再是两套代码。机枪打子弹、坦克炮打炮弹、导弹架打导弹,区别只在生成出来那个东西怎么运动。
The third row is the one people underestimate. Once a thing can spawn things, weapon and ammunition become two instances of one kind rather than two code paths. A machine gun, a tank cannon and a missile rack differ only in how the spawned thing moves.
有人会追问:一把枪就是为了发射子弹,那枪自己为什么还得是一个"东西"?答案很直接:枪不只能发射。枪托可以砸,上了刺刀可以捅,近身了扣扳机不是唯一选择。弓箭手被贴脸时也一样,不一定要拉弓,他会拿那把弓去抡人。
A fair follow-up: if a gun exists to fire bullets, why does the gun itself have to be a thing? The answer is direct: a gun does more than fire. The stock can be swung, a bayonet thrust. Up close, pulling the trigger is not the only option. An archer caught at the same range does not necessarily draw; he swings the bow.
"发射"和"握在手里打"于是是同一个东西上挂着的两条路,运行时按距离和输入挑一条走。我们也因此不在武器上分"远程类"和"近战类":没有两种武器,只有同一件武器开了几种用法。
"Fires" and "hits while held" are then two routes hanging off the same thing, and the situation picks one. That is also why we do not split weapons into a ranged kind and a melee kind: there are no two weapons, only one weapon with several ways of being used.
运动只有几种,命中只有一套 A Few Motion Models, One Hit System
东西的运动模型就那几种:插值着飞过去,按弹道加落下坠,或者一路追着目标拐弯。命中永远是同一套:命中体在东西自己的局部空间里,判定窗口挂在宿主攻击回合的比例上,命中通道决定它打谁。
There are only a few motion models: interpolate toward the point, fly a ballistic arc under gravity, or steer after a target. Contact is always the same system. Hit volumes live in the thing's own local space, their windows are a fraction of the host's attack round, and hit channels decide who they reach.
这也解释了为什么握在手上它还能打人:命中判定本来就不依赖飞行,飞行只是可选的一段。
That explains why it still hits while held: the hit table never depended on flight. Flying is an optional leg.
还有一类:Loot And One More: Loot
Loot 目前刻意做得很小:一份战利品,落地、被看见、被捡走。它没有 Agent 那么全的功能,也没有东西那么多形态,按现在的玩法够用。等哪天真需要"会自己长出来的资源点"或"会跑的战利品",再按需要加;不先长一堆用不上的。
Loot is deliberately small for now: a drop, on the ground, seen, picked up. It does not carry an agent's full capability set and does not come in a thing's many forms; that is enough for the gameplay we have. If a self-growing resource node or a drop that runs ever becomes real, it grows then. We do not build features nothing uses.
所以 So
Agent 是"会想的身体",东西是"会撞的物件",Loot 是"会被捡的东西"。三个词各自覆盖一大类,都不是某个具体模型。真正要判断的只有一件事:这个东西需不需要"想"?需要就是 Agent,不需要就是东西。
An agent is a body that thinks, a thing is an object that collides, loot is something you pick up. Each word covers a large family, not one concrete model. The only question you have to answer: does this need to think? Yes means an agent; no means a thing.