subnautica-2-coop-mod-bepinex

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Subnautica 2 Deep Synergy Multiplayer Mod

Subnautica 2 Deep Synergy 多人模组

Skill by ara.so — Devtools Skills collection.
ara.so开发的技能——Devtools Skills合集。

Overview

概述

The Deep Synergy Multiplayer Mod transforms Subnautica 2 into a synchronized cooperative experience using the BepInEx modding framework. It implements deterministic session synchronization, adaptive difficulty scaling, and peer-to-peer networking to enable multiple players to explore, build bases, and survive together in Subnautica 2's alien oceans.
Key Features:
  • Deterministic Session Synchronization (DSS) for conflict-free shared world state
  • Adaptive Dynamic Scaling that adjusts difficulty based on player count
  • BepInEx IL2CPP-level hooking with hot-reloadable plugin architecture
  • Shared inventory using Merkle tree verification
  • Cross-platform multiplayer via NAT punch-through and WebRTC
  • Session migration on host disconnect with zero data loss
Deep Synergy多人模组借助BepInEx模组框架,将《深海迷航2》转变为同步合作体验。它实现了确定性会话同步、自适应难度缩放和点对点网络功能,让多名玩家能够一同探索《深海迷航2》的外星海洋、建造基地并生存下去。
核心特性:
  • 确定性会话同步(DSS),实现无冲突的共享世界状态
  • 自适应动态缩放,根据玩家数量调整难度
  • 基于BepInEx IL2CPP层面的钩子,支持热重载插件架构
  • 采用默克尔树验证的共享库存系统
  • 通过NAT穿透和WebRTC实现跨平台多人游戏
  • 主机断开时的会话迁移,无数据丢失

Installation

安装

Prerequisites

前置条件

  1. Subnautica 2 installed via Steam or GOG
  2. BepInEx 6.0.x for Unity IL2CPP games
  1. 已通过Steam或GOG安装Subnautica 2
  2. 适用于Unity IL2CPP游戏的BepInEx 6.0.x

Step-by-Step Installation

分步安装

bash
undefined
bash
undefined

1. Install BepInEx 6.0.x for Subnautica 2

1. 为Subnautica 2安装BepInEx 6.0.x

Extract to your Subnautica 2 game directory

解压到你的Subnautica 2游戏目录

2. Verify BepInEx installation structure

2. 验证BepInEx安装结构

Your game directory should have:

你的游戏目录应包含:

Subnautica2/

Subnautica2/

├── BepInEx/

├── BepInEx/

│ ├── core/

│ ├── core/

│ ├── plugins/

│ ├── plugins/

│ └── config/

│ └── config/

├── Subnautica2.exe (Windows)

├── Subnautica2.exe(Windows系统)

└── ...

└── ...

3. Download Deep Synergy Mod

3. 下载Deep Synergy模组

Extract the mod files to: Subnautica2/BepInEx/plugins/

将模组文件解压至:Subnautica2/BepInEx/plugins/

4. Directory structure after installation:

4. 安装后的目录结构:

BepInEx/

BepInEx/

├── plugins/

├── plugins/

│ ├── DeepSynergy.dll

│ ├── DeepSynergy.dll

│ ├── DeepSynergy.Core.dll

│ ├── DeepSynergy.Core.dll

│ └── DeepSynergy.Network.dll

│ └── DeepSynergy.Network.dll

└── config/

└── config/

└── synergy_profile.json

└── synergy_profile.json

undefined
undefined

Verify Installation

验证安装

Launch Subnautica 2. You should see BepInEx console output indicating the mod loaded:
[Info   : BepInEx] BepInEx 6.0.0 - Subnautica2
[Info   : BepInEx] Running under Unity 2022.3.x
[Info   : DeepSynergy] Deep Synergy Multiplayer Mod v1.0.0 loaded
[Info   : DeepSynergy] Session Manager initialized
[Info   : DeepSynergy] WebRTC transport ready
启动Subnautica 2,你应该能看到BepInEx控制台输出,表明模组已加载:
[Info   : BepInEx] BepInEx 6.0.0 - Subnautica2
[Info   : BepInEx] Running under Unity 2022.3.x
[Info   : DeepSynergy] Deep Synergy Multiplayer Mod v1.0.0 loaded
[Info   : DeepSynergy] Session Manager initialized
[Info   : DeepSynergy] WebRTC transport ready

