常见修改 · Cookbook

这一页只讲最常见的两种 CD2 改动——让虫变多/变少、从难度里删掉某类敌人。都是最小改动,放进你自己的难度文件对应位置即可使用(下面给的是片段,不是完整文件)。

来源与实测状态:前 2 条译自上游 Common Edits;后 6 条的字段与示例取自本站 Reference,尚未在游戏内逐条实测——若实际表现与这里不一致,以 Reference 与实际游戏行为为准。

增加或减少敌人数量 · Increase or decrease the number of enemies

如果你喜欢某个难度,但觉得敌人太多或太少,只要一处极简单的改动就能按你的口味调整:找到 DifficultySetting 里的 EnemyCountModifier(下称 ECM)。ECM 是这个难度的全局敌人数量倍率,可以理解为整体放大或缩小虫量——想调大就调大、想调小就调小。下面这段来自 Hazard 6x2:

英文原文

If you enjoy a certain difficulty file but you think the number of enemies is either too small or too big, you can modify it to your taste with a very simple edit: look for the EnemyCountModifier (ECM) field inside DifficultySetting. The ECM works as a global multiplier for all spawn events in the difficulty, so you just need to increase it or decrease it however you like. As an example, the following snippet is from Hazard 6x2:

json
...,
"DifficultySetting": {
        "EnemyCountModifier": [
            2,
            2.1,
            2.7,
            3.3
        ]
}
...,

如果你的目标只是把 Hazard 6x2 的 ECM 整体翻倍,可以改成:

英文原文

so if we wanted to create Hazard 6x4 we would double these values:

json
...,
"DifficultySetting": {
        "EnemyCountModifier": [
            4,
            4.2,
            5.4,
            6.6
        ]
}
...,

注意:这只是调整 ECM,并不等于完整定义一个「Hazard 6x4」的全部难度配置。

想要多少敌人,还取决于 Caps 里的 MaxActiveEnemies 上限:

英文原文

Depending on how many enemies you want to get you might have to edit also the MaxActiveEnemies cap in Caps:

json
...,
"Caps": {
        "MaxActiveCritters": 40,
        "MaxActiveSwarmers": [
            60,
            120,
            180,
            180
        ],
        "MaxActiveEnemies": [
            100,
            120,
            180,
            180
        ]
    }
...,

当一局任务里的敌人数量超过 MaxActiveEnemies 时,游戏会 despawn 掉一部分——不过这个行为目前还没有被完全弄明白。另外要有心理准备:提高敌人上限会拖低帧率,不建议超过 300。

英文原文

When the number of enemies in a mission goes above MaxActiveEnemies the game will despawn some of them, although this behaviour is not completely understood. Take into account that increasing the enemy cap will negatively affect the frame rate and going above 300 is not recommended.

没生效?见 Debug · 完全没有变化 | 想深入了解:模块虫量上限 Caps模块难度设置 DifficultySetting

从难度里移除原版敌人 · Removing vanilla enemies from a difficulty

你是独狼、讨厌 Stingtail 或 Stalker?还是想从盐坑(Salt Pits)里去掉 younglings?这是最常见的修改之一,而且非常容易。你需要两样东西:

英文原文

Are you a solo player that hates stingtails or stalkers? Or maybe you want to remove younglings from Salt Pits? This is one of the most common edits and it's really easy to do. You will need two things:

Pools 的 Remove 是从原有怪池中移除敌人,所以你得先知道这个敌人原本属于哪个池,才能改对地方。

第一项查 Resources 页的描述符表——举例,想移除 Stalker,你需要 ED_Spider_Stalker。第二项,在下表里找到你的敌人(这张表不算完整):

英文原文

For the first, check the table in Resources. As an example, if you wanted to remove stalkers the name you'd need is ED_Spider_Stalker. For the second, locate your enemy in the following (slightly incomplete) table:

Pool
怪池
Pools module field
模块字段
Enemies
默认敌人(示例)
Common Pool
常见池
CommonEnemies Grunts, Praetorians
Disruptor Pool
破坏性敌人池
DisruptiveEnemies Menaces, Wardens, Bulk Detonators, Stingtails, Shellbacks, Grabbers, Goo Bombers, Stalkers
Special Pool
特殊敌人池
SpecialEnemies Swarmers, Exploders, Web Spitters, Acid Spitters, Septic Spreaders, Mactera Spawns and Trijaws
Stationary Pool
固定敌人池
StationaryPool Breeders, Swarmer Nexii, Spitballers, Cave Leech, Barragers, Vartok Scalebramble

注意:上表只是常见敌人的示例,不是完整的敌人数据库;敌人名保持英文,与 Resources 页的描述符表一致。

知道它原本在哪个池之后,把它移除就行。例如从一个难度里移除 Stalker 和 Septic(ED_Spider_Lobber = Glyphid Septic Spreader):

英文原文

Once you know the original pool where your enemy is, just remove it. For example, removing stalkers and septics from a difficulty:

json
...,
"Pools": {
    "DisruptiveEnemies": {
        "Remove": ["ED_Spider_Stalker"]
    },
    "SpecialEnemies": {
        "Remove": ["ED_Spider_Lobber"]
    }
}
...,

没生效?见 Debug · 效果和想象不一样 | 想深入了解:模块怪池 PoolsResources敌人描述符表

修改补给成本 · Resupply cost

目标:改一次补给要花多少硝石。放在哪:顶层模块 Resupply。

json
{
    "Resupply": {
        "Cost": 40
    }
}

