CD2 参考文档

本文档是《深岩银河》模组 Custom Difficulty 2(CD2) 的参考指南,它允许你创建新的难度。CD2 由@TheBrain 开发,作为 Custom Difficulty(CD1)的迭代版本,相比 CD1 拥有更高的灵活性和更多的可能

英文原文

This document serves as a reference for Custom Difficulty 2, a mod for Deep Rock Galactic which allows the creation of new hazards, or difficulties. Developed by @TheBrain as a successor to the Custom Difficulty mod, CD2 features many improvements over the flexibility and possibilities offered to difficulty designers:

  • 通过引入类似编程语言结构的 Mutators,让代码作者可以更精细地控制游戏逻辑。
    英文原文
    Allows players to a have a much finer control over many aspects of the gameplay by introducing mutators, control flow structures similar to those found in common programming languages.
  • 开放大量敌人控制项,可自由修改它们的行为、生成机制及材质。
    英文原文
    Exposes many enemy controls to change their behaviour, spawning mechanics and even aspect by featuring custom materials replication to clients.
  • 支持在任务中,根据游戏条件实时调整怪池。
    英文原文
    Allows manipulating the enemy pools live during a mission based on gameplay conditions.
  • 新增多项 CD1 不具备的功能,比如光照控制、玩家体型缩放、地图硝石数量调节等等
    英文原文
    Offers many features not available in CD1 such as controls for illumination, player scale, the amount of nitra in the map, etc.
  • 以及更多内容
    英文原文
    ... and many others.
CD2modhub
Main CD2 screen in Modhub.
Modhub 中的 CD2 主界面

第一次修改:3 步,5 分钟

不需要先读完文档。改一个数字、看一眼游戏里的变化,你就入门了。

  1. 复制 Hazard 5x2 最小示例,粘进游戏里的 CD2 面板
  2. 挑 EnemyCountModifier 里的一个数字改大或改小——它是按人数排列的数组,改的时候每个元素都要动;见模块 · DifficultySetting
  3. 点 Save 保存,再进游戏验证;没变化就去为什么没生效 · Debug

补充说明:EnemyCountModifier 常写成按人数排列的数组 (如 [1.7, 1.7, 2.5, 3],依次对应 1/2/3/4 人),所以改的时候每个元素都要动。 难度名里的 x2 也是这个意思:标准做法是把基础档的每个元素乘 2—— 实测 Hazard_6 的 [0.95, 1.05, 1.35, 1.65] ×2 得到 [1.9, 2.1, 2.7, 3.3],正是 Hazard_6x2_60_Nitra 里的值。 它不是把某个数字换成 2。(也有作者手工改过的档不遵循这个倍率。)

每一步的出处、以及之后该走哪条路,见 新手入门 · Getting Started;想直接找事做,看下面的 「我想做什么?」。

CD2 是怎么运作的

一个 CD2 难度 = 基础配置(Module / Pool / Enemy)+ 动态逻辑(Mutator / Trigger / WaveSpawner)。 先知道哪个词管哪一块,再去查它的完整字段。

术语它管什么去哪看
Module 模块一个功能板块:补给、虫量上限、光照、矮人属性……模块
Enemy / Descriptor某类敌人的配置 / 描述:血量、速度、抗性、外观敌人配置Direct 底层属性
Pool 怪池哪些敌人可以出现、按什么权重出现模块 · 怪池
Mutator让某个值跟着游戏条件变:加减乘、判断、按人数……动态参数与逻辑控制
WaveSpawner主动安排一波敌人:何时、在哪、多少、什么怪波次生成器

我想做什么?

从「玩法目标」反查「技术实现」:每行给出这类需求通常要动什么,以及先看哪一页。 字段的完整含义一律在 Reference,本页只负责把你送过去。

我想做什么通常要动什么先看这里
让虫更多 / 更少虫量倍率 + 上限Cookbook增加或减少敌人数量模块难度设置 DifficultySetting模块虫量上限 Caps
删掉 / 换掉某类敌人怪池Cookbook从难度里移除原版敌人模块怪池 Pools
让某个敌人更肉 / 更快 / 更痛敌人控制项敌人配置 · 敌人控制项
改某个敌人的底层数值DirectDirect 底层属性敌人配置Direct 特殊控制
满足条件后生成一波敌人条件判断 + 生成器Mutators(条件与计算)Mutator触发类 Trigger波次生成器 WaveSpawners
按玩家人数改变数值按人数选择值Mutator根据玩家数量基础部分难度文件要求
按补给次数 / 任务阶段改变难度读游戏状态 → 改数值Mutator根据呼叫补给次数动态参数与逻辑控制(全部条件)
做动态事件(条件 → 延迟 → 持续)Trigger 系列Mutator · 触发类 Trigger
改远程敌人的投射物Projectile发射物 Projectiles
想让别人也能玩(公共房间)同步相关机制FAQ我的难度能给别人玩吗模块敌人配置(同步 / 不同步)
改完没生效按症状排查为什么没生效DebugFAQ改完难度文件,为什么游戏里没变化