Configuration

配置

Basic Configuration File

基础配置文件

Create or edit
BepInEx/config/synergy_profile.json
:
json
{
  "session_name": "Ocean Explorers",
  "max_players": 4,
  "difficulty_scale": "adaptive",
  "resource_multiplier": 1.0,
  "oxygen_consumption": 1.0,
  "creature_spawn_divider": 1,
  "enable_pvp": false,
  "friendly_fire": false,
  "shared_blueprints": true,
  "ping_locations_shared": true,
  "time_of_day_sync": "all",
  "voice_chat_integration": "none",
  "locale": "auto",
  "api_integration": {
    "openai": {
      "enabled": false,
      "api_key_env": "OPENAI_API_KEY",
      "role": "narrator"
    },
    "claude": {
      "enabled": false,
      "api_key_env": "ANTHROPIC_API_KEY",
      "role": "lore_engine"
    }
  },
  "network": {
    "port": 7777,
    "use_upnp": true,
    "max_latency_ms": 150,
    "packet_loss_tolerance": 0.05
  },
  "session_recovery": {
    "auto_save_interval_seconds": 60,
    "enable_migration": true,
    "backup_count": 3
  }
}
创建或编辑
BepInEx/config/synergy_profile.json
json
{
  "session_name": "Ocean Explorers",
  "max_players": 4,
  "difficulty_scale": "adaptive",
  "resource_multiplier": 1.0,
  "oxygen_consumption": 1.0,
  "creature_spawn_divider": 1,
  "enable_pvp": false,
  "friendly_fire": false,
  "shared_blueprints": true,
  "ping_locations_shared": true,
  "time_of_day_sync": "all",
  "voice_chat_integration": "none",
  "locale": "auto",
  "api_integration": {
    "openai": {
      "enabled": false,
      "api_key_env": "OPENAI_API_KEY",
      "role": "narrator"
    },
    "claude": {
      "enabled": false,
      "api_key_env": "ANTHROPIC_API_KEY",
      "role": "lore_engine"
    }
  },
  "network": {
    "port": 7777,
    "use_upnp": true,
    "max_latency_ms": 150,
    "packet_loss_tolerance": 0.05
  },
  "session_recovery": {
    "auto_save_interval_seconds": 60,
    "enable_migration": true,
    "backup_count": 3
  }
}

Configuration Options Explained

配置选项说明

OptionTypeDefaultDescription
max_players
int4Maximum players per session (2-8)
difficulty_scale
string"adaptive""fixed", "adaptive", or "progressive"
resource_multiplier
float1.0Resource node spawn rate (0.5-3.0)
oxygen_consumption
float1.0Oxygen drain rate (0.5-2.0)
creature_spawn_divider
int1Divide creature counts by this value
shared_blueprints
booltrueAll players unlock blueprints together
time_of_day_sync
string"all""all", "host", or "independent"
选项类型默认值描述
max_players
int4每个会话的最大玩家数(2-8)
difficulty_scale
string"adaptive"可选值:"fixed"(固定)、"adaptive"(自适应)或"progressive"(渐进式)
resource_multiplier
float1.0资源节点生成率(0.5-3.0)
oxygen_consumption
float1.0氧气消耗速率(0.5-2.0)
creature_spawn_divider
int1生物数量除以该值(数值越大,生物越少)
shared_blueprints
booltrue所有玩家共同解锁蓝图
time_of_day_sync
string"all"可选值:"all"(全部同步)、"host"(跟随主机)或"independent"(独立时间)

Advanced Session Configuration

高级会话配置