这段代码做了什么:把一次补给的硝石消耗设成 40。

字段填什么作用
Cost浮点数一次补给消耗的硝石数;它也可以接 Mutator 动态变化

可以怎么改:Cost 能直接接一个 Mutator。比如「第一次补给免费,之后每次 40」:

json
{
    "Resupply": {
        "Cost": {
            "Mutate": "ByResuppliesCalled",
            "Values": [0, 40]
        }
    }
}

没生效?见 Debug · 完全没有变化 | 想深入了解:模块补给 ResupplyMutator根据呼叫补给次数

按玩家人数缩放难度 · By player count

目标:同一个值,1 人时用一个数、2 人时用另一个数。放在哪:任何接受数字的字段都能直接写数组。

json
{
    "Caps": {
        "MaxActiveEnemies": [90, 120, 180, 180]
    }
}

这段代码做了什么:1 人时上限 90,2 人 120,3 人 180,4 人及以上 180——人数超过数组长度时,用最后一个值。

写法什么时候用说明
数组 [90, 120, 180, 180]字段本身就是数字最省事:抽取第 N 个值,N = 玩家人数
ByPlayerCount Mutator要把它嵌进别的 Mutator 里返回第 N 个值,返回类型取决于你填了什么

可以怎么改:想在 Mutator 内部按人数取值时,写 {"Mutate": "ByPlayerCount", "Values": [80, 120, 180, 180]}。

没生效?见 Debug · Mutator 不工作或报错(单人测试时很容易误判) | 想深入了解:Mutator根据玩家数量基础部分难度文件要求

调整地图硝石数量 · Nitra on the map

目标:让地图上长出来的硝石变多或变少。放在哪:顶层模块 NitraMultiplier。

json
{
    "NitraMultiplier": 2
}

这段代码做了什么:地图生成的硝石变成 2 倍。默认值是 1。

字段填什么作用
NitraMultiplier浮点数地图硝石数量的倍率,默认 1

可以怎么改:它是个普通数字字段,所以也能写数组(按人数)或接 Mutator——例如「完成次要目标后硝石加成」。

没生效?见 Debug · 完全没有变化 | 想深入了解:模块NitraMultiplier

修改矮人属性 · Dwarves

目标:改与玩家自身有关的参数(体型、摔落伤害、回血)。放在哪:顶层模块 Dwarves。

json
{
    "Dwarves": {
        "Scale": 1.5
    }
}

这段代码做了什么:把玩家体型放大到 1.5 倍。

字段默认作用
Scale—玩家体型比例
FallDamageModifier0.175摔落伤害倍率
FallDamageStartVelocity1000开始计算摔落伤害的速度
RegenHealthPerSecond—每秒回复血量
RegenDelayAfterDamage—受致命伤后回复延迟

可以怎么改:把 FallDamageModifier 调到 0.05,摔落伤害就只剩不到三分之一;配合 FallDamageStartVelocity 调高,可以做出「摔得更狠才受伤」。

没生效?见 Debug · 完全没有变化 | 想深入了解:模块矮人属性 Dwarves

给某类敌人改属性 · Enemies

目标:单独改某一类敌人的速度、行为等。放在哪:顶层模块 Enemies,键是敌人的 Descriptor 名(例如 ED_Spider_Exploder)。

json
{
    "Enemies": {
        "ED_Spider_Exploder": {
            "Movement": {
                "MaxPawnSpeed": 5,
                "MaxAcceleration": 5
            }
        }
    }
}

这段代码做了什么:只改自爆异虫(ED_Spider_Exploder)的移动——速度与加速度各放大 5 倍,其他敌人不动。

层级填什么说明
Enemies对象键 = Descriptor 名;名字查 Resources 的描述符表
Movement对象一组移动相关参数
MaxPawnSpeed浮点数最大速度的倍率——写 5 是 5 倍,不是「速度 5」
MaxAcceleration浮点数加速度倍率

可以怎么改:同一层还能写别的控制块(例如 Direct 改底层数值、Outline 加描边);想省事也可以只写一个字段。

没生效?见 Debug · 效果和想象不一样(先确认这个敌人在不在当前怪池里) | 想深入了解:敌人配置敌人控制项敌人配置移动

定时刷一波自定义怪 · WaveSpawner

目标:每隔一段时间主动放一波指定的敌人,不等游戏自己刷。放在哪:顶层模块 WaveSpawners。

json
{
    "WaveSpawners": {
        "Enabled": true,
        "Interval": 90,
        "Enemies": ["ED_Spider_Grunt"],
        "Difficulty": 100,
        "Distance": 10,
        "Locations": 3
    }
}

这段代码做了什么:每 90 秒,在玩家周围 3 个位置刷一波难度总点数 100、只由战士异虫组成的无宣告潮。

字段填什么作用
Enabledtrue / false启用与否
Interval浮点数(秒)间隔时间
Enemies列表要生成的敌人描述符;留空则使用怪池里的所有敌人
Difficulty浮点数这一波的难度点数,会在 Enemies 之间分配
Distance浮点数敌人相对玩家的生成距离
Locations整数刷潮点数量

可以怎么改:把 Enemies 留空就交给怪池决定刷什么;想让它只在特定条件下开一波,可以配合 Mutator 与 触发类 Mutator。

没生效?见 Debug · 该出现的没出现 | 想深入了解:波次生成器 WaveSpawners

想看的不是「改哪一行」,而是「一整套机制怎么拼起来」?→ 案例拆解 · Case Study