subnautica-2-coop-mod

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Subnautica 2 Co-op Mod Skill

Subnautica 2 合作模组 Skill

Skill by ara.so — Devtools Skills collection.
ara.so开发的Skill — 属于Devtools Skills合集。

Overview

概述

The Deep Synergy Multiplayer Mod transforms Subnautica 2 into a synchronized cooperative experience using BepInEx plugin architecture. It implements peer-to-peer multiplayer with deterministic state synchronization, shared inventory systems, and adaptive difficulty scaling based on player count.
Core Capabilities:
  • Peer-to-peer WebRTC connections with NAT traversal
  • Real-time world state synchronization (base building, inventory, creature AI)
  • Host migration and session persistence
  • Adaptive difficulty scaling (2-4 players)
  • Cross-platform support (Windows, Linux, macOS)
Deep Synergy多人模组借助BepInEx插件架构,将Subnautica 2转变为同步合作体验。它实现了带有确定性状态同步的点对点多人模式、共享库存系统,以及基于玩家数量的自适应难度缩放。
核心功能:
  • 支持NAT穿透的点对点WebRTC连接
  • 实时世界状态同步(基地建造、库存、生物AI)
  • 主机迁移与会话持久化
  • 自适应难度缩放(支持2-4名玩家)
  • 跨平台支持(Windows、Linux、macOS)

Installation

安装

Prerequisites

前置条件

  1. Install BepInEx 6.0.x for Subnautica 2:
bash
undefined
  1. 为Subnautica 2安装BepInEx 6.0.x:
bash
undefined

Extract to Subnautica 2 game directory

Extract to Subnautica 2 game directory

Structure should be: Subnautica2/BepInEx/

Structure should be: Subnautica2/BepInEx/


2. **Verify BepInEx is working**:
   - Launch game once, check for `BepInEx/LogOutput.log`
   - Should see "Chainloader initialized" message

3. **Install Deep Synergy Mod**:
```bash

2. **验证BepInEx是否正常工作:**
   - 启动游戏一次,检查是否存在`BepInEx/LogOutput.log`文件
   - 日志中应显示"Chainloader initialized"消息

3. **安装Deep Synergy模组:**
```bash

Extract mod archive to:

Extract mod archive to:

Subnautica2/BepInEx/plugins/DeepSynergy/

Subnautica2/BepInEx/plugins/DeepSynergy/

Files: DeepSynergy.dll, config/synergy_profile.json

Files: DeepSynergy.dll, config/synergy_profile.json

undefined
undefined

Directory Structure

目录结构

Subnautica2/
├── BepInEx/
│   ├── core/
│   ├── plugins/
│   │   └── DeepSynergy/
│   │       ├── DeepSynergy.dll
│   │       └── dependencies/
│   └── config/
│       └── synergy_profile.json
Subnautica2/
├── BepInEx/
│   ├── core/
│   ├── plugins/
│   │   └── DeepSynergy/
│   │       ├── DeepSynergy.dll
│   │       └── dependencies/
│   └── config/
│       └── synergy_profile.json

Configuration

配置

Basic Profile Configuration

基础配置文件设置

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": "host",
  "voice_chat_integration": "disabled",
  "network": {
    "port": 7777,
    "timeout_seconds": 30,
    "max_latency_ms": 250
  },
  "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"
    }
  }
}
创建或编辑
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": "host",
  "voice_chat_integration": "disabled",
  "network": {
    "port": 7777,
    "timeout_seconds": 30,
    "max_latency_ms": 250
  },
  "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"
    }
  }
}

Configuration Fields Reference

配置字段参考

FieldTypeDescriptionDefault
session_name
stringDisplay name for session"Co-op Session"
max_players
int2-4 players supported2
difficulty_scale
enum"adaptive", "fixed", "hardcore""adaptive"
resource_multiplier
floatScales harvestable resources (0.5-2.0)1.0
oxygen_consumption
floatO2 drain multiplier (0.5-1.5)1.0
shared_blueprints
boolUnlocks shared across playerstrue
time_of_day_sync
enum"host", "all", "independent""host"
字段类型描述默认值
session_name
string会话显示名称"Co-op Session"
max_players
int支持2-4名玩家2
difficulty_scale
enum"adaptive"(自适应)、"fixed"(固定)、"hardcore"(硬核)"adaptive"
resource_multiplier
float可采集资源缩放比例(0.5-2.0)1.0
oxygen_consumption
float氧气消耗倍率(0.5-1.5)1.0
shared_blueprints
bool蓝图解锁在玩家间共享true
time_of_day_sync
enum"host"(跟随主机)、"all"(全局同步)、"independent"(独立)"host"