json
{
  "session_name": "Hardcore Survival",
  "max_players": 2,
  "difficulty_scale": "progressive",
  "resource_multiplier": 0.7,
  "oxygen_consumption": 1.3,
  "creature_spawn_divider": 1,
  "enable_pvp": false,
  "friendly_fire": true,
  "shared_blueprints": false,
  "death_penalty": "inventory_drop",
  "respawn_delay_seconds": 30,
  "shared_storage": {
    "enabled": true,
    "max_shared_lockers": 10,
    "require_proximity": false
  },
  "base_building": {
    "collaborative_placement": true,
    "require_consensus": false,
    "power_sharing": true
  }
}
json
{
  "session_name": "Hardcore Survival",
  "max_players": 2,
  "difficulty_scale": "progressive",
  "resource_multiplier": 0.7,
  "oxygen_consumption": 1.3,
  "creature_spawn_divider": 1,
  "enable_pvp": false,
  "friendly_fire": true,
  "shared_blueprints": false,
  "death_penalty": "inventory_drop",
  "respawn_delay_seconds": 30,
  "shared_storage": {
    "enabled": true,
    "max_shared_lockers": 10,
    "require_proximity": false
  },
  "base_building": {
    "collaborative_placement": true,
    "require_consensus": false,
    "power_sharing": true
  }
}

Console Commands

控制台命令

Access the BepInEx console (default: F12 in-game) to use these commands:
打开BepInEx控制台(默认:游戏内按F12)即可使用以下命令:

Session Management

会话管理

bash
undefined
bash
undefined

Start hosting a new session

开始托管新会话

/start_server
/start_server

Output: Server created: session code = 9B2A-4C7D-E8F1

输出:Server created: session code = 9B2A-4C7D-E8F1(服务器已创建:会话码=9B2A-4C7D-E8F1)

Join an existing session

加入现有会话

/join_session 9B2A-4C7D-E8F1
/join_session 9B2A-4C7D-E8F1

Get current session status

获取当前会话状态

/synergy_status
/synergy_status

Output:

输出:

Connected peers: 2/4

Connected peers: 2/4(已连接玩家:2/4)

State sync: 100% complete

State sync: 100% complete(状态同步:100%完成)

Inventory hash: 0xFA342B1E

Inventory hash: 0xFA342B1E(库存哈希值:0xFA342B1E)

Latency: Player1: 45ms, Player2: 67ms

Latency: Player1: 45ms, Player2: 67ms(延迟:玩家1:45ms,玩家2:67ms)

Disconnect from session

断开会话连接

/leave_session
/leave_session

Force session migration (transfer host)

强制会话迁移(转移主机)

/migrate_host Player2
undefined
/migrate_host Player2
undefined

Runtime Configuration

运行时配置

bash
undefined
bash
undefined

Temporarily adjust difficulty scaling

临时调整难度缩放比例

/synergy_scale 1.5
/synergy_scale 1.5

Change resource multiplier mid-session

中途修改资源生成倍率

/set_resource_multiplier 1.2
/set_resource_multiplier 1.2

Override world seed for new playthroughs

为新游戏覆盖世界种子

/seed_override 8251
/seed_override 8251

Toggle debug mode

切换调试模式

/synergy_debug true
/synergy_debug true

Check synchronization health

检查同步健康状态

/sync_health
/sync_health

Output:

输出:

Merkle tree integrity: OK

Merkle tree integrity: OK(默克尔树完整性:正常)

Pending conflicts: 0

Pending conflicts: 0(待处理冲突:0)

Timestamp drift: +2ms

Timestamp drift: +2ms(时间戳偏差:+2ms)

undefined
undefined

AI Integration Commands (Optional)

AI集成命令(可选)

bash
undefined
bash
undefined

Trigger OpenAI narrative generation

触发OpenAI叙事生成

/api_narrate "exploring the underwater caves"
/api_narrate "exploring the underwater caves"

Request Claude lore generation for current location

请求Claude为当前位置生成剧情

/api_lore current_biome
/api_lore current_biome

Get AI-generated base naming suggestions

获取AI生成的基地命名建议

/api_suggest_name base
/api_suggest_name base

Generate creature analysis

生成生物分析报告

/api_analyze_creature reaper_leviathan
undefined
/api_analyze_creature reaper_leviathan
undefined

Core Patterns and Usage

核心模式与使用方法

Starting a Co-op Session (Host)

发起合作会话(主机)

csharp
// In-game: Press configured hotkey (default: F9) to open multiplayer menu
// Or use console:

