You are viewing a potentially older version of this package. View all versions.
sighsorry-Dive_In-1.0.7 icon

Dive In

Dive underwater with configurable controls, Fast Swim, surface/midwater stamina regen, and depth drain. Configured creatures can chase and navigate underwater. Includes water combat/equipment, localized key hints, and improved underwater visuals.

Date uploaded 5 days ago
Version 1.0.7
Download link sighsorry-Dive_In-1.0.7.zip
Downloads 409
Dependency string sighsorry-Dive_In-1.0.7

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2333 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.

Preferred version: 5.4.2333

README

DiveIn

Adds diving and swimming for players and configured creatures.

Normally mobs can't follow you underwater. So players with diving mod players can just attack mobs from above or below without getting hit. This mod changes that.
Also added a diving mechanic for players with configurable stamina drain according to depth



Configured mobs can attack you! No more hiding under their bellies.



Idle mobs would swim within the configured range


Recommend to use with RtDOcean. There is configured sample for it.

Player Diving

  • Unlike vanilla Valheim, stamina regeneration while swimming can be enabled separately for surface swimming and midwater diving.
  • Extra stamina drain scales linearly per meter of current liquid depth and stacks multiplicatively with run-swimming.
  • Pressing the vanilla run key in water toggles Fast Swim, doubling overall swim speed by default and consuming configurable extra stamina. Swim skill still improves base swim speed by a configurable amount.
  • Swimming key hint labels are localized for supported Valheim languages.
  • Surface swimming keeps the player's vanilla swim depth and only changes depth while diving.
  • Attacking, secondary attacking, and guarding underwater stop swim movement so combat input takes priority.
  • Use equipment in water except that is in blacklist.

Creature Diving

  • Configured monster prefabs stop avoiding water and can navigate underwater.
  • Idle monsters use passive depth profiles and slowly drift within their assigned depth range.
  • Alerted or chasing monsters adjust depth toward their target within global depth limits.
  • Underwater pathing uses route checks and steering avoidance samples instead of blindly forcing success.
  • Underwater creature movement uses high-quality move-plan checks by default.

DiveIn.yaml

This file defines which monsters can dive and what passive depth band each monster uses.

# Monster dive configuration for DiveIn.
# Unknown keys and duplicate keys are treated as errors and keep the previous applied settings.

surface_patrol: # You can use any group name. Add your own groups
  passive_min_depth: 0 # Shallowest passive dive depth used while the monster has no target and is not alerted.
  passive_center_depth: 10 # Center depth used by the passive sine-wave swimming pattern.
  passive_max_depth: 20 # Deepest passive dive depth used while the monster has no target and is not alerted.
  active_depth_adjust_speed: 2 # How quickly this group adjusts swim depth while alerted or chasing a target.
  prefabs: # Monster prefab names assigned to this passive profile group.
    - Leech
    - Abomination
    - Serpent
    - BonemawSerpent

mid_water:
  passive_min_depth: 0
  passive_center_depth: 15
  passive_max_depth: 30
  active_depth_adjust_speed: 2
  prefabs: []

deep_patrol:
  passive_min_depth: 10
  passive_center_depth: 20
  passive_max_depth: 30
  active_depth_adjust_speed: 2
  prefabs: []

## Mod prefabs sample

mods_surface:
  passive_min_depth: 0
  passive_center_depth: 10
  passive_max_depth: 20
  active_depth_adjust_speed: 2
  prefabs:
    - Neck_RtD
    - Animal_Dolphin_RtD
    - Animal_Cod_RtD
    ...

Notes:

  • If the same prefab appears in multiple groups, only the first assignment is kept.
  • Invalid YAML keeps the previously applied settings.
  • When the server is the source of truth, clients use the synced server YAML instead of their local file.

Config

[1 - General]

## If on, the configuration is locked and can be changed by server admins only. [Synced with Server]
# Setting type: Toggle
# Default value: On
# Acceptable values: Off, On
Lock Configuration = On

[2a - Player Diving]

## Comma-separated item prefab names that remain restricted in water. Everything not listed is allowed in water by default. Example: BowFineWood,ShieldBronzeBuckler. [Synced with Server]
# Setting type: String
# Default value:
Water Equipment Blacklist =

## Multiplier applied to vanilla stamina regeneration while swimming on the surface with your head above water. 0 matches vanilla swimming behavior, 1 matches normal non-swimming stamina regeneration timing and rate. [Synced with Server]
# Setting type: Single
# Default value: 0.5
# Acceptable value range: From 0 to 1
Surface Stamina Regen Rate = 0.5