Console Commands

控制台命令

The mod adds in-game console commands accessible via BepInEx terminal (F5 by default):
该模组添加了可通过BepInEx终端(默认按F5)访问的游戏内控制台命令:

Session Management

会话管理

bash
undefined
bash
undefined

Host a new session

Host a new session

/start_server
/start_server

Join existing session

Join existing session

/join_session <session-code>
/join_session <session-code>

Example: /join_session 9B2A-4C7D-E8F1

Example: /join_session 9B2A-4C7D-E8F1

Leave current session

Leave current session

/leave_session
/leave_session

Force disconnect player (host only)

Force disconnect player (host only)

/kick_player <player-id>
undefined
/kick_player <player-id>
undefined

Session Monitoring

会话监控

bash
undefined
bash
undefined

Show connection status

Show connection status

/synergy_status
/synergy_status

Output:

Output:

Connected peers: 3

Connected peers: 3

State sync: 100% complete

State sync: 100% complete

Inventory hash: 0xFA342B1E

Inventory hash: 0xFA342B1E

Avg latency: 45ms

Avg latency: 45ms

List connected players

List connected players

/list_players
/list_players

Output:

Output:

[1] PlayerName (host) - 35ms

[1] PlayerName (host) - 35ms

[2] Player2 - 52ms

[2] Player2 - 52ms

[3] Player3 - 48ms

[3] Player3 - 48ms

undefined
undefined

Gameplay Adjustments

游戏玩法调整

bash
undefined
bash
undefined

Temporarily adjust difficulty

Temporarily adjust difficulty

/synergy_scale <multiplier>
/synergy_scale <multiplier>

Example: /synergy_scale 1.5

Example: /synergy_scale 1.5

Override world seed (must do before starting)

Override world seed (must do before starting)

/seed_override <seed-number>
/seed_override <seed-number>

Example: /seed_override 8251

Example: /seed_override 8251

Force state resync

Force state resync

/force_sync
/force_sync

Debug inventory state

Debug inventory state

/debug_inventory
undefined
/debug_inventory
undefined

AI Integration (if enabled)

AI集成(若已启用)

bash
undefined
bash
undefined

Trigger narrative generation

Trigger narrative generation

/api_narrate "<context>"
/api_narrate "<context>"

Example: /api_narrate "exploring thermal vents"

Example: /api_narrate "exploring thermal vents"

Generate species lore

Generate species lore

/api_lore_species <creature-name>
/api_lore_species <creature-name>

Example: /api_lore_species "ghost_leviathan"

Example: /api_lore_species "ghost_leviathan"

undefined
undefined

Code Examples

代码示例

