<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://mdtwiki.top/index.php?action=history&amp;feed=atom&amp;title=JSON%E6%A8%A1%E7%BB%84%E6%95%99%E7%A8%8B-%E5%8D%95%E4%BD%8D%E3%80%81%E6%AD%A6%E5%99%A8%E3%80%81%E8%83%BD%E5%8A%9B%E3%80%81%E5%8D%95%E4%BD%8D%E5%B7%A5%E5%8E%82</id>
	<title>JSON模组教程-单位、武器、能力、单位工厂 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://mdtwiki.top/index.php?action=history&amp;feed=atom&amp;title=JSON%E6%A8%A1%E7%BB%84%E6%95%99%E7%A8%8B-%E5%8D%95%E4%BD%8D%E3%80%81%E6%AD%A6%E5%99%A8%E3%80%81%E8%83%BD%E5%8A%9B%E3%80%81%E5%8D%95%E4%BD%8D%E5%B7%A5%E5%8E%82"/>
	<link rel="alternate" type="text/html" href="https://mdtwiki.top/index.php?title=JSON%E6%A8%A1%E7%BB%84%E6%95%99%E7%A8%8B-%E5%8D%95%E4%BD%8D%E3%80%81%E6%AD%A6%E5%99%A8%E3%80%81%E8%83%BD%E5%8A%9B%E3%80%81%E5%8D%95%E4%BD%8D%E5%B7%A5%E5%8E%82&amp;action=history"/>
	<updated>2026-05-16T01:19:02Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://mdtwiki.top/index.php?title=JSON%E6%A8%A1%E7%BB%84%E6%95%99%E7%A8%8B-%E5%8D%95%E4%BD%8D%E3%80%81%E6%AD%A6%E5%99%A8%E3%80%81%E8%83%BD%E5%8A%9B%E3%80%81%E5%8D%95%E4%BD%8D%E5%B7%A5%E5%8E%82&amp;diff=2586&amp;oldid=prev</id>
		<title>硫缺铅：​创建页面，内容为“&lt;span id=&quot;单位武器能力单位工厂&quot;&gt;&lt;/span&gt; = 单位、武器、能力、单位工厂 =  单位是 Mindustry 的另一条“制造链”。JSON 里单位由 &lt;code&gt;UnitType&lt;/code&gt; 定义，武器由 &lt;code&gt;Weapon&lt;/code&gt; 定义，能力由 &lt;code&gt;Ability&lt;/code&gt; 定义，产出单位的建筑则由单位工厂、重构厂和组装厂负责。理解这些结构以后，单位制作会变成“参数组合”的游戏。  &lt;span id=&quot;unittype-的核心字段&quot;&gt;&lt;/sp…”</title>
		<link rel="alternate" type="text/html" href="https://mdtwiki.top/index.php?title=JSON%E6%A8%A1%E7%BB%84%E6%95%99%E7%A8%8B-%E5%8D%95%E4%BD%8D%E3%80%81%E6%AD%A6%E5%99%A8%E3%80%81%E8%83%BD%E5%8A%9B%E3%80%81%E5%8D%95%E4%BD%8D%E5%B7%A5%E5%8E%82&amp;diff=2586&amp;oldid=prev"/>
		<updated>2026-02-01T13:34:18Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“&amp;lt;span id=&amp;quot;单位武器能力单位工厂&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; = 单位、武器、能力、单位工厂 =  单位是 Mindustry 的另一条“制造链”。JSON 里单位由 &amp;lt;code&amp;gt;UnitType&amp;lt;/code&amp;gt; 定义，武器由 &amp;lt;code&amp;gt;Weapon&amp;lt;/code&amp;gt; 定义，能力由 &amp;lt;code&amp;gt;Ability&amp;lt;/code&amp;gt; 定义，产出单位的建筑则由单位工厂、重构厂和组装厂负责。理解这些结构以后，单位制作会变成“参数组合”的游戏。  &amp;lt;span id=&amp;quot;unittype-的核心字段&amp;quot;&amp;gt;&amp;lt;/sp…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;span id=&amp;quot;单位武器能力单位工厂&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= 单位、武器、能力、单位工厂 =&lt;br /&gt;
