| name | subnautica-ii-coop-mod |
| description | BepInEx-based multiplayer co-op mod for Subnautica 2 with synchronized gameplay, adaptive scaling, and decentralized peer-to-peer networking |
| triggers | ["how do I install the Subnautica 2 co-op mod","set up multiplayer for Subnautica 2","configure Deep Synergy mod","troubleshoot Subnautica 2 multiplayer sync issues","create a co-op session in Subnautica 2","integrate OpenAI narration with Subnautica mod","adjust difficulty scaling for Subnautica multiplayer","fix BepInEx plugin conflicts in Subnautica"] |
Subnautica II Co-op Mod (Deep Synergy)
Skill by ara.so — Devtools Skills collection.
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, shared inventory systems, and peer-to-peer networking without requiring central servers.
Key Capabilities:
- Deterministic state synchronization across multiple clients
- Adaptive dynamic scaling based on player count
- BepInEx IL2CPP plugin architecture for Unity runtime hooks
- Decentralized peer-to-peer networking with NAT punch-through
- Optional OpenAI/Claude API integration for narrative generation
- Cross-platform support (Windows, Linux, macOS)
Installation
Prerequisites
- Subnautica 2 installed via Steam or GOG
- BepInEx 6.0.x or later for Unity IL2CPP games
Installation Steps
cp -r BepInEx/plugins/* <Subnautica2Directory>/BepInEx/plugins/
mkdir -p <Subnautica2Directory>/BepInEx/config/
Directory Structure
Subnautica2/
├── BepInEx/
│ ├── core/
│ ├── plugins/
│ │ ├── DeepSynergy.dll
│ │ ├── SessionManager.dll
│ │ └── StateSynchronizer.dll
│ └── config/
│ ├── synergy_profile.json
│ └── session_config.xml
└── Subnautica2.exe
Configuration
Profile Configuration
Create BepInEx/config/synergy_profile.json:
{
"session_name": "DeepDive Squad",
"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": "discord_rpc",
"network": {
"use_nat_punchthrough":
Configuration Options
| Field | Type | Description |
|---|
session_name | string | Display name for your session |
max_players | int | Maximum concurrent players (2-8) |
difficulty_scale | string | "adaptive", "fixed", or "custom" |
resource_multiplier | float | Resource spawn rate multiplier (0.5-2.0) |
oxygen_consumption | float | Oxygen drain rate (0.5-2.0, lower = slower drain) |
creature_spawn_divider | int | Divides creature spawn counts |
shared_blueprints | bool | Share unlocked blueprints across players |
ping_locations_shared | bool | Synchronize map pings |
time_of_day_sync | string | "all", "host", or "individual" |
API Integration Setup
export OPENAI_API_KEY="your-openai-key-here"
export ANTHROPIC_API_KEY="your-anthropic-key-here"
Console Commands
Access the BepInEx console by pressing F1 in-game (default keybind).
Session Management
/start_server
/join_session <session-code>
/leave_session
/synergy_status
Gameplay Controls
/synergy_scale <multiplier>
/seed_override <seed>
/force_sync inventory
/teleport_to <player_name>
API-Powered Features
/api_narrate "<context>"
/api_lore <creature_id>
/api_name_base
Code Examples
Custom Plugin Integration
If you're developing additional BepInEx plugins that interact with Deep Synergy:
using BepInEx;
using BepInEx.IL2CPP;
using DeepSynergy.API;
using UnityEngine;
namespace MyCustomPlugin
{
[BepInPlugin("com.myname.custommod", "Custom Mod", "1.0.0")]
[BepInDependency("com.deepsynergy.core", BepInDependency.DependencyFlags.HardDependency)]
public class CustomPlugin : BasePlugin
{
public override void Load()
{
var sessionManager = DeepSynergyAPI.GetSessionManager();
sessionManager.OnPlayerJoined += OnPlayerJoined;
sessionManager.OnPlayerLeft += OnPlayerLeft;
sessionManager.OnStateSync += OnStateSync;
Log.LogInfo("Custom plugin loaded with Deep Synergy integration");
}
private void OnPlayerJoined(PlayerInfo player)
{
Log.LogInfo($"Player joined: {player.Name} (ID: {player.PeerId})");
DeepSynergyAPI.BroadcastCustomData("MyCustomPlugin", new {
message = $"{player.Name} joined!",
timestamp = System.DateTime.UtcNow
});
}
private void OnPlayerLeft()
{
Log.LogInfo();
}
{
(syncEvent.Type == SyncEventType.InventoryUpdate)
{
Log.LogInfo();
}
}
}
}
Programmatic Configuration
using DeepSynergy.Config;
using Newtonsoft.Json;
using System.IO;
public class ConfigManager
{
public static SynergyProfile LoadProfile(string path)
{
var json = File.ReadAllText(path);
return JsonConvert.DeserializeObject<SynergyProfile>(json);
}
public static void CreateDefaultProfile(string path)
{
var profile = new SynergyProfile
{
SessionName = "New Session",
MaxPlayers = 4,
DifficultyScale = "adaptive",
ResourceMultiplier = 1.0f,
OxygenConsumption = 1.0f,
CreatureSpawnDivider = 1,
EnablePvp = false,
SharedBlueprints = true,
Network = new NetworkConfig
{
UseNatPunchthrough = true,
Port = 7777,
MaxLatencyMs = 200,
SyncIntervalMs = 50
}
};
var json = JsonConvert.SerializeObject(profile, Formatting.Indented);
File.WriteAllText(path, json);
}
public static void UpdateScaling(float multiplier)
{
api = DeepSynergyAPI.GetSessionManager();
api.SetDifficultyMultiplier(multiplier);
}
}
Custom API Integration
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
public class NarrativeEngine
{
private readonly string _openAiKey;
private readonly HttpClient _client;
public NarrativeEngine()
{
_openAiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY");
_client = new HttpClient();
_client.DefaultRequestHeaders.Add("Authorization", $"Bearer {_openAiKey}");
}
public async Task<string> GenerateNarration(string context)
{
var request = new
{
model = "gpt-4",
messages = new[]
{
new { role = "system", content = "You are a narrative engine for Subnautica 2, providing immersive journal entries." },
new { role = "user", content = $"Generate a brief journal entry about: {context}" }
},
max_tokens = 150,
temperature = 0.8
};
var json = JsonConvert.SerializeObject(request);
var content = new StringContent(json, Encoding.UTF8, );
response = _client.PostAsync(
,
content
);
responseJson = response.Content.ReadAsStringAsync();
result = JsonConvert.DeserializeObject<>(responseJson);
result.choices[].message.content.ToString();
}
}
Common Patterns
Hosting a Session
/start_server
Joining a Session
/join_session 9B2A-4C7D-E8F1
/synergy_status
Monitoring Session Health
/synergy_status
Adaptive Difficulty Adjustment
/synergy_status
/synergy_scale 1.5
/synergy_scale 1.0
Troubleshooting
Connection Issues
Problem: Cannot connect to host / "Connection timeout"
"network": {
"use_nat_punchthrough": true,
"port": 7777
}
grep "SessionManager" BepInEx/LogOutput.log
Problem: "State sync failed" errors
/force_sync inventory
Performance Issues
Problem: High latency or stuttering
"network": {
"sync_interval_ms": 100
}
"creature_spawn_divider": 2
/synergy_status
Problem: Game crashes on session join
rm -rf BepInEx/cache/*
grep "IL2CPP" BepInEx/LogOutput.log
API Integration Issues
Problem: OpenAI/Claude narration not working
echo $OPENAI_API_KEY
echo $ANTHROPIC_API_KEY
"api_integration": {
"openai": {
"enabled": true,
"api_key_env": "OPENAI_API_KEY"
}
}
/api_narrate "test"
Inventory Desync
Problem: Items disappearing or duplicating
/force_sync inventory
/synergy_status
/leave_session
Localization Issues
Problem: UI text showing wrong language
{
"locale": "en-US"
}
Log Analysis
tail -n 100 BepInEx/LogOutput.log | grep ERROR
grep "DeepSynergy" BepInEx/LogOutput.log
tail -f BepInEx/LogOutput.log
Best Practices
- Always backup save files before using multiplayer mods
- Use matching mod versions across all players
- Configure firewall rules before hosting sessions
- Monitor latency with
/synergy_status during gameplay
- Disable conflicting mods if experiencing issues
- Use environment variables for API keys, never hardcode
- Test configuration changes in solo mode before hosting
Advanced Usage
Custom Sync Rules
DeepSynergyAPI.RegisterSyncHandler("CustomItemType", (data, playerId) => {
var item = JsonConvert.DeserializeObject<CustomItem>(data);
GameState.ApplyCustomItem(item, playerId);
});
Session Migration
/migrate_host <player_name>
Debugging Mode
{
"debug": {
"enabled": true,
"log_sync_events": true,
"log_network_packets": true
}
}