Valheim
Install with App

Details

Latest version
1.0.0
Last Updated
First Uploaded
Downloads
25
Likes
0
Size
197KB
Dependants
ADDatHost Valheim hosting
€1

GsValheimStatsClientFix

An unofficial compatibility patch for GsValheimStatsClient 0.2.12 on Valheim 1.0.

Verified against Valheim 1.0.7 and 1.0.12, whose player-profile layouts are identical.

Not affiliated with, endorsed by, or supported by cproudlock, the author of GsValheimStatsClient. Please do not report problems with this patch to them.

This mod does nothing on its own

It has no features. It is a patch for another mod, and it requires GsValheimStatsClient 0.2.12 to be installed. Without that client it loads, logs one warning, and stops. Installing it by itself accomplishes nothing.

What is broken, and what this fixes

GsValheimStatsClient reads Valheim's player profile by reflection, using field names from before Valheim 1.0. Valheim changed that layout: m_playerStats became an array of per-difficulty records, and the enemy-kill, craft and pickup dictionaries moved onto the record. The client's lookups now silently return nothing, with no error, so these fields are always 0 or empty:

kills · bossKills · deaths · stats · creatureKills · crafts · materials · pickups · currentLifeKills · currentLifeSec

This patch replaces the client's two profile-reading methods with versions that read the 1.0.7 layout. It changes nothing else.

Weapon damage, boss damage, DPS, hardest hit and skills were never affected by this bug and are untouched.

What to expect after installing

Both of these are one-off, expected, and appear on whatever dashboard you post to.

1. Lifetime totals appear in one jump. The stats above were being reported as zero, not withheld — so on the first snapshot after installing, your true lifetime totals arrive all at once. On a dashboard that charts values over time this looks like a single enormous spike. It is not a data error, and it settles after that first snapshot.

2. The current-life baseline resets once, for some characters. While the reads were broken, the client recorded "this life started at 0 kills and 0 seconds" for every new life. Left alone, your next death would be recorded as a single life spanning your entire history — permanently, because the client only ever raises your longest-life and best-kills-before-death records.

So on the first login after installing, a character whose saved baseline is zero and that has died at least once has its current life restarted from that moment. You will see this in your log:

life baseline reset: baseline was zero (...) on a character that has died (Deaths=N), ...

A character that has never died is left alone — its zero baseline is the genuine start of its one continuous life, and resetting it would throw away real progress:

life baseline left alone: ... this character has never died (Deaths=0) ...

The cost of the reset is the untracked portion of one life in progress. Your lifetime totals, kills, deaths and per-weapon stats are not affected.

Version guard

This patch rewrites two private methods and reads three private fields inside GsValheimStatsClient. None of that is a stable contract, so it refuses to guess.

  • Client missing, or any version other than exactly 0.2.12 — logs a warning, patches nothing, stands down.
  • Valheim's profile layout not as expected — checked at startup by name; on any mismatch it names each missing member, patches nothing, and stands down.
  • Any patch fails to apply — every patch is rolled back, so the client is never left half-patched.
  • A read fails while playing — that read falls back to the client's original code and logs once. Failure degrades to the client's current behaviour; it never produces partial data that looks correct.

If a newer GsValheimStatsClient fixes this upstream, this patch will stand down by itself, because the version will no longer be 0.2.12. Uninstall it at that point.

Verifying it worked

Look in BepInEx\LogOutput.log for:

GsValheimStatsClientFix 1.0.0 patched GsValheimStatsClient 0.2.12 for Valheim 1.0.12.
first successful profile read: N stats, N creatures, N crafts, N pickups, Deaths=N.

The Valheim version in that first line is read from the running game, so it reports whatever you are actually on. Non-zero counts on the second line mean the profile is being read correctly.

Compatibility

  • Valheim 1.0 (verified on 1.0.7 and 1.0.12). The patch does not pin a game version; it checks the profile layout by name at startup and stands down if a future update changes it.
  • GsValheimStatsClient 0.2.12 exactly
  • BepInEx 5.4.x
  • No Jötunn dependency; BepInEx and Harmony only.
  • Client-side. It reads only your own character's profile, and changes nothing the server or other players can see.

Licence and credit

GsValheimStatsClient is the work of cproudlock (Proudlock_Technology) and is not redistributed here — you install it yourself from Thunderstore. This patch only modifies its behaviour in memory at runtime.

DatHost — Valheim server hosting, first month for one euro
DatHost — Valheim server hosting, first month for one euro
DatHost — Valheim server hosting, first month for one euro
DatHost — Valheim server hosting, first month for one euro
DatHost — Valheim server hosting, first month for one euro