Creating a Custom Mod Plugin (C#)

创建自定义模组插件(C#)

If extending the Deep Synergy mod with custom functionality:
csharp
using BepInEx;
using BepInEx.IL2CPP;
using DeepSynergy.Core;
using UnityEngine;

namespace MyCustomExtension
{
    [BepInPlugin("com.example.subnautica2.extension", "Custom Extension", "1.0.0")]
    [BepInDependency("com.deepsynergy.subnautica2", BepInDependency.DependencyFlags.HardDependency)]
    public class CustomPlugin : BasePlugin
    {
        public override void Load()
        {
            // Hook into Deep Synergy events
            SessionManager.OnPlayerJoined += HandlePlayerJoin;
            SessionManager.OnStateSync += HandleStateSync;
            
            Log.LogInfo("Custom Extension loaded");
        }

        private void HandlePlayerJoin(PlayerInfo player)
        {
            Log.LogInfo($"Player {player.Name} joined with ID {player.Id}");
            
            // Send custom welcome message
            NetworkMessenger.SendToPlayer(player.Id, new WelcomeMessage
            {
                Text = $"Welcome {player.Name}!",
                Color = Color.cyan
            });
        }

        private void HandleStateSync(SyncEvent syncEvent)
        {
            // React to state changes
            if (syncEvent.Type == SyncType.InventoryUpdate)
            {
                Log.LogInfo($"Inventory synced: {syncEvent.Data}");
            }
        }
    }
}
如果要为Deep Synergy模组扩展自定义功能:
csharp
using BepInEx;
using BepInEx.IL2CPP;
using DeepSynergy.Core;
using UnityEngine;

namespace MyCustomExtension
{
    [BepInPlugin("com.example.subnautica2.extension", "Custom Extension", "1.0.0")]
    [BepInDependency("com.deepsynergy.subnautica2", BepInDependency.DependencyFlags.HardDependency)]
    public class CustomPlugin : BasePlugin
    {
        public override void Load()
        {
            // Hook into Deep Synergy events
            SessionManager.OnPlayerJoined += HandlePlayerJoin;
            SessionManager.OnStateSync += HandleStateSync;
            
            Log.LogInfo("Custom Extension loaded");
        }

        private void HandlePlayerJoin(PlayerInfo player)
        {
            Log.LogInfo($"Player {player.Name} joined with ID {player.Id}");
            
            // Send custom welcome message
            NetworkMessenger.SendToPlayer(player.Id, new WelcomeMessage
            {
                Text = $"Welcome {player.Name}!",
                Color = Color.cyan
            });
        }

        private void HandleStateSync(SyncEvent syncEvent)
        {
            // React to state changes
            if (syncEvent.Type == SyncType.InventoryUpdate)
            {
                Log.LogInfo($"Inventory synced: {syncEvent.Data}");
            }
        }
    }
}

Custom Network Message Handler

自定义网络消息处理器

csharp
using DeepSynergy.Networking;

public class CustomMessageHandler : INetworkMessageHandler
{
    public void RegisterHandlers()
    {
        NetworkManager.RegisterHandler<CustomDataPacket>(OnCustomData);
    }

    private void OnCustomData(CustomDataPacket packet)
    {
        // Process custom multiplayer data
        Debug.Log($"Received from {packet.SenderId}: {packet.Payload}");
        
        // Broadcast to other clients
        if (NetworkManager.IsHost)
        {
            NetworkManager.BroadcastExcept(packet, packet.SenderId);
        }
    }
}

[Serializable]
public class CustomDataPacket : INetworkPacket
{
    public string SenderId { get; set; }
    public string Payload { get; set; }
    public long Timestamp { get; set; }
}
csharp
using DeepSynergy.Networking;

public class CustomMessageHandler : INetworkMessageHandler
{
    public void RegisterHandlers()
    {
        NetworkManager.RegisterHandler<CustomDataPacket>(OnCustomData);
    }

    private void OnCustomData(CustomDataPacket packet)
    {
        // Process custom multiplayer data
        Debug.Log($"Received from {packet.SenderId}: {packet.Payload}");
        
        // Broadcast to other clients
        if (NetworkManager.IsHost)
        {
            NetworkManager.BroadcastExcept(packet, packet.SenderId);
        }
    }
}

[Serializable]
public class CustomDataPacket : INetworkPacket
{
    public string SenderId { get; set; }
    public string Payload { get; set; }
    public long Timestamp { get; set; }
}

Session Configuration Override at Runtime

运行时覆盖会话配置

csharp
using DeepSynergy.Config;

public class DynamicConfigManager
{
    public static void AdjustDifficulty(float multiplier)
    {
        var config = SessionConfig.Current;
        config.ResourceMultiplier *= multiplier;
        config.CreatureSpawnDivider = (int)(config.CreatureSpawnDivider / multiplier);
        
        SessionConfig.ApplyChanges(config);
        NetworkManager.SyncConfig(); // Broadcast to all clients
    }

    public static void EnableAPI(string provider)
    {
        var config = SessionConfig.Current;
        
        if (provider == "openai")
        {
            config.ApiIntegration.OpenAI.Enabled = true;
            config.ApiIntegration.OpenAI.ApiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY");
        }
        else if (provider == "claude")
        {
            config.ApiIntegration.Claude.Enabled = true;
            config.ApiIntegration.Claude.ApiKey = Environment.GetEnvironmentVariable("ANTHROPIC_API_KEY");
        }
        
        SessionConfig.ApplyChanges(config);
    }
}
csharp
using DeepSynergy.Config;

public class DynamicConfigManager
{
    public static void AdjustDifficulty(float multiplier)
    {
        var config = SessionConfig.Current;
        config.ResourceMultiplier *= multiplier;
        config.CreatureSpawnDivider = (int)(config.CreatureSpawnDivider / multiplier);
        
        SessionConfig.ApplyChanges(config);
        NetworkManager.SyncConfig(); // Broadcast to all clients
    }

    public static void EnableAPI(string provider)
    {
        var config = SessionConfig.Current;
        
        if (provider == "openai")
        {
            config.ApiIntegration.OpenAI.Enabled = true;
            config.ApiIntegration.OpenAI.ApiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY");
        }
        else if (provider == "claude")
        {
            config.ApiIntegration.Claude.Enabled = true;
            config.ApiIntegration.Claude.ApiKey = Environment.GetEnvironmentVariable("ANTHROPIC_API_KEY");
        }
        
        SessionConfig.ApplyChanges(config);
    }
}

Common Patterns

常见操作流程

Hosting a Session

托管会话

bash
undefined
bash
undefined

1. Configure profile

1. Configure profile

vim BepInEx/config/synergy_profile.json
vim BepInEx/config/synergy_profile.json

2. Launch game, open console (F5)

2. Launch game, open console (F5)

/start_server
/start_server

3. Share session code with players

3. Share session code with players

Output: Session code: 9B2A-4C7D-E8F1

Output: Session code: 9B2A-4C7D-E8F1

4. Wait for players to join

4. Wait for players to join

/list_players
/list_players

5. Start playing when ready

5. Start playing when ready

undefined
undefined

Joining a Session

加入会话

bash
undefined
bash
undefined

1. Launch game, open console

1. Launch game, open console

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

2. Wait for state sync

2. Wait for state sync

/synergy_status
/synergy_status

Should show "State sync: 100% complete"

Should show "State sync: 100% complete"

3. Verify connection

3. Verify connection

/list_players
undefined
/list_players
undefined

Handling Disconnects

处理断开连接

The mod automatically handles host migration:
csharp
// Host migration is automatic, but you can monitor it:
SessionManager.OnHostMigration += (newHostId) =>
{
    Debug.Log($"Host migrated to player {newHostId}");
    // UI notification, state verification, etc.
};

// Manual reconnection attempt
if (!NetworkManager.IsConnected)
{
    NetworkManager.AttemptReconnect(lastSessionCode);
}
模组会自动处理主机迁移:
csharp
// Host migration is automatic, but you can monitor it:
SessionManager.OnHostMigration += (newHostId) =>
{
    Debug.Log($"Host migrated to player {newHostId}");
    // UI notification, state verification, etc.
};

// Manual reconnection attempt
if (!NetworkManager.IsConnected)
{
    NetworkManager.AttemptReconnect(lastSessionCode);
}

Custom Difficulty Presets

自定义难度预设

json
{
  "presets": {
    "easy": {
      "resource_multiplier": 1.5,
      "oxygen_consumption": 0.7,
      "creature_spawn_divider": 2
    },
    "normal": {
      "resource_multiplier": 1.0,
      "oxygen_consumption": 1.0,
      "creature_spawn_divider": 1
    },
    "hardcore": {
      "resource_multiplier": 0.7,
      "oxygen_consumption": 1.3,
      "creature_spawn_divider": 0.8,
      "friendly_fire": true
    }
  },
  "active_preset": "normal"
}
json
{
  "presets": {
    "easy": {
      "resource_multiplier": 1.5,
      "oxygen_consumption": 0.7,
      "creature_spawn_divider": 2
    },
    "normal": {
      "resource_multiplier": 1.0,
      "oxygen_consumption": 1.0,
      "creature_spawn_divider": 1
    },
    "hardcore": {
      "resource_multiplier": 0.7,
      "oxygen_consumption": 1.3,
      "creature_spawn_divider": 0.8,
      "friendly_fire": true
    }
  },
  "active_preset": "normal"
}

Troubleshooting

故障排除

Connection Issues

连接问题

Problem: Cannot join session / "Connection timeout"
Solutions:
bash
undefined
问题: 无法加入会话 / "连接超时"
解决方案:
bash
undefined

1. Check firewall rules

1. Check firewall rules

sudo ufw allow 7777/udp # Linux
sudo ufw allow 7777/udp # Linux

Windows: Allow BepInEx through Windows Defender Firewall

Windows: Allow BepInEx through Windows Defender Firewall

2. Verify NAT configuration

2. Verify NAT configuration

Router should allow UDP hole punching

Router should allow UDP hole punching

Or manually forward port 7777 to host machine

Or manually forward port 7777 to host machine

3. Check console for errors

3. Check console for errors

/synergy_status
/synergy_status

Look for "NAT traversal failed" or "Peer unreachable"

Look for "NAT traversal failed" or "Peer unreachable"

4. Increase timeout

4. Increase timeout

Edit synergy_profile.json:

Edit synergy_profile.json:

"network": { "timeout_seconds": 60, "max_latency_ms": 500 }
"network": { "timeout_seconds": 60, "max_latency_ms": 500 }

5. Test direct connection (bypass NAT)

5. Test direct connection (bypass NAT)

/join_session <host-ip>:7777
undefined
/join_session <host-ip>:7777
undefined

State Desync

状态不同步

Problem: Players see different base structures / inventory
Solutions:
bash
undefined
问题: 玩家看到的基地结构/库存不一致
解决方案:
bash
undefined

1. Force resynchronization

1. Force resynchronization

/force_sync
/force_sync

2. Check hash integrity

2. Check hash integrity

/debug_inventory
/debug_inventory

Compare hashes between clients

Compare hashes between clients

3. Restart session if corruption detected

3. Restart session if corruption detected

/leave_session
/leave_session

Host: /start_server (with same seed)

Host: /start_server (with same seed)

Clients: /join_session <new-code>

Clients: /join_session <new-code>

4. Clear cache (last resort)

4. Clear cache (last resort)

rm -rf BepInEx/cache/synergy_state.dat
undefined
rm -rf BepInEx/cache/synergy_state.dat
undefined

Performance Degradation

性能下降

Problem: Lag spikes, FPS drops with multiple players
Solutions:
bash
undefined
问题: 多人游戏时出现卡顿、帧率下降
解决方案:
bash
undefined

1. Reduce sync frequency (trade responsiveness for performance)

1. Reduce sync frequency (trade responsiveness for performance)

Edit synergy_profile.json:

Edit synergy_profile.json:

"network": { "sync_interval_ms": 100, # Default: 50ms "state_compression": true }
"network": { "sync_interval_ms": 100, # Default: 50ms "state_compression": true }

2. Limit creature AI sync

2. Limit creature AI sync

"creature_sync_range": 100, # Only sync creatures within 100m
"creature_sync_range": 100, # Only sync creatures within 100m

3. Monitor bandwidth usage

3. Monitor bandwidth usage

/synergy_status
/synergy_status

Look for "Bandwidth: X MB/s"

Look for "Bandwidth: X MB/s"

4. Disable API integrations if enabled

4. Disable API integrations if enabled

"api_integration": { "openai": { "enabled": false }, "claude": { "enabled": false } }
undefined
"api_integration": { "openai": { "enabled": false }, "claude": { "enabled": false } }
undefined

Mod Conflicts

模组冲突

Problem: Crashes with other BepInEx mods
Solutions:
bash
undefined
问题: 与其他BepInEx模组一起使用时崩溃
解决方案:
bash
undefined

1. Check BepInEx logs

1. Check BepInEx logs

tail -f BepInEx/LogOutput.log
tail -f BepInEx/LogOutput.log

2. Disable conflicting mods

2. Disable conflicting mods

Common conflicts: other multiplayer mods, world-state mods

Common conflicts: other multiplayer mods, world-state mods

mv BepInEx/plugins/ConflictingMod.dll BepInEx/plugins/disabled/
mv BepInEx/plugins/ConflictingMod.dll BepInEx/plugins/disabled/

3. Load order matters - ensure Deep Synergy loads first

3. Load order matters - ensure Deep Synergy loads first

Rename: DeepSynergy.dll -> 00_DeepSynergy.dll

Rename: DeepSynergy.dll -> 00_DeepSynergy.dll

4. Report incompatibilities

4. Report incompatibilities

undefined
undefined

API Integration Errors

API集成错误

Problem: OpenAI/Claude features not working
Solutions:
bash
undefined
问题: OpenAI/Claude功能无法正常工作
解决方案:
bash
undefined

1. Verify environment variables

1. Verify environment variables

echo $OPENAI_API_KEY echo $ANTHROPIC_API_KEY
echo $OPENAI_API_KEY echo $ANTHROPIC_API_KEY

2. Test API connectivity

2. Test API connectivity

/api_narrate "test connection"
/api_narrate "test connection"

Check logs for HTTP errors

Check logs for HTTP errors

3. Check rate limits

3. Check rate limits

APIs have usage quotas - verify account status

APIs have usage quotas - verify account status

4. Fallback to local mode

4. Fallback to local mode

"api_integration": { "openai": { "enabled": false }, "fallback_to_local": true }
undefined
"api_integration": { "openai": { "enabled": false }, "fallback_to_local": true }
undefined

Advanced Configuration

高级配置

Custom Network Transport

自定义网络传输层

csharp
using DeepSynergy.Networking;

public class CustomTransportLayer : INetworkTransport
{
    public void Initialize(TransportConfig config)
    {
        // Implement custom UDP/TCP logic
        // Example: Use QUIC instead of WebRTC
    }

    public void Send(byte[] data, string targetId)
    {
        // Custom send implementation
    }

    public void Broadcast(byte[] data)
    {
        // Broadcast to all peers
    }
}

// Register in plugin Load()
NetworkManager.RegisterTransport(new CustomTransportLayer());
csharp
using DeepSynergy.Networking;

public class CustomTransportLayer : INetworkTransport
{
    public void Initialize(TransportConfig config)
    {
        // Implement custom UDP/TCP logic
        // Example: Use QUIC instead of WebRTC
    }

    public void Send(byte[] data, string targetId)
    {
        // Custom send implementation
    }

    public void Broadcast(byte[] data)
    {
        // Broadcast to all peers
    }
}

// Register in plugin Load()
NetworkManager.RegisterTransport(new CustomTransportLayer());

Event Hooks

事件钩子

csharp
// Available event hooks
SessionManager.OnPlayerJoined += (player) => { /* ... */ };
SessionManager.OnPlayerLeft += (playerId) => { /* ... */ };
SessionManager.OnStateSync += (syncEvent) => { /* ... */ };
SessionManager.OnHostMigration += (newHostId) => { /* ... */ };
InventoryManager.OnItemPickup += (item, playerId) => { /* ... */ };
BaseBuilder.OnStructurePlaced += (structure, playerId) => { /* ... */ };
csharp
// Available event hooks
SessionManager.OnPlayerJoined += (player) => { /* ... */ };
SessionManager.OnPlayerLeft += (playerId) => { /* ... */ };
SessionManager.OnStateSync += (syncEvent) => { /* ... */ };
SessionManager.OnHostMigration += (newHostId) => { /* ... */ };
InventoryManager.OnItemPickup += (item, playerId) => { /* ... */ };
BaseBuilder.OnStructurePlaced += (structure, playerId) => { /* ... */ };

Best Practices

最佳实践

  1. Always verify state sync before critical actions (e.g., blueprint unlocks)
  2. Use console commands for debugging before modifying config files
  3. Back up save files before enabling PvP or hardcore modes
  4. Monitor network stats with
    /synergy_status
    regularly
  5. Disable API integrations if not needed (reduces overhead)
  6. Test with 2 players first before scaling to 3-4
  7. Use environment variables for API keys, never hardcode
  1. 在执行关键操作前(如解锁蓝图),务必验证状态同步
  2. 修改配置文件前,先使用控制台命令进行调试
  3. 启用PvP或硬核模式前,备份存档文件
  4. 定期使用
    /synergy_status
    监控网络状态
  5. 如果不需要API集成,禁用它们以减少性能开销
  6. 先使用2名玩家测试,再扩展到3-4名玩家
  7. 使用环境变量存储API密钥,切勿硬编码

Resources

资源

  • Wiki: Project documentation and compatibility lists
  • Discord: Real-time community support
  • Issue Tracker: Bug reports and feature requests
  • BepInEx Docs: https://docs.bepinex.dev/
  • Wiki: 项目文档与兼容性列表
  • Discord: 实时社区支持
  • Issue Tracker: 提交Bug报告与功能请求
  • BepInEx文档: https://docs.bepinex.dev/