更新日志 · Update Log

  • 2024-12-04,CD2-v9:新增 ByEscortPhase 和 ByRefineryPhase Mutator。
    英文原文
    4-Dec-2024: Updated for CD2-v9: added ByEscortPhase and ByRefineryPhase mutators.
  • 2024-12-25,CD2-v10:新增 Projectiles 页面、MEV、DEA 页面,补充精英敌人与变种设置的说明,新增 Spawner 模块的介绍,并进行了一些小修正。
    英文原文
    25-Dec-2024: Updated for CD2-v10: added the Projectiles page, added the MEV and DEA page, added an explanation for elite and veteran enemies in Enemies, added the explanation for the new Spawner enemy control, and some minor corrections.
  • 2025-01-29,CD2-v11:新增 Direct 和 UsesBiomeVariants 的敌人控制项,以及 BySaboPhase 的 Mutator
    英文原文
    29-Jan-2025: Updated for CD2-v11: added the Direct and UsesBiomeVariants enemy controls and the BySaboPhase mutator.
  • 2025-02-20,CD2-v12:新增 DefenseProgress 和 ByResuppliesCalled 的 Mutator;新增 Salvage 模块和 BySalvagePhase 的 Mutator
    英文原文
    20-Feb-2025: Partial update for CD2-v12: added the DefenseProgress and ByResuppliesCalled mutators, added the Salvage module and the BySalvagePhase mutator.
  • 2025-02-28:在 Resources 与 Projectiles 页面中加入 @Carrot 提供的发射物汇总;在 Resources 与 FAQ 中加入 @Spy 编写的 CD2 公开房间可使用的功能指南;在 Projectiles 与 MEV、DEA 和 EEE 页面加入 EEE 的参考资料
    英文原文
    28-Feb-2025: Added @Carrot's projectile resource to the Resources and Projectiles tabs, added @Spy's guide to pubbing with CD2 to Resources and to the FAQ, added EEE's reference to Projectiles and to MEV, DEA and EEE.
  • 2025-03-11,CD2-v13:在敌人控制中加入 legacy pawn 属性;新增 BySecondary 与 DwarfCount 的 Mutator;补充 Darkness 模块的介绍;在 Salvage 模块新增 Salvage.MiniMules.NitraToGive 字段。
    英文原文
    11-Mar-2025: Update for CD2-v13: added the legacy pawn stats to enemy controls, added BySecondary and DwarfCount mutators, added Darkness module descriptions, added Salvage.MiniMules.NitraToGive to the Salvage module
  • 2025-03-22,CD2-v14:为 ByBiome 的 Mutator 加入 Dense Biozone 选项;补充由 @emctwo 提供的 Movement 敌人模块描述。
    英文原文
    22-Mar-2025: Update for CD2-v14: added the Dense Biozone option to the ByBiome mutator, added descriptions to Movement enemy module provided by @emctwo.
  • 2025-05-25,CD2-v15:为 Wavespawner 中加入 Diversity 选项;在 Mutators 章节新增 Trigger 系列 Mutators;在敌人控制项中新增 Heal(HealRaw 等)控制与 Outline 控制。
    英文原文
    25-May-2025: Update for CD2-v15: added the Diversity option to the wavespawner section, added the new Trigger mutators to the mutators section, added the Heal advanced controls and the new Outline control to enemies.
  • 2025-06-02:在 Enemies 页面中澄清 Enemies 与 EnemiesNoSync 的差别;在 MEV、DEA 和 EEE 页面移除 DEA 敌人列表,改为添加 mod.io 页面与官方列表的链接。
    英文原文
    2-Jun-2025: Clarified the section about the differences between Enemies and EnemiesNoSync in Enemies; removed the DEA enemy list from MEV, DEA and EEE and added a link to the mod in mod.io and to the official list.
  • 2025-07-23:新增 Direct 页面
    英文原文
    23-Jul-2025: Added the Direct page.
  • 2025-08-15:在 Modules 的 Salvage 部分新增 Usable 表格及使用示例
    英文原文
    15-Aug-2025: Added the Usable table in the Salvage module in Modules and some examples.
  • 2025-11-11,CD2-v16:新增 Countdown、EnemiesRecentlySpawned、Int2String、Float2String 与 Join 的 Mutator;新增 Messages 与 SoundCues 模块;在 Dwarves 模块新增 FallDamageStartVelocity 与 FallDamageModifier 的参数。
    英文原文
    11-Nov-2025: Update for CD2-v16: added the Countdown, EnemiesRecentlySpawned, Int2String, Float2String and the Join mutators; added the Messages and SoundCues module; added the FallDamageStartVelocity and FallDamageModifier in the Dwarves module.
  • 2025-12-02,CD2-v17:新增 Vars 模块,在 Wavespawners 中加入 Alert 字段;并新增以下 Mutators: DroppodDistance 、 MuleDroppodDistance 、Nonzero 、 Select 、 EnemyHealth 、 EnemyDistance 、 SecondaryFinished 、 LockFloat 、LockBoolean 、 LockString 。
    英文原文
    2-Dec-2025: Update for CD2-v17: added the Vars module, the Alert field on wavespawners, the DroppodDistance, MuleDroppodDistance, Nonzero, Select, EnemyHealth, EnemyDistance, SecondaryFinished, LockFloat, LockBoolean and LockString mutators.
  • 2025-12-11:新增 Common Edits 章节,并将参考文档主题样式更改为 Material 风格
    英文原文
    11-Dec-2025: Added the Common Edits section, changed theme to material.
  • 2026-03-08,CD2-v18:新增以下 Mutators:Sequence、StopWatch、TriggerTimer、SelectFromArray;Enemies 部分添加 DropResource、Goomba 功能
    英文原文
    8-Mar-2026: Update for CD2-v18: added the StopWatch, TriggerTimer, Sequence and SelectFromArray mutators, added the Goomba and DropResource enemy controls to Enemies.