&lt;br /&gt;
单位是 Mindustry 的另一条“制造链”。JSON 里单位由 &amp;lt;code&amp;gt;UnitType&amp;lt;/code&amp;gt; 定义，武器由 &amp;lt;code&amp;gt;Weapon&amp;lt;/code&amp;gt; 定义，能力由 &amp;lt;code&amp;gt;Ability&amp;lt;/code&amp;gt; 定义，产出单位的建筑则由单位工厂、重构厂和组装厂负责。理解这些结构以后，单位制作会变成“参数组合”的游戏。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;unittype-的核心字段&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== UnitType 的核心字段 ==&lt;br /&gt;
&lt;br /&gt;
单位 JSON 文件位于 &amp;lt;code&amp;gt;content/units&amp;lt;/code&amp;gt;。&amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; 决定单位的实体构造器，也就是“移动与碰撞的底层行为”。可用值包括 &amp;lt;code&amp;gt;flying&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;mech&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;legs&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;naval&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;payload&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;missile&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;tank&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;hover&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;tether&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;crawl&amp;lt;/code&amp;gt;。例如“星辉”“天垠”属于 &amp;lt;code&amp;gt;flying&amp;lt;/code&amp;gt;，“战锤”“爬虫”属于 &amp;lt;code&amp;gt;mech&amp;lt;/code&amp;gt;，“天蝎”“死星”属于 &amp;lt;code&amp;gt;legs&amp;lt;/code&amp;gt;，“梭鱼”“蛟龙”属于 &amp;lt;code&amp;gt;naval&amp;lt;/code&amp;gt;，“巨像”“雷霆”“要塞”属于 &amp;lt;code&amp;gt;payload&amp;lt;/code&amp;gt;，“围护”“征服”属于 &amp;lt;code&amp;gt;tank&amp;lt;/code&amp;gt;。&amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; 只是构造器，真正是否飞行还要看 &amp;lt;code&amp;gt;flying&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;lowAltitude&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;hovering&amp;lt;/code&amp;gt; 等字段的组合，因此建议先对照原版单位理解差异。&lt;br /&gt;
&lt;br /&gt;
基础运动字段包括 &amp;lt;code&amp;gt;speed&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;accel&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;drag&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;rotateSpeed&amp;lt;/code&amp;gt;。&amp;lt;code&amp;gt;speed&amp;lt;/code&amp;gt; 决定最大移动速度，&amp;lt;code&amp;gt;accel&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;drag&amp;lt;/code&amp;gt; 决定起步与刹车的手感，&amp;lt;code&amp;gt;rotateSpeed&amp;lt;/code&amp;gt; 决定转向速度。&amp;lt;code&amp;gt;hitSize&amp;lt;/code&amp;gt; 影响单位的碰撞体积与受击范围，&amp;lt;code&amp;gt;health&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;armor&amp;lt;/code&amp;gt; 决定生存能力。&amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; 通常用于 AI 选择射程范围，如果写成负数会自动根据武器计算；这意味着你只要武器配置合理，&amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; 可以不写。&lt;br /&gt;
&lt;br /&gt;
采矿与建造能力由 &amp;lt;code&amp;gt;mineTier&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;mineSpeed&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;buildSpeed&amp;lt;/code&amp;gt; 控制。&amp;lt;code&amp;gt;mineTier&amp;lt;/code&amp;gt; 对应可开采的硬度等级，&amp;lt;code&amp;gt;mineSpeed&amp;lt;/code&amp;gt; 决定采矿速度，&amp;lt;code&amp;gt;buildSpeed&amp;lt;/code&amp;gt; 决定建造与修复速度。&amp;lt;code&amp;gt;itemCapacity&amp;lt;/code&amp;gt; 决定携带物品的容量，&amp;lt;code&amp;gt;payloadCapacity&amp;lt;/code&amp;gt; 决定载荷容量，后者常见于“巨像”这类载荷单位。&amp;lt;code&amp;gt;targetAir&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;targetGround&amp;lt;/code&amp;gt; 控制自动索敌类型，&amp;lt;code&amp;gt;faceTarget&amp;lt;/code&amp;gt; 决定单位是否转向目标，&amp;lt;code&amp;gt;omniMovement&amp;lt;/code&amp;gt; 则影响是否允许“全向移动”。&lt;br /&gt;
&lt;br /&gt;
视觉与表现方面，&amp;lt;code&amp;gt;engineOffset&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;engineSize&amp;lt;/code&amp;gt; 决定引擎喷口位置和大小，&amp;lt;code&amp;gt;trailLength&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;trailColor&amp;lt;/code&amp;gt; 决定尾迹长度与颜色。声音相关字段包括 &amp;lt;code&amp;gt;deathSound&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;loopSound&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;moveSound&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;stepSound&amp;lt;/code&amp;gt; 等，用于塑造单位的体感。&amp;lt;code&amp;gt;drawCell&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;drawShields&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;drawItems&amp;lt;/code&amp;gt; 等字段控制 UI 与渲染细节。&lt;br /&gt;
&lt;br /&gt;
还有一些“规则型”的字段容易被忽略。&amp;lt;code&amp;gt;logicControllable&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;playerControllable&amp;lt;/code&amp;gt; 决定单位能否被处理器或玩家直接控制，&amp;lt;code&amp;gt;useUnitCap&amp;lt;/code&amp;gt; 决定是否受单位上限限制，&amp;lt;code&amp;gt;hittable&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;targetable&amp;lt;/code&amp;gt; 决定能否被命中或锁定，&amp;lt;code&amp;gt;allowedInPayloads&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;pickupUnits&amp;lt;/code&amp;gt; 则影响载荷交互。这些字段不会直接改变伤害，但会极大改变单位在战役中的定位，比如“不可选中但可伤害”的单位往往用于剧情或特殊机制。&lt;br /&gt;
&lt;br /&gt;
=== 一个最小单位示例 ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;文件：content/units/tutorial-unit.json&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;flying&amp;quot;,&lt;br /&gt;
    &amp;quot;name&amp;quot;: &amp;quot;示例单位&amp;quot;,&lt;br /&gt;
    &amp;quot;description&amp;quot;: &amp;quot;最基础的飞行单位。&amp;quot;,&lt;br /&gt;
    &amp;quot;speed&amp;quot;: 2.6,&lt;br /&gt;
    &amp;quot;health&amp;quot;: 120,&lt;br /&gt;
    &amp;quot;hitSize&amp;quot;: 8,&lt;br /&gt;
    &amp;quot;flying&amp;quot;: true,&lt;br /&gt;
    &amp;quot;weapons&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;name&amp;quot;: &amp;quot;tutorial-weapon&amp;quot;,&lt;br /&gt;
            &amp;quot;reload&amp;quot;: 25,&lt;br /&gt;
            &amp;quot;x&amp;quot;: 3,&lt;br /&gt;
            &amp;quot;y&amp;quot;: 1,&lt;br /&gt;
            &amp;quot;bullet&amp;quot;: {&lt;br /&gt;
                &amp;quot;type&amp;quot;: &amp;quot;BasicBulletType&amp;quot;,&lt;br /&gt;
                &amp;quot;speed&amp;quot;: 2.5,&lt;br /&gt;
                &amp;quot;damage&amp;quot;: 9,&lt;br /&gt;
                &amp;quot;lifetime&amp;quot;: 60&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
这个单位选择了 &amp;lt;code&amp;gt;flying&amp;lt;/code&amp;gt; 构造器，并显式设置 &amp;lt;code&amp;gt;flying: true&amp;lt;/code&amp;gt;。武器字段直接写在 &amp;lt;code&amp;gt;weapons&amp;lt;/code&amp;gt; 数组里，&amp;lt;code&amp;gt;reload&amp;lt;/code&amp;gt; 是装填时间，&amp;lt;code&amp;gt;x/y&amp;lt;/code&amp;gt; 是武器挂点位置。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;武器weapon&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== 武器（Weapon） ==&lt;br /&gt;
&lt;br /&gt;
单位武器与炮塔非常相似，但更强调“挂载位置”和“开火方式”。&amp;lt;code&amp;gt;x/y&amp;lt;/code&amp;gt; 决定武器挂点位置，&amp;lt;code&amp;gt;shootX/shootY&amp;lt;/code&amp;gt; 决定枪口位置，&amp;lt;code&amp;gt;mirror&amp;lt;/code&amp;gt; 决定是否左右镜像复制，&amp;lt;code&amp;gt;rotate&amp;lt;/code&amp;gt; 决定武器是否随单位旋转，&amp;lt;code&amp;gt;top&amp;lt;/code&amp;gt; 决定绘制层级。射击节奏由 &amp;lt;code&amp;gt;reload&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;shootCone&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;inaccuracy&amp;lt;/code&amp;gt; 决定，若需要一次多发或延迟开火，可以写 &amp;lt;code&amp;gt;shoot&amp;lt;/code&amp;gt; 子对象（如 &amp;lt;code&amp;gt;shots&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;shotDelay&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;firstShotDelay&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;spread&amp;lt;/code&amp;gt;）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bullet&amp;lt;/code&amp;gt; 字段决定子弹类型与属性，写法与炮塔完全一致。武器贴图默认使用 &amp;lt;code&amp;gt;weapon-name.png&amp;lt;/code&amp;gt;，热量贴图为 &amp;lt;code&amp;gt;-heat&amp;lt;/code&amp;gt;，数据库预览图为 &amp;lt;code&amp;gt;-preview&amp;lt;/code&amp;gt;。如果你的单位有多门武器，记得给不同武器取不同 &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;，以免贴图冲突。&lt;br /&gt;
&lt;br /&gt;
单位武器还有一组更偏“行为”的字段。&amp;lt;code&amp;gt;alternate&amp;lt;/code&amp;gt; 控制左右武器是否交替射击，&amp;lt;code&amp;gt;continuous&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;alwaysContinuous&amp;lt;/code&amp;gt; 决定是否持续发射（常用于持续激光或喷流）。&amp;lt;code&amp;gt;shootStatus&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;shootStatusDuration&amp;lt;/code&amp;gt; 可以让单位在开火时给自己施加状态，例如短暂的护盾或加速；&amp;lt;code&amp;gt;ejectEffect&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;parentizeEffects&amp;lt;/code&amp;gt; 则分别控制弹壳特效与特效跟随，让枪口表现更自然。对于高速或持续火力单位，这些字段常常比单纯堆 &amp;lt;code&amp;gt;damage&amp;lt;/code&amp;gt; 更能体现风格。&lt;br /&gt;
&lt;br /&gt;
武器也支持 &amp;lt;code&amp;gt;parts&amp;lt;/code&amp;gt;（&amp;lt;code&amp;gt;DrawPart&amp;lt;/code&amp;gt;）来做局部动画，和炮塔的用法几乎一致。你可以用 &amp;lt;code&amp;gt;reload&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;warmup&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;recoil&amp;lt;/code&amp;gt; 等进度驱动枪口位移、光效或外壳开合，配合 &amp;lt;code&amp;gt;shootX/shootY&amp;lt;/code&amp;gt; 微调出射位置。对于多武器单位，每个武器都能独立配置部件动画，这能显著提升“机体层次感”。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;能力ability&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== 能力（Ability） ==&lt;br /&gt;
&lt;br /&gt;
Ability 是单位的“额外技能”，更新频率与单位一致。常见类型包括 &amp;lt;code&amp;gt;ForceFieldAbility&amp;lt;/code&amp;gt;（护盾）、&amp;lt;code&amp;gt;RepairFieldAbility&amp;lt;/code&amp;gt;（修复场）、&amp;lt;code&amp;gt;MoveEffectAbility&amp;lt;/code&amp;gt;（移动特效）、&amp;lt;code&amp;gt;StatusFieldAbility&amp;lt;/code&amp;gt;（范围状态）、&amp;lt;code&amp;gt;UnitSpawnAbility&amp;lt;/code&amp;gt;（生成单位）、&amp;lt;code&amp;gt;ShieldRegenFieldAbility&amp;lt;/code&amp;gt;（范围护盾回复）等。它们通常有自己的半径、回复速率、间隔时间等字段。Ability 不一定改变武器数值，但会改变单位的战场定位，因此比你想象中更“决定风格”。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;abilities&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;ForceFieldAbility&amp;quot;,&lt;br /&gt;
        &amp;quot;radius&amp;quot;: 20,&lt;br /&gt;
        &amp;quot;regen&amp;quot;: 0.2,&lt;br /&gt;
        &amp;quot;max&amp;quot;: 80&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/pre&amp;gt;&lt;br /&gt;
如果你希望某个单位承担辅助职责，比如“战斗修复”或“范围增益”，Ability 往往比新增武器更合适。&lt;br /&gt;
&lt;br /&gt;
Ability 的参数通常围绕“范围、频率、强度”展开。以 &amp;lt;code&amp;gt;RepairFieldAbility&amp;lt;/code&amp;gt; 为例，它会有 &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;reload&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt; 来控制修复范围、间隔与数值；&amp;lt;code&amp;gt;StatusFieldAbility&amp;lt;/code&amp;gt; 则需要 &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;duration&amp;lt;/code&amp;gt; 来指定范围状态。能力不消耗弹药，但会叠加在单位的“战略定位”上，尤其是支援单位，能力强弱往往比武器伤害更重要。&lt;br /&gt;
&lt;br /&gt;
== 数值与定位的关系 ==&lt;br /&gt;
&lt;br /&gt;
单位设计中最重要的是“定位”。高 &amp;lt;code&amp;gt;speed&amp;lt;/code&amp;gt; 的单位通常承担侦察或骚扰角色，但它们不一定需要高伤害；高 &amp;lt;code&amp;gt;health&amp;lt;/code&amp;gt; 与高 &amp;lt;code&amp;gt;armor&amp;lt;/code&amp;gt; 的单位则更适合抗线与拆建筑。&amp;lt;code&amp;gt;hitSize&amp;lt;/code&amp;gt; 影响命中概率与碰撞体积，过大的 &amp;lt;code&amp;gt;hitSize&amp;lt;/code&amp;gt; 会让单位更容易被集火。&amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; 与武器射程一致时，AI 会更愿意停在安全距离输出；如果 &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; 过短，单位会更靠近目标，可能导致“高伤害单位冲脸”的意外行为。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mineRange&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;buildRange&amp;lt;/code&amp;gt; 决定采矿与建造距离。对于“独影”“幻型”这类支援单位，合理的 &amp;lt;code&amp;gt;buildRange&amp;lt;/code&amp;gt; 能显著提升它们的修复效率；对“阿尔法”“贝塔”“伽马”这种核心单位而言，&amp;lt;code&amp;gt;mineRange&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;mineTier&amp;lt;/code&amp;gt; 的匹配更重要，否则会出现“能飞到矿上却挖不动”的问题。&lt;br /&gt;
&lt;br /&gt;
采矿单位还要关注 &amp;lt;code&amp;gt;mineSpeed&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;itemCapacity&amp;lt;/code&amp;gt; 的配合。&amp;lt;code&amp;gt;mineSpeed&amp;lt;/code&amp;gt; 决定单位采一件矿的速度，但如果 &amp;lt;code&amp;gt;itemCapacity&amp;lt;/code&amp;gt; 很小，单位会频繁往返核心，实际效率反而下降。设计时可以先确定“预期的运输半径”，再决定 &amp;lt;code&amp;gt;mineSpeed&amp;lt;/code&amp;gt; 与容量，让玩家感觉“这台单位就是为某种矿而生”。&lt;br /&gt;
&lt;br /&gt;
视觉与声音字段虽然不影响数值，但会影响玩家判断。例如 &amp;lt;code&amp;gt;engineSize&amp;lt;/code&amp;gt; 很小的飞行单位会显得“轻量”，&amp;lt;code&amp;gt;trailLength&amp;lt;/code&amp;gt; 较长的单位更容易被玩家注意到。你可以把这些作为“风格刻画”的工具，而不是简单的装饰。&lt;br /&gt;
&lt;br /&gt;
== 单位的弹药与资源 ==&lt;br /&gt;
&lt;br /&gt;
单位也可以有弹药系统。&amp;lt;code&amp;gt;ammoType&amp;lt;/code&amp;gt; 决定单位使用的弹药类型，&amp;lt;code&amp;gt;ammoCapacity&amp;lt;/code&amp;gt; 决定弹药容量，&amp;lt;code&amp;gt;ammoType&amp;lt;/code&amp;gt; 可以是物品或电力。许多“重装单位”会用物品弹药以限制持续火力，而“支援单位”则更倾向于电力弹药以减少物流压力。&amp;lt;code&amp;gt;itemCapacity&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;payloadCapacity&amp;lt;/code&amp;gt; 决定单位能携带多少物品或载荷，这会直接影响它在战场上的“后勤价值”。例如大载荷单位不仅能搬运方块，还能承担“机动建造”的角色。&lt;br /&gt;
&lt;br /&gt;
如果你希望单位有明显的“供给需求”，就把 &amp;lt;code&amp;gt;ammoType&amp;lt;/code&amp;gt; 指向某种稀缺物品，并给它较大的 &amp;lt;code&amp;gt;ammoCapacity&amp;lt;/code&amp;gt;。这样单位的持续作战能力就会依赖你的运输体系，而不是单纯的数值堆叠。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;模组示例饱和火力-3.3.0-的雷鸣&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== 模组示例：饱和火力 3.3.0 的“雷鸣” ==&lt;br /&gt;
&lt;br /&gt;
“雷鸣”是一个使用电力弹药的飞行单位，它把 &amp;lt;code&amp;gt;ammoType&amp;lt;/code&amp;gt; 写成对象形式，并在武器上使用 &amp;lt;code&amp;gt;shootWarmupSpeed&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;minWarmup&amp;lt;/code&amp;gt; 做出“预热开火”的节奏，同时用 &amp;lt;code&amp;gt;shootStatus&amp;lt;/code&amp;gt; 给自己短暂加成：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;flying&amp;quot;,&lt;br /&gt;
    &amp;quot;name&amp;quot;: &amp;quot;雷鸣&amp;quot;,&lt;br /&gt;
    &amp;quot;ammoType&amp;quot;: {&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;PowerAmmoType&amp;quot;,&lt;br /&gt;
        &amp;quot;totalPower&amp;quot;: 8000&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;ammoCapacity&amp;quot;: 60,&lt;br /&gt;
    &amp;quot;weapons&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;name&amp;quot;: &amp;quot;雷鸣1&amp;quot;,&lt;br /&gt;
            &amp;quot;shootWarmupSpeed&amp;quot;: 0.13,&lt;br /&gt;
            &amp;quot;minWarmup&amp;quot;: 0.9,&lt;br /&gt;
            &amp;quot;shootStatus&amp;quot;: &amp;quot;shielded&amp;quot;,&lt;br /&gt;
            &amp;quot;shootStatusDuration&amp;quot;: 50&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
这个片段说明了两件事：一是电力弹药适合做“高持续但后勤轻量”的单位；二是预热与自我状态可以让单位的输出节奏更有层次，而不是单纯堆数值。&lt;br /&gt;
&lt;br /&gt;
需要注意的是，电力弹药本质上仍依赖电网或能源补给，战役中断电时这类单位会明显“掉火力”，设计时要预留补能途径。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;ai-与行为控制&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== AI 与行为控制 ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;aiController&amp;lt;/code&amp;gt; 可以指定单位的默认 AI 控制器，它通常是一个类名，例如 &amp;lt;code&amp;gt;FlyingAI&amp;lt;/code&amp;gt; 或 &amp;lt;code&amp;gt;GroundAI&amp;lt;/code&amp;gt;。&amp;lt;code&amp;gt;defaultController&amp;lt;/code&amp;gt; 则用于覆盖更底层的控制器选择。实际运行时，单位会根据是否可被玩家控制、是否属于 AI 队伍等条件决定最终控制器，因此你在 JSON 里指定的 AI 只是“默认策略”。如果你需要完全自定义的行为，就必须转向 Java。&lt;br /&gt;
&lt;br /&gt;
如果你把 &amp;lt;code&amp;gt;playerControllable&amp;lt;/code&amp;gt; 设为 &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;，单位将无法被玩家直接控制；&amp;lt;code&amp;gt;logicControllable&amp;lt;/code&amp;gt; 设为 &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; 则会阻止处理器接管。对剧情单位或 Boss 来说，这能避免玩家“抢走”单位，但也意味着 AI 表现必须足够可靠。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;单位工厂重构厂与组装厂&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== 单位工厂、重构厂与组装厂 ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;UnitFactory&amp;lt;/code&amp;gt; 负责“直接生产单位”。每条 &amp;lt;code&amp;gt;plan&amp;lt;/code&amp;gt; 都包含 &amp;lt;code&amp;gt;unit&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;time&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;requirements&amp;lt;/code&amp;gt;（物品堆栈），工厂从传送带或卸货口取物品，完成后直接出厂。&amp;lt;code&amp;gt;Reconstructor&amp;lt;/code&amp;gt; 负责“升级单位”，需要指定 &amp;lt;code&amp;gt;previous&amp;lt;/code&amp;gt; 作为前置单位，并消耗物品与时间来完成升级。&amp;lt;code&amp;gt;UnitAssembler&amp;lt;/code&amp;gt; 则走“载荷 + 模块”的路线：它需要载荷输入，并常与 &amp;lt;code&amp;gt;UnitAssemblerModule&amp;lt;/code&amp;gt; 搭配扩展阶级，同时依赖无人机完成组装。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;UnitAssembler&amp;lt;/code&amp;gt; 的 &amp;lt;code&amp;gt;plans&amp;lt;/code&amp;gt; 是 &amp;lt;code&amp;gt;AssemblerUnitPlan&amp;lt;/code&amp;gt; 数组，每条计划除了 &amp;lt;code&amp;gt;unit&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;time&amp;lt;/code&amp;gt; 外，还能写 &amp;lt;code&amp;gt;requirements&amp;lt;/code&amp;gt;（载荷堆栈）、&amp;lt;code&amp;gt;itemReq&amp;lt;/code&amp;gt;（物品消耗）、&amp;lt;code&amp;gt;liquidReq&amp;lt;/code&amp;gt;（液体消耗）。&amp;lt;code&amp;gt;droneType&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;dronesCreated&amp;lt;/code&amp;gt;、&amp;lt;code&amp;gt;droneConstructTime&amp;lt;/code&amp;gt; 共同决定无人机的构建与装配节奏。相比之下，&amp;lt;code&amp;gt;UnitFactory&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;Reconstructor&amp;lt;/code&amp;gt; 更像“单体方块”，配置直观；&amp;lt;code&amp;gt;UnitAssembler&amp;lt;/code&amp;gt; 更像“工厂线”，需要你理解载荷口对齐、模块位置与装配流程。&lt;br /&gt;
&lt;br /&gt;
== 生产链的设计思路 ==&lt;br /&gt;
&lt;br /&gt;
单位生产链并不只是“做一个工厂就结束”。如果你把单位的 &amp;lt;code&amp;gt;requirements&amp;lt;/code&amp;gt; 写得过于昂贵，就会导致它们只能在后期登场；写得过于廉价，则会让战役或生存失衡。原版的“陆军工厂”“空军工厂”“海军工厂”提供的是“基础单位”，而“数增级单位重构工厂”等重构厂负责“阶级跃迁”。这套结构实际上在引导玩家逐步升级单位强度，同时也在限制战场单位的数量。&lt;br /&gt;
&lt;br /&gt;
设计自定义单位时，可以先决定它处于哪一层：是基础单位、重构升级单位，还是装配厂产物。基础单位应该成本可控、数量可量产；重构单位可以更强但应有明显投入；装配单位则适合“高价值、高稀有度”。这样设计出的单位链条更容易被玩家理解。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;模组示例饱和火力-3.3.0-的重构链&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== 模组示例：饱和火力 3.3.0 的重构链 ==&lt;br /&gt;
&lt;br /&gt;
“反击”是一台 &amp;lt;code&amp;gt;tank&amp;lt;/code&amp;gt; 单位，它通过 &amp;lt;code&amp;gt;requirements&amp;lt;/code&amp;gt; 挂在重构厂上，并指定了 &amp;lt;code&amp;gt;previous&amp;lt;/code&amp;gt;。这意味着它不是基础工厂直接生产的单位，而是由前一阶单位升级而来。下面是该单位的节选：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;tank&amp;quot;,&lt;br /&gt;
    &amp;quot;name&amp;quot;: &amp;quot;反击&amp;quot;,&lt;br /&gt;
    &amp;quot;health&amp;quot;: 25600,&lt;br /&gt;
    &amp;quot;armor&amp;quot;: 30,&lt;br /&gt;
    &amp;quot;ammoType&amp;quot;: &amp;quot;surge-alloy&amp;quot;,&lt;br /&gt;
    &amp;quot;ammoCapacity&amp;quot;: 120,&lt;br /&gt;
    &amp;quot;immunities&amp;quot;: [&amp;quot;burning&amp;quot;, &amp;quot;shocked&amp;quot;],&lt;br /&gt;
    &amp;quot;requirements&amp;quot;: {&lt;br /&gt;
        &amp;quot;block&amp;quot;: &amp;quot;exponential-reconstructor&amp;quot;,&lt;br /&gt;
        &amp;quot;previous&amp;quot;: &amp;quot;陆3&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
这个例子体现了“单位强度靠重构链提升”的思路。通过 &amp;lt;code&amp;gt;previous&amp;lt;/code&amp;gt; 串联，你可以清晰地控制升级路径，而不用让高阶单位直接出现在基础工厂里。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;模组示例饱和火力-3.3.0-的组装厂计划&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== 模组示例：饱和火力 3.3.0 的组装厂计划 ==&lt;br /&gt;
&lt;br /&gt;
“悬浮战争工厂”是一个 &amp;lt;code&amp;gt;UnitAssembler&amp;lt;/code&amp;gt;，它在 &amp;lt;code&amp;gt;plans&amp;lt;/code&amp;gt; 中同时使用 &amp;lt;code&amp;gt;requirements&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;liquidReq&amp;lt;/code&amp;gt;，并通过 &amp;lt;code&amp;gt;droneType&amp;lt;/code&amp;gt; 指定组装无人机。这个结构展示了“载荷 + 液体”双输入的写法：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;UnitAssembler&amp;quot;,&lt;br /&gt;
    &amp;quot;name&amp;quot;: &amp;quot;悬浮战争工厂&amp;quot;,&lt;br /&gt;
    &amp;quot;plans&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;unit&amp;quot;: &amp;quot;竭泽&amp;quot;,&lt;br /&gt;
            &amp;quot;time&amp;quot;: 4200,&lt;br /&gt;
            &amp;quot;requirements&amp;quot;: [&amp;quot;饱和火力-基础收容块/6&amp;quot;],&lt;br /&gt;
            &amp;quot;liquidReq&amp;quot;: [&amp;quot;cryofluid/0.6&amp;quot;]&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;droneType&amp;quot;: &amp;quot;组装机&amp;quot;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
在这种结构里，&amp;lt;code&amp;gt;requirements&amp;lt;/code&amp;gt; 不再是物品，而是载荷堆栈。你需要确保载荷输入方向与装配口一致，否则装配会一直卡住。对比 &amp;lt;code&amp;gt;UnitFactory&amp;lt;/code&amp;gt; 的“传送带输入”，组装厂更强调布局和物流规划。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;单位文件里的-requirements&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== 单位文件里的 requirements ==&lt;br /&gt;
&lt;br /&gt;
在单位 JSON 中写 &amp;lt;code&amp;gt;requirements&amp;lt;/code&amp;gt; 并不是设置“单位本体材料”，而是把单位挂到某个工厂或重构厂。结构如下：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;requirements&amp;quot;: {&lt;br /&gt;
    &amp;quot;block&amp;quot;: &amp;quot;ground-factory&amp;quot;,&lt;br /&gt;
    &amp;quot;requirements&amp;quot;: [&amp;quot;silicon/10&amp;quot;, &amp;quot;lead/10&amp;quot;],&lt;br /&gt;
    &amp;quot;time&amp;quot;: 900&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;block&amp;lt;/code&amp;gt; 是所属工厂或重构厂的内部名，&amp;lt;code&amp;gt;requirements&amp;lt;/code&amp;gt; 是该配方的物品消耗，&amp;lt;code&amp;gt;time&amp;lt;/code&amp;gt; 是制造时间，&amp;lt;code&amp;gt;previous&amp;lt;/code&amp;gt; 则用于重构厂的升级链。注意：这种 &amp;lt;code&amp;gt;requirements&amp;lt;/code&amp;gt; 只对 &amp;lt;code&amp;gt;UnitFactory&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;Reconstructor&amp;lt;/code&amp;gt; 生效，无法把单位自动挂到 &amp;lt;code&amp;gt;UnitAssembler&amp;lt;/code&amp;gt;。原版中“陆军工厂”“空军工厂”“海军工厂”与“数增级单位重构工厂”是最典型的参考对象。&lt;br /&gt;
&lt;br /&gt;
== 小结 ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; 决定单位底层行为，&amp;lt;code&amp;gt;weapons&amp;lt;/code&amp;gt; 与 &amp;lt;code&amp;gt;abilities&amp;lt;/code&amp;gt; 决定战斗风格，&amp;lt;code&amp;gt;requirements&amp;lt;/code&amp;gt; 决定生产链挂载方式。先理解原版单位与工厂的规则，再去配置自己的单位，会顺手很多。&lt;/div&gt;</summary>
		<author><name>硫缺铅</name></author>
	</entry>
</feed>