Valheim BepInEx mod fixing the 1.0 ice-slipping layer bug that flings players off creatures. Restores deathsquito surfing.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Alaric McKenzie-Boone b779526d34 Deathsquito Surfing Fix 1.0.0
BepInEx plugin fixing Valheim 1.0's ice-slipping layer check, which uses
(s_slipperyStuffMask & layer) instead of (s_slipperyStuffMask & (1 << layer))
in Character.UpdateWalking and ApplySlippery. Creatures count as ice, so
standing on a moving one compounds its velocity and flings the player off.
Includes the Thunderstore manifest, icon and README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 15:28:29 -04:00
src Deathsquito Surfing Fix 1.0.0 2026-10-24 15:28:29 -04:00
thunderstore Deathsquito Surfing Fix 1.0.0 2026-10-24 15:28:29 -04:00
.gitignore Deathsquito Surfing Fix 1.0.0 2026-10-24 15:28:29 -04:00
DeathsquitoSurfingFix.csproj Deathsquito Surfing Fix 1.0.0 2026-10-24 15:28:29 -04:00
README.md Deathsquito Surfing Fix 1.0.0 2026-10-24 15:28:29 -04:00

Deathsquito Surfing Fix

Fixes a Valheim 1.0 bug that makes the game treat creatures as ice. Standing on a moving creature, such as a deathsquito, flings you off at high speed. With this fix, deathsquito surfing works again.

Despite the name, the fix isn't specific to deathsquitos: it applies to standing on any creature.

The bug

Valheim 1.0 added ice slipping. The game decides whether the ground is slippery like this, in Character.UpdateWalking and Character.ApplySlippery:

// what the game does
slipping = friction <= 0 && (s_slipperyStuffMask & layer) != 0;
// what it should do
slipping = friction <= 0 && (s_slipperyStuffMask & (1 << layer)) != 0;

It uses the layer number as if it were a bitmask. The Default layer is bit 0 of the mask, so every frictionless collider on an odd-numbered layer counts as ice. Creatures are on the character layer and use a frictionless physics material, so they count as ice.

While you're on ice, the game keeps your velocity from the previous frame for momentum, then adds the velocity of whatever you're standing on. On normal ground your velocity is rebuilt every frame, so that addition is harmless. On ice it stacks: every physics frame adds the creature's speed again. Slipping also skips the usual 20 m/s speed cap. In testing, a ride on a deathsquito went from matching its speed to 74 m/s in about 0.3 seconds.

What this mod does

It patches both checks to use 1 << layer, nothing else. Ice still works on the layers the game intends (static_solid and Default).

One side effect: the bug also stopped frictionless surfaces on the Default layer from being slippery, even though the game's mask includes that layer. With the fix, they slip as intended.

Installation

Install with r2modman or the Thunderstore Mod Manager, or copy DeathsquitoSurfingFix.dll into BepInEx/plugins.

The mod is client-side. Only players who want the fix need it, and the server doesn't. You can add or remove it at any time.

On startup, BepInEx/LogOutput.log should show:

Fixed slippery layer check in Character.UpdateWalking.
Fixed slippery layer check in Character.ApplySlippery.

If Iron Gate fixes the bug or changes this code, the mod logs a warning and does nothing.

Configuration

BepInEx/config/alari.valheim.deathsquitosurfingfix.cfg:

  • General.Enabled (default true): turns the fix on or off. Changes need a game restart.

Compatibility

Tested on Valheim 1.0.20 with BepInExPack_Valheim 5.4.2351. It only changes the two layer checks above, so it should work alongside other mods unless they replace Character.UpdateWalking or Character.ApplySlippery.

Building

Requires Windows, a .NET SDK with .NET Framework 4.7.2 targeting support, a local Valheim install, and a BepInEx profile (for BepInEx.dll and 0Harmony.dll):

dotnet build -c Release '-p:ValheimPath=C:\Program Files (x86)\Steam\steamapps\common\Valheim' '-p:BepInExPath=C:\path	o\profile\BepInEx'

The Thunderstore package is the contents of thunderstore/ plus bin/Release/net472/DeathsquitoSurfingFix.dll, zipped with all files at the root.

Changelog

  • 1.0.0: First release.