// 1. Start server
/start_server

// 2. Configure session (optional, uses synergy_profile.json by default)
/set_max_players 3
/set_difficulty_scale adaptive

// 3. Share the displayed session code with friends
// Session code appears in chat: "9B2A-4C7D-E8F1"

// 4. Wait for players to connect
// Connection messages appear in chat:
// "Player2 joined the session"
// "Player3 joined the session"
csharp
// 游戏内:按配置的快捷键(默认:F9)打开多人菜单
// 或使用控制台:

// 1. 启动服务器
/start_server

// 2. 配置会话(可选,默认使用synergy_profile.json)
/set_max_players 3
/set_difficulty_scale adaptive

// 3. 将显示的会话码分享给好友
// 会话码会出现在聊天框中:"9B2A-4C7D-E8F1"

// 4. 等待玩家连接
// 连接消息会出现在聊天框中:
// "Player2 joined the session"(玩家2已加入会话)
// "Player3 joined the session"(玩家3已加入会话)

Joining a Co-op Session (Client)

加入合作会话(客户端)

bash
undefined
bash
undefined

1. Open multiplayer menu (F9) or use console

1. 打开多人菜单(F9)或使用控制台

/join_session 9B2A-4C7D-E8F1
/join_session 9B2A-4C7D-E8F1

2. Wait for synchronization

2. 等待同步完成

Progress appears in UI:

进度会显示在UI中:

"Synchronizing world state... 45%"

"Synchronizing world state... 45%"(正在同步世界状态...45%)

"Downloading inventory data... 78%"

"Downloading inventory data... 78%"(正在下载库存数据...78%)

"Syncing base structures... 100%"

"Syncing base structures... 100%"(正在同步基地结构...100%)

3. Spawn into the world

3. 进入游戏世界

You'll appear at the host's current location or a designated spawn point

你会出现在主机当前位置或指定的出生点

undefined
undefined

Shared Base Building

共享基地建造

When
collaborative_placement
is enabled, base building is synchronized:
bash
undefined
collaborative_placement
启用时,基地建造会同步:
bash
undefined

Player 1 places a foundation

玩家1放置一块地基

Action: Place Foundation at coordinates (100, -50, 200)

操作:在坐标(100, -50, 200)放置地基

Player 2 sees foundation immediately and can build on it

玩家2会立即看到地基并可在其上继续建造

Action: Place Corridor connecting to Player 1's foundation

操作:放置走廊连接玩家1的地基

Both players see the same structure in real-time

两名玩家会实时看到相同的建筑结构

Power generation and resource consumption are shared

电力生成和资源消耗是共享的

undefined
undefined

Inventory Synchronization

库存同步

The mod uses Merkle tree verification for inventory integrity:
bash
undefined
模组使用默克尔树验证库存完整性:
bash
undefined

Check inventory sync status

检查库存同步状态

/sync_health
/sync_health

If desync detected:

如果检测到不同步:

"Warning: Inventory hash mismatch with Player2"

"Warning: Inventory hash mismatch with Player2"(警告:与玩家2的库存哈希值不匹配)

"Initiating reconciliation..."

"Initiating reconciliation..."(正在启动协调...)

Force inventory resync (rarely needed)

强制重新同步库存(极少需要)

/force_resync inventory
/force_resync inventory

Check specific item counts across all players

查看所有玩家的特定物品数量

/debug_item titanium
/debug_item titanium

Output:

输出:

Host: 47 titanium

Host: 47 titanium(主机:47个钛)

Player2: 47 titanium

Player2: 47 titanium(玩家2:47个钛)

Player3: 47 titanium (shared storage)

Player3: 47 titanium (shared storage)(玩家3:47个钛(共享存储))

undefined
undefined

Session Recovery and Migration

会话恢复与迁移

If the host disconnects, the mod automatically migrates:
bash
undefined
如果主机断开连接,模组会自动迁移会话:
bash
undefined

Automatic migration occurs

自动迁移启动

Console output:

控制台输出:

"Host disconnected. Initiating session migration..."

"Host disconnected. Initiating session migration..."(主机已断开。正在启动会话迁移...)

