subnautica-2-deep-synergy-coop-mod
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSubnautica 2 Deep Synergy Coop Mod
Subnautica 2 Deep Synergy 多人合作模组
Overview
概述
Deep Synergy is a BepInEx-based cooperative multiplayer modification for Subnautica 2 that transforms the single-player survival experience into a synchronized multi-player session. The mod implements deterministic session synchronization (DSS), adaptive dynamic scaling (ADS), and decentralized peer-to-peer networking to enable seamless co-op gameplay without central server infrastructure.
Key Capabilities:
- Synchronized world state across multiple clients using Merkle tree inventory tracking
- WebRTC-based peer-to-peer networking with NAT punch-through
- Hot-reloadable BepInEx plugin architecture (IL2CPP hooks)
- Optional OpenAI/Claude API integration for dynamic narrative generation
- Cross-platform support (Windows, macOS, Linux/Steam Deck)
- Adaptive difficulty scaling based on player count
Deep Synergy是一款基于BepInEx的Subnautica 2多人合作模组,可将单人生存体验转化为同步的多人会话。该模组实现了确定性会话同步(DSS)、自适应动态缩放(ADS)以及去中心化点对点网络,无需中央服务器基础设施即可实现流畅的合作玩法。
核心功能:
- 通过Merkle树库存跟踪实现多客户端间的世界状态同步
- 基于WebRTC的点对点网络,支持NAT穿透
- 可热重载的BepInEx插件架构(IL2CPP钩子)
- 可选OpenAI/Claude API集成,支持动态叙事生成
- 跨平台支持(Windows、macOS、Linux/Steam Deck)
- 根据玩家数量自适应调整难度
Installation
安装
Prerequisites
前置条件
-
Install BepInEx 6.0.x for Subnautica 2:
- Download BepInEx from the official repository
- Extract to Subnautica 2 game root directory
- Launch game once to generate BepInEx folder structure
-
Download Deep Synergy Mod:
- Obtain from the project repository
- Extract contents to
<game_root>/BepInEx/plugins/
-
为Subnautica 2安装BepInEx 6.0.x:
- 从官方仓库下载BepInEx
- 解压到Subnautica 2游戏根目录
- 启动游戏一次以生成BepInEx文件夹结构
-
下载Deep Synergy模组:
- 从项目仓库获取模组文件
- 将内容解压到
<游戏根目录>/BepInEx/plugins/
Directory Structure
目录结构
Subnautica2/
├── BepInEx/
│ ├── plugins/
│ │ ├── DeepSynergyCore.dll
│ │ ├── SessionManager.dll
│ │ ├── StateSynchronizer.dll
│ │ └── ConflictResolver.dll
│ ├── config/
│ │ ├── synergy_profile.json
│ │ └── session_config.xml
│ └── LogOutput.log
└── Subnautica2.exeSubnautica2/
├── BepInEx/
│ ├── plugins/
│ │ ├── DeepSynergyCore.dll
│ │ ├── SessionManager.dll
│ │ ├── StateSynchronizer.dll
│ │ └── ConflictResolver.dll
│ ├── config/
│ │ ├── synergy_profile.json
│ │ └── session_config.xml
│ └── LogOutput.log
└── Subnautica2.exeFirst Launch
首次启动
bash
undefinedbash
undefinedLaunch via Steam or direct executable
通过Steam或直接启动可执行文件
BepInEx will patch the game on first run
BepInEx会在首次运行时对游戏进行补丁
Check BepInEx/LogOutput.log for successful mod loading
查看BepInEx/LogOutput.log确认模组是否成功加载
Expected log output:[Info : BepInEx] BepInEx 6.0.0 - Subnautica2 (5/14/2026)
[Info :DeepSynergy] Deep Synergy Multiplayer Mod v1.0.0 loaded
[Info :DeepSynergy] Session Manager initialized
[Info :DeepSynergy] WebRTC transport layer ready
undefined
预期日志输出:[Info : BepInEx] BepInEx 6.0.0 - Subnautica2 (5/14/2026)
[Info :DeepSynergy] Deep Synergy Multiplayer Mod v1.0.0 loaded
[Info :DeepSynergy] Session Manager initialized
[Info :DeepSynergy] WebRTC transport layer ready
undefinedConfiguration
配置
Session Profile (BepInEx/config/synergy_profile.json
)
BepInEx/config/synergy_profile.json会话配置文件(BepInEx/config/synergy_profile.json
)
BepInEx/config/synergy_profile.jsonjson
{
"session_name": "Deep Exploration Team",
"max_players": 4,
"difficulty_scale": "adaptive",
"resource_multiplier": 1.5,
"oxygen_consumption": 0.85,
"creature_spawn_divider": 1.5,
"enable_pvp": false,
"friendly_fire": false,
"shared_blueprints": true,
"ping_locations_shared": true,
"time_of_day_sync": "host",
"voice_chat_integration": "discord_rpc",
"locale": "en_US",
"api_integration": {
"openai": {
"enabled": false,
"api_key_env": "OPENAI_API_KEY",
"model": "gpt-4",
"role": "narrator"
},
"claude": {
"enabled": false,
"api_key_env": "ANTHROPIC_API_KEY",
"model": "claude-3-opus-20240229",
"role": "lore_engine"
}
},
"network": {
"nat_traversal": true,
"max_latency_ms": 250,
"sync_interval_ms": 50,
"inventory_hash_algorithm": "sha256"
}
}Key Configuration Fields:
- :
difficulty_scale,"static", or"adaptive"- controls how game difficulty adjusts with player count"linear" - : Float multiplier for harvestable resource nodes (1.0 = vanilla, 2.0 = double)
resource_multiplier - : Fraction of normal oxygen drain (0.5 = half drain, 1.0 = vanilla)
oxygen_consumption - : Reduces creature spawns (2.0 = half spawns)
creature_spawn_divider - :
time_of_day_sync(host controls time),"host"(synced vote),"all"(client-specific)"independent" - : Environment variable name containing API keys (never hardcode keys)
api_key_env
json
{
"session_name": "Deep Exploration Team",
"max_players": 4,
"difficulty_scale": "adaptive",
"resource_multiplier": 1.5,
"oxygen_consumption": 0.85,
"creature_spawn_divider": 1.5,
"enable_pvp": false,
"friendly_fire": false,
"shared_blueprints": true,
"ping_locations_shared": true,
"time_of_day_sync": "host",
"voice_chat_integration": "discord_rpc",
"locale": "en_US",
"api_integration": {
"openai": {
"enabled": false,
"api_key_env": "OPENAI_API_KEY",
"model": "gpt-4",
"role": "narrator"
},
"claude": {
"enabled": false,
"api_key_env": "ANTHROPIC_API_KEY",
"model": "claude-3-opus-20240229",
"role": "lore_engine"
}
},
"network": {
"nat_traversal": true,
"max_latency_ms": 250,
"sync_interval_ms": 50,
"inventory_hash_algorithm": "sha256"
}
}核心配置字段:
- :
difficulty_scale、"static"或"adaptive"— 控制游戏难度随玩家数量的调整方式"linear" - : 可采集资源节点的浮点倍数(1.0 = 原版,2.0 = 双倍)
resource_multiplier - : 正常氧气消耗的比例(0.5 = 减半消耗,1.0 = 原版)
oxygen_consumption - : 减少生物生成数量(2.0 = 生成数量减半)
creature_spawn_divider - :
time_of_day_sync(房主控制时间)、"host"(同步投票)、"all"(客户端独立)"independent" - : 存储API密钥的环境变量名称(切勿硬编码密钥)
api_key_env
XML Configuration (BepInEx/config/session_config.xml
)
BepInEx/config/session_config.xmlXML配置文件(BepInEx/config/session_config.xml
)
BepInEx/config/session_config.xmlxml
<?xml version="1.0" encoding="utf-8"?>
<SynergyConfig>
<Session>
<DefaultPort>25565</DefaultPort>
<EnableUPnP>true</EnableUPnP>
<MaxConnectionAttempts>5</MaxConnectionAttempts>
<ConnectionTimeoutSeconds>30</ConnectionTimeoutSeconds>
</Session>
<Synchronization>
<InventoryHashInterval>1000</InventoryHashInterval>
<CreatureStateInterval>200</CreatureStateInterval>
<BaseStructureInterval>500</BaseStructureInterval>
</Synchronization>
<Logging>
<Level>Info</Level>
<EnableNetworkDebug>false</EnableNetworkDebug>
</Logging>
</SynergyConfig>xml
<?xml version="1.0" encoding="utf-8"?>
<SynergyConfig>
<Session>
<DefaultPort>25565</DefaultPort>
<EnableUPnP>true</EnableUPnP>
<MaxConnectionAttempts>5</MaxConnectionAttempts>
<ConnectionTimeoutSeconds>30</ConnectionTimeoutSeconds>
</Session>
<Synchronization>
<InventoryHashInterval>1000</InventoryHashInterval>
<CreatureStateInterval>200</CreatureStateInterval>
<BaseStructureInterval>500</BaseStructureInterval>
</Synchronization>
<Logging>
<Level>Info</Level>
<EnableNetworkDebug>false</EnableNetworkDebug>
</Logging>
</SynergyConfig>In-Game Console Commands
游戏内控制台命令
Access the BepInEx console with (default binding, configurable):
F12按打开BepInEx控制台(默认绑定,可配置):
F12Session Management
会话管理
bash
undefinedbash
undefinedStart hosting a session
开始主持会话
/start_server
/start_server
Output: Server created: session code = 9B2A-4C7D-E8F1
输出:Server created: session code = 9B2A-4C7D-E8F1
Join existing session
加入现有会话
/join_session 9B2A-4C7D-E8F1
/join_session 9B2A-4C7D-E8F1
Check connection status
检查连接状态
/synergy_status
/synergy_status
Output:
输出:
Connected peers: 3/4
Connected peers: 3/4
State sync: 100% complete
State sync: 100% complete
Inventory hash: 0xFA342B1E
Inventory hash: 0xFA342B1E
Avg latency: 45ms
Avg latency: 45ms
Leave session gracefully
优雅退出会话
/disconnect_session
undefined/disconnect_session
undefinedGameplay Scaling
游戏难度缩放
bash
undefinedbash
undefinedTemporarily adjust difficulty multiplier
临时调整难度倍数
/synergy_scale 1.5
/synergy_scale 1.5
Reset to config defaults
重置为配置默认值
/synergy_reset
/synergy_reset
Force world seed sync (host only)
强制同步世界种子(仅房主可用)
/seed_override 8251
undefined/seed_override 8251
undefinedAI Narrative Integration
AI叙事集成
bash
undefinedbash
undefinedTrigger OpenAI narrative generation
触发OpenAI叙事生成
/api_narrate "discovered alien artifact in lost river"
/api_narrate "discovered alien artifact in lost river"
Generate species biology log with Claude
使用Claude生成物种生物学日志
/api_lore_generate "ghost leviathan juvenile"
/api_lore_generate "ghost leviathan juvenile"
Show last 5 AI-generated journal entries
显示最近5条AI生成的日志条目
/api_journal_history 5
undefined/api_journal_history 5
undefinedDebugging
调试
bash
undefinedbash
undefinedEnable verbose network logging
启用详细网络日志
/debug_network true
/debug_network true
Dump current inventory Merkle tree
导出当前库存Merkle树
/debug_inventory_tree
/debug_inventory_tree
Force state resync
强制状态重新同步
/force_resync
/force_resync
Show desync detection results
显示不同步检测结果
/debug_conflicts
undefined/debug_conflicts
undefinedPlugin Development & Extension
插件开发与扩展
BepInEx Plugin Structure
BepInEx插件结构
The mod uses BepInEx IL2CPP hooking. To extend functionality:
csharp
using BepInEx;
using BepInEx.IL2CPP;
using HarmonyLib;
using DeepSynergy.Core;
namespace DeepSynergy.CustomExtension
{
[BepInPlugin(PluginGUID, PluginName, PluginVersion)]
[BepInDependency("com.deepsynergy.core")]
public class CustomExtensionPlugin : BasePlugin
{
public const string PluginGUID = "com.yourname.customextension";
public const string PluginName = "Custom Deep Synergy Extension";
public const string PluginVersion = "1.0.0";
private Harmony _harmony;
public override void Load()
{
_harmony = new Harmony(PluginGUID);
_harmony.PatchAll();
// Hook into session events
SessionManager.OnPlayerJoined += OnPlayerJoinedHandler;
SessionManager.OnInventorySynced += OnInventorySyncedHandler;
Log.LogInfo($"{PluginName} loaded successfully");
}
private void OnPlayerJoinedHandler(string playerId)
{
Log.LogInfo($"Player joined: {playerId}");
// Custom logic here
}
private void OnInventorySyncedHandler(InventorySyncData data)
{
Log.LogInfo($"Inventory synced - hash: {data.MerkleRootHash}");
}
}
}该模组使用BepInEx IL2CPP钩子。如需扩展功能:
csharp
using BepInEx;
using BepInEx.IL2CPP;
using HarmonyLib;
using DeepSynergy.Core;
namespace DeepSynergy.CustomExtension
{
[BepInPlugin(PluginGUID, PluginName, PluginVersion)]
[BepInDependency("com.deepsynergy.core")]
public class CustomExtensionPlugin : BasePlugin
{
public const string PluginGUID = "com.yourname.customextension";
public const string PluginName = "Custom Deep Synergy Extension";
public const string PluginVersion = "1.0.0";
private Harmony _harmony;
public override void Load()
{
_harmony = new Harmony(PluginGUID);
_harmony.PatchAll();
// 挂钩会话事件
SessionManager.OnPlayerJoined += OnPlayerJoinedHandler;
SessionManager.OnInventorySynced += OnInventorySyncedHandler;
Log.LogInfo($"{PluginName} loaded successfully");
}
private void OnPlayerJoinedHandler(string playerId)
{
Log.LogInfo($"Player joined: {playerId}");
// 自定义逻辑
}
private void OnInventorySyncedHandler(InventorySyncData data)
{
Log.LogInfo($"Inventory synced - hash: {data.MerkleRootHash}");
}
}
}Harmony Patch Example
Harmony补丁示例
csharp
using HarmonyLib;
using DeepSynergy.Core;
namespace DeepSynergy.CustomExtension
{
[HarmonyPatch(typeof(Player), "ConsumeOxygen")]
public static class OxygenConsumptionPatch
{
static void Prefix(ref float amount)
{
// Apply session multiplier from config
float multiplier = SynergyConfig.Current.OxygenConsumption;
amount *= multiplier;
// Sync to other clients
if (SessionManager.IsHost)
{
NetworkSync.BroadcastOxygenEvent(amount);
}
}
}
}csharp
using HarmonyLib;
using DeepSynergy.Core;
namespace DeepSynergy.CustomExtension
{
[HarmonyPatch(typeof(Player), "ConsumeOxygen")]
public static class OxygenConsumptionPatch
{
static void Prefix(ref float amount)
{
// 应用配置中的会话倍数
float multiplier = SynergyConfig.Current.OxygenConsumption;
amount *= multiplier;
// 同步到其他客户端
if (SessionManager.IsHost)
{
NetworkSync.BroadcastOxygenEvent(amount);
}
}
}
}Custom API Integration
自定义API集成
csharp
using DeepSynergy.API;
using System.Threading.Tasks;
public class CustomNarrativeGenerator
{
private readonly OpenAIClient _openai;
public CustomNarrativeGenerator()
{
string apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY");
_openai = new OpenAIClient(apiKey);
}
public async Task<string> GenerateBaseDescription(BaseStructure baseData)
{
string prompt = $@"Generate a brief narrative description for an underwater base:
- Location: {baseData.Biome}
- Depth: {baseData.DepthMeters}m
- Components: {string.Join(", ", baseData.Modules)}
- Players: {baseData.PlayerCount}
Keep it under 100 words, immersive tone.";
var response = await _openai.GenerateCompletion(prompt, maxTokens: 150);
return response.Text;
}
}csharp
using DeepSynergy.API;
using System.Threading.Tasks;
public class CustomNarrativeGenerator
{
private readonly OpenAIClient _openai;
public CustomNarrativeGenerator()
{
string apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY");
_openai = new OpenAIClient(apiKey);
}
public async Task<string> GenerateBaseDescription(BaseStructure baseData)
{
string prompt = $@"Generate a brief narrative description for an underwater base:
- Location: {baseData.Biome}
- Depth: {baseData.DepthMeters}m
- Components: {string.Join(", ", baseData.Modules)}
- Players: {baseData.PlayerCount}
Keep it under 100 words, immersive tone.";
var response = await _openai.GenerateCompletion(prompt, maxTokens: 150);
return response.Text;
}
}Common Usage Patterns
常见使用场景
Two-Player Resource Gathering Session
双人资源收集会话
json
{
"session_name": "Resource Run",
"max_players": 2,
"difficulty_scale": "static",
"resource_multiplier": 1.3,
"oxygen_consumption": 0.9,
"creature_spawn_divider": 1.2,
"shared_blueprints": true,
"time_of_day_sync": "host"
}Console workflow:
bash
undefinedjson
{
"session_name": "Resource Run",
"max_players": 2,
"difficulty_scale": "static",
"resource_multiplier": 1.3,
"oxygen_consumption": 0.9,
"creature_spawn_divider": 1.2,
"shared_blueprints": true,
"time_of_day_sync": "host"
}控制台操作流程:
bash
undefinedPlayer 1 (Host)
玩家1(房主)
/start_server
/start_server
Share code 4A7B-9C2D-E5F3 with Player 2
将会话码4A7B-9C2D-E5F3分享给玩家2
Player 2 (Client)
玩家2(客户端)
/join_session 4A7B-9C2D-E5F3
/join_session 4A7B-9C2D-E5F3
Both players check sync
两位玩家检查同步状态
/synergy_status
undefined/synergy_status
undefinedFour-Player Base Building
四人基地建造
json
{
"session_name": "Mega Base Construction",
"max_players": 4,
"difficulty_scale": "adaptive",
"resource_multiplier": 2.0,
"oxygen_consumption": 0.7,
"creature_spawn_divider": 2.0,
"shared_blueprints": true,
"ping_locations_shared": true,
"time_of_day_sync": "all"
}json
{
"session_name": "Mega Base Construction",
"max_players": 4,
"difficulty_scale": "adaptive",
"resource_multiplier": 2.0,
"oxygen_consumption": 0.7,
"creature_spawn_divider": 2.0,
"shared_blueprints": true,
"ping_locations_shared": true,
"time_of_day_sync": "all"
}AI-Enhanced Exploration
AI增强探索
json
{
"session_name": "Lore Expedition",
"max_players": 2,
"api_integration": {
"openai": {
"enabled": true,
"api_key_env": "OPENAI_API_KEY",
"model": "gpt-4",
"role": "narrator"
},
"claude": {
"enabled": true,
"api_key_env": "ANTHROPIC_API_KEY",
"model": "claude-3-opus-20240229",
"role": "lore_engine"
}
}
}Generate narratives during gameplay:
bash
/api_narrate "entering the blood kelp zone at 300m depth"json
{
"session_name": "Lore Expedition",
"max_players": 2,
"api_integration": {
"openai": {
"enabled": true,
"api_key_env": "OPENAI_API_KEY",
"model": "gpt-4",
"role": "narrator"
},
"claude": {
"enabled": true,
"api_key_env": "ANTHROPIC_API_KEY",
"model": "claude-3-opus-20240229",
"role": "lore_engine"
}
}
}游戏中生成叙事内容:
bash
/api_narrate "entering the blood kelp zone at 300m depth"Output: "The crimson fronds pulse with bioluminescent life as the team descends..."
输出: "The crimson fronds pulse with bioluminescent life as the team descends..."
/api_lore_generate "crabsquid behavior patterns"
/api_lore_generate "crabsquid behavior patterns"
Output: "Species: Crabsquid (Elektrus Crustacea)..."
输出: "Species: Crabsquid (Elektrus Crustacea)..."
undefinedundefinedTroubleshooting
故障排查
Issue: "Session code invalid or expired"
问题:"会话码无效或已过期"
Cause: NAT traversal failed or host disconnected
Solution:
bash
undefined原因: NAT穿透失败或房主断开连接
解决方案:
bash
undefinedCheck NAT configuration
检查NAT配置
/debug_network true
/debug_network true
Look for "NAT type: Symmetric" in logs (problematic)
在日志中查找"NAT type: Symmetric"(存在问题)
Enable UPnP in session_config.xml
在session_config.xml中启用UPnP
<EnableUPnP>true</EnableUPnP>
<EnableUPnP>true</EnableUPnP>
Alternative: Port forward 25565 on router
替代方案:在路由器上端口转发25565
undefinedundefinedIssue: "Inventory desync detected"
问题:"检测到库存不同步"
Cause: High latency or packet loss causing Merkle tree mismatch
Solution:
bash
undefined原因: 高延迟或丢包导致Merkle树不匹配
解决方案:
bash
undefinedCheck current sync status
检查当前同步状态
/debug_conflicts
/debug_conflicts
Force full resync
强制完全重新同步
/force_resync
/force_resync
Adjust sync interval in config
在配置中调整同步间隔
"sync_interval_ms": 100 # Increase from 50ms
undefined"sync_interval_ms": 100 # 从50ms增加
undefinedIssue: "BepInEx mod not loading"
问题:"BepInEx模组未加载"
Cause: IL2CPP hook failure or incorrect installation
Solution:
- Check for errors
BepInEx/LogOutput.log - Verify BepInEx version is 6.0.x or higher
- Ensure all files are in
.dllBepInEx/plugins/ - Delete and restart game
BepInEx/cache/
原因: IL2CPP钩子失败或安装错误
解决方案:
- 查看中的错误信息
BepInEx/LogOutput.log - 确认BepInEx版本为6.0.x或更高
- 确保所有文件都在
.dll目录下BepInEx/plugins/ - 删除并重启游戏
BepInEx/cache/
Issue: "OpenAI/Claude API calls failing"
问题:"OpenAI/Claude API调用失败"
Cause: Missing or invalid API keys
Solution:
bash
undefined原因: API密钥缺失或无效
解决方案:
bash
undefinedVerify environment variable is set
验证环境变量是否已设置
Windows PowerShell
Windows PowerShell
echo $env:OPENAI_API_KEY
echo $env:OPENAI_API_KEY
Linux/macOS
Linux/macOS
echo $OPENAI_API_KEY
echo $OPENAI_API_KEY
Set if missing (do NOT commit to code)
缺失则设置(切勿提交到代码中)
Windows
Windows
setx OPENAI_API_KEY "your-key-here"
setx OPENAI_API_KEY "your-key-here"
Linux/macOS
Linux/macOS
export OPENAI_API_KEY="your-key-here"
Check config references correct env var:
```json
"api_integration": {
"openai": {
"api_key_env": "OPENAI_API_KEY" // Must match env var name
}
}export OPENAI_API_KEY="your-key-here"
检查配置中引用的环境变量是否正确:
```json
"api_integration": {
"openai": {
"api_key_env": "OPENAI_API_KEY" // 必须与环境变量名称匹配
}
}Issue: "High latency/lag in multiplayer"
问题:"多人模式下延迟高/卡顿"
Cause: Network congestion or inefficient sync intervals
Solution:
bash
undefined原因: 网络拥堵或同步间隔设置不合理
解决方案:
bash
undefinedCheck current latency
检查当前延迟
/synergy_status
/synergy_status
If avg latency > 150ms, adjust config
如果平均延迟>150ms,调整配置
Increase sync intervals in session_config.xml
在session_config.xml中增加同步间隔
<InventoryHashInterval>2000</InventoryHashInterval> # From 1000
<CreatureStateInterval>400</CreatureStateInterval> # From 200
<InventoryHashInterval>2000</InventoryHashInterval> // 从1000改为2000
<CreatureStateInterval>400</CreatureStateInterval> // 从200改为400
Reduce max players
减少最大玩家数
"max_players": 2 # From 4
undefined"max_players": 2 // 从4改为2
undefinedIssue: "Creatures not syncing properly"
问题:"生物同步异常"
Cause: Creature AI state lattice desync
Solution:
bash
undefined原因: 生物AI状态网格不同步
解决方案:
bash
undefinedEnable creature debug logging
启用生物调试日志
/debug_network true
/debug_network true
Check creature sync interval
检查生物同步间隔
<CreatureStateInterval>200</CreatureStateInterval>
<CreatureStateInterval>200</CreatureStateInterval>
Force creature state resync (host only)
强制生物状态重新同步(仅房主可用)
/force_resync creatures
undefined/force_resync creatures
undefinedAdvanced Configuration
高级配置
Custom Biome Multipliers
自定义生物群系倍数
Edit to add biome-specific resource scaling:
synergy_profile.jsonjson
{
"biome_overrides": {
"safe_shallows": {
"resource_multiplier": 1.0,
"creature_spawn_divider": 1.0
},
"kelp_forest": {
"resource_multiplier": 1.2,
"creature_spawn_divider": 1.3
},
"blood_kelp_zone": {
"resource_multiplier": 1.5,
"creature_spawn_divider": 2.0
},
"lost_river": {
"resource_multiplier": 2.0,
"creature_spawn_divider": 2.5
}
}
}编辑添加生物群系专属资源缩放:
synergy_profile.jsonjson
{
"biome_overrides": {
"safe_shallows": {
"resource_multiplier": 1.0,
"creature_spawn_divider": 1.0
},
"kelp_forest": {
"resource_multiplier": 1.2,
"creature_spawn_divider": 1.3
},
"blood_kelp_zone": {
"resource_multiplier": 1.5,
"creature_spawn_divider": 2.0
},
"lost_river": {
"resource_multiplier": 2.0,
"creature_spawn_divider": 2.5
}
}
}Session Persistence
会话持久化
Enable session save/load:
json
{
"session_persistence": {
"enabled": true,
"autosave_interval_minutes": 10,
"save_directory": "BepInEx/saves/",
"compress_saves": true
}
}Load saved session:
bash
/load_session "Deep_Exploration_2026-05-14"启用会话保存/加载功能:
json
{
"session_persistence": {
"enabled": true,
"autosave_interval_minutes": 10,
"save_directory": "BepInEx/saves/",
"compress_saves": true
}
}加载已保存的会话:
bash
/load_session "Deep_Exploration_2026-05-14"Localization Customization
本地化自定义
Add custom translations in :
BepInEx/config/localizations/custom_en.jsonjson
{
"ui.session.created": "Session established: {0}",
"ui.player.joined": "{0} has entered the abyss",
"ui.inventory.synced": "Inventory synchronized",
"console.help.start_server": "Create a new multiplayer session"
}Reference in code:
csharp
string message = LocalizationManager.Get("ui.player.joined", playerName);在中添加自定义翻译:
BepInEx/config/localizations/custom_en.jsonjson
{
"ui.session.created": "Session established: {0}",
"ui.player.joined": "{0} has entered the abyss",
"ui.inventory.synced": "Inventory synchronized",
"console.help.start_server": "Create a new multiplayer session"
}代码中引用:
csharp
string message = LocalizationManager.Get("ui.player.joined", playerName);Performance Optimization
性能优化
Reduce Bandwidth Usage
减少带宽占用
json
{
"network": {
"compression": "lz4",
"delta_encoding": true,
"sync_radius_meters": 500, // Only sync entities within 500m
"inventory_batch_updates": true
}
}json
{
"network": {
"compression": "lz4",
"delta_encoding": true,
"sync_radius_meters": 500, // 仅同步500米范围内的实体
"inventory_batch_updates": true
}
}Optimize for Low-End Systems
低配系统优化
json
{
"performance": {
"reduce_sync_precision": true, // Reduce float precision for position sync
"skip_inactive_entities": true, // Don't sync entities outside render distance
"lazy_merkle_updates": true // Update inventory tree only on change
}
}json
{
"performance": {
"reduce_sync_precision": true, // 降低位置同步的浮点精度
"skip_inactive_entities": true, // 不同步渲染距离外的实体
"lazy_merkle_updates": true // 仅在变化时更新库存树
}
}Security Considerations
安全注意事项
- Never hardcode API keys - always use environment variables
- Session codes are single-use - regenerate for each session
- Inventory Merkle trees prevent duping - tampering detected automatically
- Host migration is automatic - session survives host disconnection
- No executable code transmission - only JSON state data synchronized
- 切勿硬编码API密钥 — 始终使用环境变量
- 会话码为一次性使用 — 每次会话重新生成
- 库存Merkle树防止物品复制 — 篡改会被自动检测
- 房主迁移自动进行 — 房主断开后会话仍可继续
- 不传输可执行代码 — 仅同步JSON状态数据