Raven Iron
All Devlogs
DevlogWhere The Crow Flies

Where The Crow Flies: Building a Zero-Overhead Client Scout for Valheim

By Raven Iron Games

When designing Where The Crow Flies, our guiding principle was simple: a client companion mod must never make the player’s game feel slower or cluttered.

No HUD elements, no keybind clashes, no memory leaks, and no network spam during intense 10-player swamp raids.


1. Owner-Gated Combat Interception

In Valheim, when three players are fighting a Bonemass boss in the same swamp zone, all three clients receive visual network replication packets. If all three clients hooked Character.Damage and fired an RPC, the server would receive triplicate data.

We resolved this with owner-gating:

[HarmonyPatch(typeof(Character), nameof(Character.OnDeath))]
public static class Patch_CharacterDeath
{
    static void Prefix(Character __instance)
    {
        // Only the client that is authoritative for this ZDO reports the kill
        if (!__instance.IsOwner()) return;

        CombatSender.SendKill(__instance);
    }
}

By ensuring only the authoritative owner of the dying creature reports the death, we guarantee exact 1:1 kill ledger accuracy.


2. Batched Damage Accumulation

During intensive boss encounters, hundreds of damage ticks occur per minute from fire arrows, poison clouds, and melee strikes. Firing individual network packets for every hit is poor network hygiene.

Where The Crow Flies uses an in-memory DamageAccumulator dictionary that aggregates damage per player character:

  • Accumulates physical and elemental damage dealt and taken.
  • Flushes in clean 10-second intervals.
  • Force-flushes early if accumulated damage exceeds 500f.
  • Automatically clears on world transition or disconnect.

3. Rich Cause-of-Death Computation

When a player dies, vanilla Valheim provides minimal context. Where The Crow Flies parses the m_lastHit data structure to compute rich death causes:

  • Attacking creature identity & localized boss name (e.g. “slain by Eikthyr”).
  • Elemental hazards (“incinerated by Surtling fire”, “frozen in the Deep North”).
  • Environmental fatalities (“lost to the cold sea”, “crushed by falling timber”).

The mod is available for download today on Where The Crow Flies project page.