"Player2 elected as new host"

"Player2 elected as new host"(玩家2被选为新主机)

"Restoring session state from backup..."

"Restoring session state from backup..."(从备份恢复会话状态...)

"Migration complete. Session restored."

"Migration complete. Session restored."(迁移完成。会话已恢复。)

Players can continue without interruption

玩家可继续游戏,无中断

All progress, bases, and inventory are preserved

所有进度、基地和库存均被保留

undefined
undefined

Plugin Development (Advanced)

插件开发(进阶)

Creating Custom BepInEx Plugins for the Mod

创建适用于该模组的自定义BepInEx插件

csharp
using BepInEx;
using BepInEx.IL2CPP;
using HarmonyLib;
using DeepSynergy.Core;
using DeepSynergy.Network;

namespace CustomSynergyPlugin
{
    [BepInPlugin("com.example.customsynergy", "Custom Synergy Plugin", "1.0.0")]
    [BepInDependency("com.deepsynergy.core")]
    public class CustomSynergyPlugin : BasePlugin
    {
        private Harmony harmony;

        public override void Load()
        {
            harmony = new Harmony("com.example.customsynergy");
            harmony.PatchAll();

            // Subscribe to Deep Synergy events
            SessionManager.OnPlayerJoined += OnPlayerJoined;
            SessionManager.OnPlayerLeft += OnPlayerLeft;
            StateSync.OnInventoryChanged += OnInventoryChanged;

            Log.LogInfo("Custom Synergy Plugin loaded!");
        }

        private void OnPlayerJoined(string playerId, string playerName)
        {
            Log.LogInfo($"Player joined: {playerName} ({playerId})");
            
            // Example: Send custom welcome message
            NetworkManager.SendMessage(playerId, new WelcomeMessage
            {
                Text = $"Welcome to the session, {playerName}!",
                ShowNotification = true
            });
        }

        private void OnPlayerLeft(string playerId)
        {
            Log.LogInfo($"Player left: {playerId}");
        }

        private void OnInventoryChanged(string playerId, InventoryDelta delta)
        {
            // React to inventory changes
            if (delta.ItemAdded == "titanium" && delta.Count >= 10)
            {
                Log.LogInfo($"{playerId} collected 10+ titanium!");
            }
        }
    }
}
csharp
using BepInEx;
using BepInEx.IL2CPP;
using HarmonyLib;
using DeepSynergy.Core;
using DeepSynergy.Network;

namespace CustomSynergyPlugin
{
    [BepInPlugin("com.example.customsynergy", "Custom Synergy Plugin", "1.0.0")]
    [BepInDependency("com.deepsynergy.core")]
    public class CustomSynergyPlugin : BasePlugin
    {
        private Harmony harmony;

        public override void Load()
        {
            harmony = new Harmony("com.example.customsynergy");
            harmony.PatchAll();

            // 订阅Deep Synergy事件
            SessionManager.OnPlayerJoined += OnPlayerJoined;
            SessionManager.OnPlayerLeft += OnPlayerLeft;
            StateSync.OnInventoryChanged += OnInventoryChanged;

            Log.LogInfo("Custom Synergy Plugin loaded!");
        }

        private void OnPlayerJoined(string playerId, string playerName)
        {
            Log.LogInfo($"Player joined: {playerName} ({playerId})");
            
            // 示例:发送自定义欢迎消息
            NetworkManager.SendMessage(playerId, new WelcomeMessage
            {
                Text = $"Welcome to the session, {playerName}!",
                ShowNotification = true
            });
        }

        private void OnPlayerLeft(string playerId)
        {
            Log.LogInfo($"Player left: {playerId}");
        }

        private void OnInventoryChanged(string playerId, InventoryDelta delta)
        {
            // 响应库存变化
            if (delta.ItemAdded == "titanium" && delta.Count >= 10)
            {
                Log.LogInfo($"{playerId} collected 10+ titanium!");
            }
        }
    }
}

Hooking into Base Building Events

挂钩基地建造事件

csharp
using HarmonyLib;
using DeepSynergy.Core;