## Multiplier applied to vanilla stamina regeneration while your head is underwater. 0 makes stamina recover only after surfacing. [Synced with Server]
# Setting type: Single
# Default value: 0
# Acceptable value range: From 0 to 1
Midwater Stamina Regen Rate = 0

## Additional moving swim stamina drain percent per meter of current liquid depth. 1 means 30% extra at 30m; 2.5 means 75% extra at 30m. Applied multiplicatively with run-swimming stamina drain. [Synced with Server]
# Setting type: Single
# Default value: 2.5
# Acceptable value range: From 0 to 5
Water Depth Stamina Drain Multiplier = 2.5

## Base swim speed multiplier at Swim skill 100. 1.5 means +50%. [Synced with Server]
# Setting type: Single
# Default value: 1.5
# Acceptable value range: From 1 to 3
Swim Skill Speed Multiplier = 1.5

## Swim speed multiplier while Fast Swim is toggled on with the vanilla run key. Swim skill separately increases base swim speed. [Synced with Server]
# Setting type: Single
# Default value: 2
# Acceptable value range: From 1 to 3
Swim Run Speed Multiplier = 2

## Moving swim stamina drain multiplier while Fast Swim is toggled on. Applied multiplicatively with water depth stamina drain. [Synced with Server]
# Setting type: Single
# Default value: 2
# Acceptable value range: From 1 to 5
Swim Run Stamina Drain Multiplier = 2

[3 - Underwater Visuals]

## Whether underwater fog and reversed water surface styling are applied while submerged. [Not Synced with Server]
# Setting type: Toggle
# Default value: On
# Acceptable values: Off, On
Enable Underwater Visual Styling = On

## Underwater darkness added per meter of swim depth. 1 means 1% per meter, so 30m gives 30%. [Not Synced with Server]
# Setting type: Single
# Default value: 2
# Acceptable value range: From 0 to 10
Darkness Factor = 2

## Underwater fog density added per meter of swim depth. 1 means 1% per meter, so 30m adds 30%. [Not Synced with Server]
# Setting type: Single
# Default value: 1
# Acceptable value range: From 0 to 10
Murkiness Factor = 1

Git

The player diving implementation includes code derived and modified from UnderTheSea
https://github.com/searica/UnderTheSea
https://github.com/sighsorry1029/DiveIn

CHANGELOG

Version Update Notes
1.0.9 - Added Surface Eitr Regen Rate and Midwater Eitr Regen Rate config options to scale total eitr regeneration while swimming.
1.0.8 - Added Midwater Idle Stamina Drain Per Depth so idle underwater stamina drain scales with current liquid depth
- Minor Optimizations and config cleanup.
1.0.7 - Split water stamina regeneration into separate Surface and Midwater rates so stamina can recover only after surfacing by default
- Added depth-scaled idle underwater stamina drain to simulate holding breath
- Added Fast Swim Stamina Drain Multiplier so Fast Swim stamina cost can be configured separately from Fast Swim speed
- Renamed stamina and Fast Swim config options for clearer per-depth behavior
- Grouped stamina and speed config options into Swim Stamina and Swim Speed sections
- Underwater visual styling is now always enabled; Darkness and Murkiness moved to Player Diving with softer synced defaults
1.0.6 - Improved configured creature underwater AI near the ocean floor
- Unified underwater route and steering checks into a single move plan cache
- Removed Dive AI Quality config; underwater AI now uses high-quality behavior by default
- Improved player ascent when stuck against the ocean floor
- Added configurable ascend/descend dive keys and localized swimming key hints, including gamepad-aware key hints and live Fast Swim On/Off hints
- Fixed vanilla hide/show weapon input so hidden weapons can be drawn again while underwater
- Reworked underwater combat so attack, secondary attack, and guard inputs stop swim movement and take priority
- Preserved the player's vanilla surface swim depth instead of replacing it with a DiveIn hardcoded value
- Reworked underwater water-surface rendering to preserve above-surface visuals while reducing sky-through-water and waterline clipping issues
- Reworked run-swimming so the run key toggles Fast Swim at Swim skill 0, consumes extra stamina, and lets Swim skill speed be configured as a multiplier
- Setting Swim Run Speed Multiplier to 1 disables Fast Swim and hides its key hint
- Simplified depth stamina drain config to one per-meter multiplier and applies depth/run stamina drain multiplicatively.
1.0.5 - Added underwater visual config options
1.0.4 - DiveIn.yaml schema has changed. Delete your DiveIn.yaml and restart your game to regenerate it
- Added more creatures from other mods on default DiveIn.yaml
1.0.2 - Made swim speed increase according to swim skill level
- Final swim speed = base swim speed x [1 + (config value - 1) x (Swim skill level / 100)^1.5]
1.0.1 - First one was wrong dll sorry
1.0.0 - Initial Release