Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
VBNetTweaks
VBNetTweaks is a comprehensive optimization mod for Valheim's multiplayer experience. Designed to improve performance on both servers and clients, reduce lag and stuttering, optimize network traffic, and enhance player synchronization.
| Date uploaded | 3 days ago |
| Version | 0.2.8 |
| Download link | VitByr-VBNetTweaks-0.2.8.zip |
| Downloads | 543 |
| Dependency string | VitByr-VBNetTweaks-0.2.8 |
This mod requires the following mods to function
ValheimModding-Jotunn
Jötunn (/ˈjɔːtʊn/, 'giant'), the Valheim Library was created with the goal of making the lives of mod developers easier. It enables you to create mods for Valheim using an abstracted API so you can focus on the actual content creation.
Preferred version: 2.26.1denikson-BepInExPack_Valheim
BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.
Preferred version: 5.4.2333README
Русский
Общее описание
VBNetTweaks — это плагин для Valheim, который значительно улучшает сетевую производительность, синхронизацию объектов и стабильность многопользовательской игры. Мод оптимизирует отправку данных, сжатие трафика, синхронизацию позиций и работу с визуальными эффектами.
1. Оптимизация сетевой синхронизации
Патчит синхронизацию позиций и поворотов объектов:
| Параметр | Vanilla значение | Новое значение | Описание |
|---|---|---|---|
| SmoothPos | 0.2f | 0.22f | Скорость сглаживания позиции (быстрее догоняет) |
| SmoothRot | 0.5f | 0.45f | Скорость сглаживания поворота |
| MicroThreshold | 0.001f | 0.004f | Фильтр микродрожания (уменьшает шум) |
Дополнительно:
- Увеличивает буфер очереди ZDO с 10KB до настраиваемого значения (по умолчанию ~20KB)
- Расширяет время загрузочного экрана после телепортации на 5 секунд (Необходимо для устранения проваливания игроков в текстуры построек при телепорте - актуально для серверов с большим количеством игроков)
2.️ Сжатие сетевого трафика
Алгоритмы сжатия:
| Алгоритм | Описание | Скорость | Степень сжатия |
|---|---|---|---|
| Deflate | Стандартный алгоритм ZIP (уровни 1-9) | Средняя | Хорошая (40-60%) |
| Vanilla | Встроенная компрессия игры | Высокая | Низкая |
Особенности:
- Автоматическое согласование версий сжатия между сервером и клиентами
- Периодическая проверка совместимости (каждые 10 секунд)
- Сбор метрик сжатия (отправлено/получено ZDO, коэффициент сжатия)
- Асинхронная отправка ZDO пакетов с конфигурируемым интервалом
3. Синхронизация кораблей
Улучшенная синхронизация движения кораблей для не-владельцев:
- Предсказание позиции корабля на основе скорости
- Адаптивное сглаживание (мягче, если игрок на корабле)
- Форс-коррекция при рассинхроне >2 метров или повороте >15 градусов
- Синхронизация позиции игроков на корабле
4. Фикс визуальных эффектов статусов
Исправляет проблему с "висящими" визуальными эффектами:
- Отслеживание созданных эффектов (частицы, аудио)
- Автоматическая очистка при уничтожении родительского объекта
- Периодическая проверка и удаление "утекших" эффектов (каждые 90 кадров)
5. Оптимизации Steam сокета
Увеличивает пропускную способность Steam Networking:
| Параметр | Vanilla | VBNetTweaks (по умолчанию) | Описание |
|---|---|---|---|
| SendRateMin | 150 KB/s | 256 KB/s | Минимальная скорость отправки |
| SendRateMax | 150 KB/s | 4096 KB/s | Максимальная скорость отправки |
| BufferSize | 260 KB | 100 MB | Размер буфера отправки |
6. Кеш игроков
Оптимизирует доступ к информации об игроках:
- Кеширование списка всех игроков (обновление каждые 0.5 секунд)
- Быстрый поиск игрока по ID
- Отслеживание состояния прикрепления игроков (на корабле/транспорте)
7. Производительность
Мониторинг производительности ключевых операций:
- Замер времени выполнения операций
- Автоматическое логирование средних значений (раз в 5 секунд)
- Работает только в режиме отладки
8. Оптимизированная отправка ZDO
Заменяет ванильный метод SendZDOToPeers2 на более эффективный:
- Отправка данных нескольким пирам за один апдейт (vanilla: 1 пир)
- Конфигурируемый интервал отправки (vanilla: 0.05с)
- Обработка ошибок с fallback на ванильный метод
9. Оптимизированное удаление объектов
Улучшает процесс удаления объектов из сцены:
- Использует отметки кадров для быстрого определения объектов на удаление
- Оптимизированная работа со словарями и списками
Основные настройки (ServerConfig.cfg)
[00 - Master]
ModEnabled = true # Включить/выключить мод
[01 - Debug]
DebugEnabled = false # Режим отладки
VerboseLogging = false # Подробное логирование
[02 - Modules]
SteamOptimizations = true # Оптимизации Steam сокета
ShipSync = true # Синхронизация кораблей
Compression = true # Сжатие трафика
ClientCompression = true # Сжатие на клиенте
[03 - Compression Settings]
Algorithm = Vanilla # Алгоритм: Deflate, Vanilla
Level = 3 # Уровень сжатия (1-9)
[04 - Steam Settings]
MinRateKB = 256 # Мин. скорость Steam (KB/s)
MaxRateKB = 4096 # Макс. скорость Steam (KB/s)
BufferSize = 100000000 # Размер буфера (байт)
[05 - Server Settings]
SendInterval = 0.03 # Интервал отправки (сек)
PeersPerUpdate = 30 # Пиров за апдейт
ZDOQueueLimit = 20480 # Размер буфера ZDO (KB)
Рекомендуемые настройки
| Сценарий | SendInterval | PeersPerUpdate | Compression | Algorithm |
|---|---|---|---|---|
| Мало игроков (2-5) | 0.05 | 20 | true | Vanilla |
| Средне (6-15) | 0.03 | 30 | true | Deflate |
| Много (16+) | 0.02 | 40-50 | true | Deflate |
Доступная статистика (при DebugEnabled = true)
- ZDOs Sent/Recv — количество отправленных/полученных ZDO пакетов
- Compression ratio — коэффициент сжатия (в процентах)
- Active Peers — количество активных пиров с компрессией
- Average operation time — среднее время выполнения операций (ZNet.Update, SendZDOs, RemoveObjects)
Установка
- И на клиент, и на сервер.
Несовместимые моды:
CacoFFF.valheim.LeanNetredseiko.valheim.scenicSearica.Valheim.NetworkTweaksSearica.Valheim.OpenSesameorg.bepinex.plugins.networkCW_Jesse.BetterNetworking
Примечания
- Deflate vs Vanilla: Deflate даёт лучшее сжатие, но требует чуть больше CPU. Рекомендуется для больших серверов.
- ShipSync: Включает улучшенную синхронизацию кораблей — особенно заметно на лодках при высокой задержке.
- ClientCompression: Может вызывать проблемы с визуальными эффектами при включении — отключайте при подозрительных багах.
- Steam Buffer: Увеличение буфера может потребовать больше оперативной памяти, но значительно улучшает стабильность при большом количестве объектов.
Обратная связь
- Личные сообщения у меня открыты Дискорд
- Либо через пинг VitByr на одном из серверов: Valheim Modding, Odin Plus, Valheim
English
Overview
VBNetTweaks is a Valheim plugin that significantly improves network performance, object synchronization, and multiplayer stability. The mod optimizes data transmission, traffic compression, position synchronization, and visual effects handling.
1. Network Synchronization Optimization
Patches position and rotation synchronization of objects:
| Parameter | Vanilla value | New value | Description |
|---|---|---|---|
| SmoothPos | 0.2f | 0.22f | Position smoothing speed (faster catching up) |
| SmoothRot | 0.5f | 0.45f | Rotation smoothing speed |
| MicroThreshold | 0.001f | 0.004f | Micro-jitter filter (reduces noise) |
Additional features:
- Increases ZDO queue buffer from 10KB to configurable value (default ~20KB)
- Extends loading screen time after teleportation by 5 seconds (Necessary to eliminate players falling through the textures of buildings when teleporting - important for servers with a large number of players)
2. Network Traffic Compression
Compression algorithms:
| Algorithm | Description | Speed | Compression Ratio |
|---|---|---|---|
| Deflate | Standard ZIP algorithm (levels 1-9) | Medium | Good (40-60%) |
| Vanilla | Built-in game compression | High | Low |
Features:
- Automatic version negotiation between server and clients
- Periodic compatibility check (every 10 seconds)
- Compression metrics collection (ZDO sent/received, compression ratio)
- Asynchronous ZDO packet transmission with configurable interval
3. Ship Synchronization
Improved ship movement synchronization for non-owners:
- Position prediction based on velocity
- Adaptive smoothing (softer when player is on ship)
- Force correction when desync >2 meters or rotation >15 degrees
- Player position synchronization on ships
4. Status Effect VFX Fix
Fixes "lingering" visual effects:
- Tracks created effects (particles, audio)
- Automatic cleanup when parent object is destroyed
- Periodic check and removal of "leaked" effects (every 90 frames)
5. Steam Socket Optimizations
Increases Steam Networking throughput:
| Parameter | Vanilla | VBNetTweaks (default) | Description |
|---|---|---|---|
| SendRateMin | 150 KB/s | 256 KB/s | Minimum send rate |
| SendRateMax | 150 KB/s | 4096 KB/s | Maximum send rate |
| BufferSize | 260 KB | 100 MB | Send buffer size |
6. Player Cache
Optimizes access to player information:
- Caching list of all players (updates every 0.5 seconds)
- Fast player lookup by ID
- Tracking player attachment state (on ship/vehicle)
7. Performance Monitoring
Performance monitoring for key operations:
- Operation execution time measurement
- Automatic logging of average values (every 5 seconds)
- Works only in debug mode
8. Optimized ZDO Transmission
Replaces vanilla SendZDOToPeers2 with more efficient method:
- Sends data to multiple peers per update (vanilla: 1 peer)
- Configurable send interval (vanilla: 0.05s)
- Error handling with fallback to vanilla method
9. Optimized Object Removal
Improves object removal from scene:
- Uses frame markers for quick identification of objects to remove
- Optimized dictionary and list operations
Main Configuration (ServerConfig.cfg)
[00 - Master] ModEnabled = true # Enable/disable mod
[01 - Debug] DebugEnabled = false # Debug mode VerboseLogging = false # Verbose logging
[02 - Modules] SteamOptimizations = true # Steam socket optimizations ShipSync = true # Ship synchronization Compression = true # Traffic compression ClientCompression = true # Client-side compression
[03 - Compression Settings] Algorithm = Vanilla # Algorithm: Deflate, Vanilla Level = 3 # Compression level (1-9)
[04 - Steam Settings] MinRateKB = 256 # Min Steam rate (KB/s) MaxRateKB = 4096 # Max Steam rate (KB/s) BufferSize = 100000000 # Buffer size (bytes)
[05 - Server Settings] SendInterval = 0.03 # Send interval (seconds) PeersPerUpdate = 30 # Peers per update ZDOQueueLimit = 20480 # ZDO buffer size (KB)
Recommended Settings
| Scenario | SendInterval | PeersPerUpdate | Compression | Algorithm |
|---|---|---|---|---|
| Few players (2-5) | 0.05 | 20 | true | Vanilla |
| Medium (6-15) | 0.03 | 30 | true | Deflate |
| Many (16+) | 0.02 | 40-50 | true | Deflate |
Available Statistics (when DebugEnabled = true)
- ZDOs Sent/Recv — Number of ZDO packets sent/received
- Compression ratio — Compression ratio (percentage)
- Active Peers — Number of active peers using compression
- Average operation time — Average execution time of operations (ZNet.Update, SendZDOs, RemoveObjects)
Installation
- Install on both client and server.
Incompatible mods:
CacoFFF.valheim.LeanNetredseiko.valheim.scenicSearica.Valheim.NetworkTweaksSearica.Valheim.OpenSesameorg.bepinex.plugins.networkCW_Jesse.BetterNetworking
Notes
- Deflate vs Vanilla: Deflate provides better compression but requires slightly more CPU. Recommended for larger servers.
- ShipSync: Enables improved ship synchronization — especially noticeable on boats with high latency.
- ClientCompression: May cause issues with visual effects when enabled — disable if you encounter suspicious bugs.
- Steam Buffer: Increasing the buffer may require more RAM, but significantly improves stability with many objects.
Feedback
- Direct messages are open on Discord
- Or via ping @VitByr on one of the servers: Valheim Modding, Odin Plus, Valheim
CHANGELOG
0.2.8
- The compressor has been redesigned. Now there's only one type. It should work more stably and stop visual dummies appearing.
- The patch for Steam has also been simplified - the error on the Linux servers should be fixed.
0.2.7
- Fixed compressor type synchronization
0.2.6
- The RPCBatcer, ZDOTrotling, and ZoneOwner modules have been removed (essentially useless)
- Steam patches are now being applied correctly
- The configuration is syncing correctly with the server
- ZSTD compression has been removed, as it is poorly compatible with Valheim, especially with mods
- Added Vanilla compression - uses game compression, which is disabled by default
- Added a patch to increase the ZDO buffer
- Added a patch for ZSyncTransform for smoother interpolation (not included in the configuration)
- The configuration settings are selected for the smoothest possible operation, as well as the vanilla values of the game.
0.2.4
- Deleted AILod, MonsterAIPatch, and SupportManager because they are not related to the network component
- Compression has been fixed - now it works both ways on the client and server
0.2.2
- Half of the code has been redesigned
- Almost all checks on the server/client have been removed
- Some default settings have been changed for servers with online 40+
0.2.0
- Split the compression switch. Now the server does compression by default, but the client does not do it by default, because it found that there is a problem with compression on the client (visual effects from status effects remain in the empty place where the mob was. For example, drops of water)
- Added configuration synchronization. The main configuration is client-side. The synced config is located at "BepInEx\config\VitByr\VBNetTweaks"
- The problem for Ubuntu servers should be fixed (from the previous version)
0.1.95
- Adjusting configurations
- Added the ability to disable modules - up to the entire mod. I need to restart the server and client, because I haven't done any synchronization yet.
- A small fix for Spawn and AILod
0.1.9
- cleaned the code from unnecessary comments and put it in order.
- made the compression configuration more convenient for the ConfigurationManager (now you don't need to write in text - there will be a list)
- added several additional checks for more stable operation
0.1.8
- A small patch fix
- Added Owner switching. If the Owner of an area with a bad ping and there is a player with a better ping in that area, then Ownership passes to that player. (Experimental)
- The raid system has been changed. Now several raids are possible at the same time and they are not paused. (Experimental)
- Added a config for setting the compression level
0.1.7
- Add Incompatibility LeanNet
- Add Incompatibility Scenic
- Add Incompatibility NetworkTweaks
- Add Incompatibility OpenSesame
- Add Incompatibility Network
- Add Incompatibility BetterNetworking
- Add new config CompressionLevel
- Add WearNTear Support Patch (Support checks are performed a little less frequently.)
0.1.5.1
- Edit Readme
0.1.5
- Relise