[HarmonyPatch(typeof(BaseManager), "PlaceBaseComponent")]
public class BaseComponentPatch
{
    static void Postfix(BaseComponent component, Vector3 position, Quaternion rotation)
    {
        // Called after any base component is placed
        Log.LogInfo($"Base component placed: {component.Type} at {position}");

        // Sync to all connected clients
        StateSync.BroadcastBaseChange(new BaseChangeEvent
        {
            ComponentType = component.Type,
            Position = position,
            Rotation = rotation,
            PlayerId = SessionManager.LocalPlayerId,
            Timestamp = NetworkTime.CurrentTimestamp()
        });
    }
}
csharp
using HarmonyLib;
using DeepSynergy.Core;

[HarmonyPatch(typeof(BaseManager), "PlaceBaseComponent")]
public class BaseComponentPatch
{
    static void Postfix(BaseComponent component, Vector3 position, Quaternion rotation)
    {
        // 任何基地组件放置后触发
        Log.LogInfo($"Base component placed: {component.Type} at {position}");

        // 同步至所有已连接客户端
        StateSync.BroadcastBaseChange(new BaseChangeEvent
        {
            ComponentType = component.Type,
            Position = position,
            Rotation = rotation,
            PlayerId = SessionManager.LocalPlayerId,
            Timestamp = NetworkTime.CurrentTimestamp()
        });
    }
}

Troubleshooting

故障排除

Common Issues

常见问题

1. "Session Code Invalid" Error

1. "会话码无效"错误

bash
undefined
bash
undefined

Symptom: Cannot join session, "Invalid session code" error

症状:无法加入会话,提示"Invalid session code"(无效会话码)

Solution 1: Verify session code format

解决方案1:验证会话码格式

Correct format: XXXX-XXXX-XXXX (12 characters with dashes)

正确格式:XXXX-XXXX-XXXX(带连字符的12位字符)

Solution 2: Check if host is still running

解决方案2:检查主机是否仍在运行

/synergy_status
/synergy_status

If host offline: "Error: Cannot connect to session"

如果主机离线:"Error: Cannot connect to session"(错误:无法连接到会话)

Solution 3: Verify network connectivity

解决方案3:验证网络连通性

/net_test <host_ip>
/net_test <host_ip>

Should show: "Connection successful: <latency>ms"

应显示:"Connection successful: <latency>ms"(连接成功:<延迟>ms)

Solution 4: Check firewall rules

解决方案4:检查防火墙规则

Ensure UDP port 7777 (or configured port) is open

确保UDP端口7777(或配置的端口)已开放

undefined
undefined

2. Inventory Desynchronization

2. 库存不同步

bash
undefined
bash
undefined

Symptom: Different item counts between players

症状:玩家之间物品数量不一致

Solution 1: Check sync status

解决方案1:检查同步状态

/sync_health
/sync_health

Output shows: "Inventory hash mismatch detected"

输出显示:"Inventory hash mismatch detected"(检测到库存哈希值不匹配)

Solution 2: Force reconciliation

解决方案2:强制协调

/force_resync inventory
/force_resync inventory

Wait for: "Inventory reconciliation complete"

等待提示:"Inventory reconciliation complete"(库存协调完成)

Solution 3: If persistent, restart session with backup

解决方案3:如果问题持续,从备份重启会话

/restore_backup 0 # Most recent backup
undefined
/restore_backup 0 # 最新备份
undefined

3. High Latency / Lag

3. 高延迟/卡顿

bash
undefined
bash
undefined

Symptom: Delayed actions, rubber-banding

症状:操作延迟、画面瞬移

Check current latency

检查当前延迟

/synergy_status
/synergy_status

Look for: "Latency: 300ms+" (problematic)

查看:"Latency: 300ms+"(延迟:300ms+,存在问题)

Solution 1: Adjust network settings in config

解决方案1:调整配置中的网络设置

{ "network": { "max_latency_ms": 200, // Increase tolerance "packet_loss_tolerance": 0.1 // Allow more packet loss } }
{ "network": { "max_latency_ms": 200, // 提高容忍度 "packet_loss_tolerance": 0.1 // 允许更多丢包 } }

Solution 2: Enable compression

解决方案2:启用压缩

/set_compression true
/set_compression true

Solution 3: Reduce sync frequency for non-critical data

解决方案3:降低非关键数据的同步频率

{ "sync_intervals": { "position_ms": 50, // Increase from 33ms "inventory_ms": 500, // Increase from 200ms "world_state_ms": 2000 // Increase from 1000ms } }
undefined
{ "sync_intervals": { "position_ms": 50, // 从33ms提高 "inventory_ms": 500, // 从200ms提高 "world_state_ms": 2000 // 从1000ms提高 } }
undefined

4. Base Parts Not Appearing for Other Players

4. 其他玩家看不到基地组件

bash
undefined
bash
undefined

Symptom: One player places base parts, others don't see them

症状:一名玩家放置基地组件,其他玩家看不到

Solution 1: Check base sync status

解决方案1:检查基地同步状态

/debug_base
/debug_base

Output: Lists all base components and which players see them

输出:列出所有基地组件及哪些玩家可见

Solution 2: Force base state resync

解决方案2:强制重新同步基地状态

/force_resync base
/force_resync base

Solution 3: Verify collaborative_placement setting

解决方案3:验证collaborative_placement设置

{ "base_building": { "collaborative_placement": true, // Must be true "require_consensus": false } }
{ "base_building": { "collaborative_placement": true, // 必须设为true "require_consensus": false } }

Solution 4: Check for conflicts

解决方案4:检查冲突

/base_conflicts
/base_conflicts

Resolves any placement conflicts automatically

自动解决所有放置冲突

undefined
undefined

5. Mod Fails to Load

5. 模组加载失败

bash
undefined
bash
undefined

Symptom: BepInEx console shows no Deep Synergy messages

症状:BepInEx控制台无Deep Synergy相关消息

Check BepInEx log

查看BepInEx日志

Location: BepInEx/LogOutput.log

位置:BepInEx/LogOutput.log

Common causes:

常见原因:

1. Missing dependencies

1. 缺少依赖项

Error: "Could not load [DeepSynergy.Core.dll]"

错误:"Could not load [DeepSynergy.Core.dll]"(无法加载[DeepSynergy.Core.dll])

Solution: Reinstall mod, ensure all DLLs are present

解决方案:重新安装模组,确保所有DLL文件齐全

2. Incompatible BepInEx version

2. BepInEx版本不兼容

Error: "BepInEx version mismatch"

错误:"BepInEx version mismatch"(BepInEx版本不匹配)

Solution: Update to BepInEx 6.0.x

解决方案:更新至BepInEx 6.0.x

3. Game update broke IL2CPP hooks

3. 游戏更新破坏了IL2CPP钩子

Error: "Failed to hook [MethodName]"

错误:"Failed to hook [MethodName]"(挂钩[方法名]失败)

Solution: Wait for mod update or downgrade game version

解决方案:等待模组更新或降级游戏版本

4. Conflicting mods

4. 模组冲突

Disable other mods one by one to identify conflicts

逐个禁用其他模组以找出冲突项

undefined
undefined

Debug Mode

调试模式

Enable verbose logging for troubleshooting:
json
{
  "debug": {
    "enabled": true,
    "log_level": "verbose",
    "log_network_traffic": true,
    "log_state_changes": true,
    "dump_sync_conflicts": true
  }
}
bash
undefined
启用详细日志以排查问题:
json
{
  "debug": {
    "enabled": true,
    "log_level": "verbose",
    "log_network_traffic": true,
    "log_state_changes": true,
    "dump_sync_conflicts": true
  }
}
bash
undefined

Enable debug mode at runtime

运行时启用调试模式

/synergy_debug true
/synergy_debug true

View detailed sync logs

查看详细同步日志

/show_sync_log
/show_sync_log

Monitor network packets

监控网络数据包

/net_monitor true
/net_monitor true

Output: Real-time packet flow with sizes and types

输出:实时数据包流量,包含大小和类型

undefined
undefined

Environment Variables

环境变量

The mod respects these environment variables:
bash
undefined
模组支持以下环境变量:
bash
undefined

OpenAI API key (for narrative generation)

OpenAI API密钥(用于叙事生成)

export OPENAI_API_KEY=sk-your-key-here
export OPENAI_API_KEY=sk-your-key-here

Anthropic Claude API key (for lore engine)

Anthropic Claude API密钥(用于剧情引擎)

export ANTHROPIC_API_KEY=sk-ant-your-key-here
export ANTHROPIC_API_KEY=sk-ant-your-key-here

Override config file location

覆盖配置文件位置

export SYNERGY_CONFIG_PATH=/custom/path/synergy_profile.json
export SYNERGY_CONFIG_PATH=/custom/path/synergy_profile.json

Set log level without editing config

无需编辑配置即可设置日志级别

export SYNERGY_LOG_LEVEL=debug
export SYNERGY_LOG_LEVEL=debug

Force specific network port

强制使用特定网络端口

export SYNERGY_PORT=8888
export SYNERGY_PORT=8888

Disable UPnP/NAT-PMP

禁用UPnP/NAT-PMP

export SYNERGY_NO_UPNP=1
undefined
export SYNERGY_NO_UPNP=1
undefined

Performance Optimization

性能优化

For Low-End Systems

针对低端系统

json
{
  "performance": {
    "sync_intervals": {
      "position_ms": 100,
      "inventory_ms": 1000,
      "world_state_ms": 5000
    },
    "reduce_creature_ai_sync": true,
    "compress_network_traffic": true,
    "limit_visual_effects": true
  }
}
json
{
  "performance": {
    "sync_intervals": {
      "position_ms": 100,
      "inventory_ms": 1000,
      "world_state_ms": 5000
    },
    "reduce_creature_ai_sync": true,
    "compress_network_traffic": true,
    "limit_visual_effects": true
  }
}

For High-Performance Sessions (4+ players)

针对高性能会话(4名及以上玩家)

json
{
  "performance": {
    "sync_intervals": {
      "position_ms": 33,
      "inventory_ms": 200,
      "world_state_ms": 1000
    },
    "predictive_sync": true,
    "delta_compression": true,
    "prioritize_nearby_players": true
  }
}
json
{
  "performance": {
    "sync_intervals": {
      "position_ms": 33,
      "inventory_ms": 200,
      "world_state_ms": 1000
    },
    "predictive_sync": true,
    "delta_compression": true,
    "prioritize_nearby_players": true
  }
}

Best Practices

最佳实践

  1. Always use session codes: Avoid direct IP connections for better NAT traversal
  2. Configure difficulty scaling: Set
    difficulty_scale
    to "adaptive" for balanced gameplay
  3. Enable session backups: Set
    auto_save_interval_seconds
    to 60 or less
  4. Test network before inviting friends: Use
    /net_test
    command
  5. Coordinate resource gathering: Use
    shared_blueprints: true
    to avoid duplicate research
  6. Designate a stable host: Player with best connection should host
  7. Use voice chat integration: Set
    voice_chat_integration
    to "discord_rpc" for proximity audio
  1. 始终使用会话码:为了更好的NAT穿透效果,避免直接IP连接
  2. 配置难度缩放:将
    difficulty_scale
    设置为"adaptive"以获得平衡的游戏体验
  3. 启用会话备份:将
    auto_save_interval_seconds
    设置为60秒或更短
  4. 邀请朋友前测试网络:使用
    /net_test
    命令
  5. 协调资源收集:设置
    shared_blueprints: true
    以避免重复研究
  6. 指定稳定的主机:网络连接最好的玩家应作为主机
  7. 使用语音聊天集成:将
    voice_chat_integration
    设置为"discord_rpc"以实现近距离语音

Additional Resources

额外资源

  • BepInEx Documentation: https://docs.bepinex.dev/
  • Subnautica Modding Wiki: Community-maintained mod compatibility lists
  • Discord Server: 24/7 support and troubleshooting assistance
  • GitHub Issues: Bug reports and feature requests (if public repository exists)
  • BepInEx文档https://docs.bepinex.dev/
  • Subnautica模组维基:社区维护的模组兼容性列表
  • Discord服务器:全天候支持与故障排除协助
  • GitHub Issues:提交Bug报告和功能请求(如果有公开仓库)