From 5ef7a102dad049060719fc0b392026a53ff1abf8 Mon Sep 17 00:00:00 2001 From: kanym Date: Wed, 5 Aug 2026 16:33:27 +0200 Subject: [PATCH 01/11] fix(skeleton): make the progression real, and say so in the compendium Four separate faults were behind one player report. The tier table had drifted a long way from the published progression. Poison immunity arrived at Bonemass instead of Eikthyr, auto-stun at The Queen instead of The Elder, and lifesteal jumped 20/30/40 where the description promises a climb in fives from 5% to 35%. Rewritten to match the description tier for tier, which is the copy players actually read. Poison immunity never worked even at the tier that granted it. SE_SkeletonStats built its damage modifiers in Setup, which runs once when the effect is applied - at spawn, before any boss has fallen - and nothing ever asked again, so the modifiers stayed frozen at tier 1 for the whole session. Everything else the race does re-reads the rules per hit, which is why only the modifiers looked broken. They are now rebuilt when the tier actually changes. Max health was whatever three scaled sausages happened to add up to. A Skeleton cannot eat, so the race fakes three permanent foods to carry the tier bonus - sound enough for regeneration, which Valheim drives off the food list, but the number the game reads is Food.m_health, recomputed every second from the burn curve, and anything that leaves those foods partly burnt or one short quietly costs health. A Bonemass Skeleton had 95 where the table promises 165. The foods stay for regeneration; the total is now overwritten at Player.GetTotalFoodValue, which has exactly one caller and decides the number outright. Skeleton Secrets was a one-line placeholder returning the same sentence at every tier - never written rather than broken. It now unfolds tier by tier, and opens by naming the standing the race believes it is on, so the next player who kills a boss and sees nothing change can tell a tier that failed to advance from an unlock that failed to fire. The charred model moves from Fader to Moder, where the description asks for a fire skeleton, and summons stay skeletons at both tiers rather than turning charred at Fader. Both are one-line reverts if the old look is preferred. --- JotunnModStub/RaceCompendium.cs | 70 +++++++++++++++- JotunnModStub/Skeleton/SkeletonPatches.cs | 29 +++++++ JotunnModStub/Skeleton/SkeletonProgression.cs | 79 ++++++++++++------- .../Skeleton/SkeletonStatusEffects.cs | 48 +++++++---- 4 files changed, 183 insertions(+), 43 deletions(-) diff --git a/JotunnModStub/RaceCompendium.cs b/JotunnModStub/RaceCompendium.cs index 4030117..92707d6 100644 --- a/JotunnModStub/RaceCompendium.cs +++ b/JotunnModStub/RaceCompendium.cs @@ -299,9 +299,77 @@ namespace RacesOfValheim knownTexts["Skadi Secrets"] = sb.ToString(); } + /// + /// This was a one-line placeholder that returned the same sentence at every tier, which is + /// why players reported that "Skeleton Secrets never populates after bosses" - it was never + /// written, rather than broken. It now unfolds tier by tier with the real numbers, the way + /// the Skadi entry above does. + /// private static void GenerateSkeletonText(Dictionary knownTexts, int state) { - knownTexts["Skeleton Secrets"] = "The secrets of the crypt will be revealed soon..."; + var rules = SkeletonProgression.GetRules(state); + float health = SkeletonProgression.GetMaxHealthBonus(state); + int lifesteal = Mathf.RoundToInt(rules.LifestealPercent * 100f); + + StringBuilder sb = new StringBuilder(); + sb.AppendLine("The Secrets of the Crypt\n"); + + // Says out loud which tier the race thinks it is on. A player who has killed a boss and + // seen nothing change can read this line back and know immediately whether the tier + // failed to advance or the unlock itself is broken. + sb.AppendLine(state <= BossProgressionManager.MinState + ? "You stand at the first of eight standings; no boss has yet fallen to your reckoning.\n" + : $"You stand at the {state} of eight standings, earned by the fall of {BossProgressionManager.GetBossNameForState(state)}.\n"); + + sb.AppendLine("[Base Passive] Undead Diet:"); + sb.AppendLine($"No hunger moves you and no meal can help you - mortal food is nothing to dry bones. In its place the dead grow strong as their betters fall: you carry +{health:0} Maximum Health at your present standing. Nor does effort tire you; you have no stamina to spend at all.\n"); + + sb.AppendLine("[Base Passive] Bones and Blades:"); + sb.AppendLine("Blades and points find little to cut in you and do half their work, but a hammer's weight finds everything, and hurts you the more for it.\n"); + + if (state >= 2) + { + sb.AppendLine("[Eikthyr Unlock] The Green Rot:"); + sb.AppendLine($"Poison has nothing left to poison - it cannot touch you at all - and your bones take on its sickly cast. Every blow you land returns {lifesteal}% of what it deals in physical harm to your own frame.\n"); + } + + if (state >= 3) + { + sb.AppendLine("[The Elder Unlock] The First Blow:"); + sb.AppendLine("The first strike out of the dark staggers whatever it lands upon. The dead may do this once every 5 seconds.\n"); + } + + if (state >= 4) + { + sb.AppendLine("[Bonemass Unlock] Rotten Touch:"); + sb.AppendLine("What you strike, you sicken - every blow carries 20 Poison damage of its own.\n"); + } + + if (state >= 5) + { + sb.AppendLine("[Moder Unlock] Charred Bones:"); + sb.AppendLine("Your frame blackens and burns, and the fire clings to you: everything near enough to feel it is scorched. Your wounds also close faster than bone has any right to.\n"); + } + + if (state >= 6) + { + sb.AppendLine("[Yagluth Unlock] Risen Again:"); + sb.AppendLine("A killing blow no longer ends you. You are made whole where you stand - and then the dark magic must gather itself for 5 minutes before it will do so again.\n"); + } + + if (state >= 7) + { + sb.AppendLine("[The Queen Unlock] The Crypt Answers:"); + sb.AppendLine($"Every enemy you put down rises to fight for you, up to {rules.MaxSummons} at your side at once.\n"); + } + + if (state >= 8) + { + sb.AppendLine("[Fader Unlock] A Host of Your Own:"); + sb.AppendLine($"{rules.MaxSummons} of the dead now follow you, and {lifesteal}% of the harm you deal comes back as your own strength.\n"); + } + + knownTexts["Skeleton Secrets"] = sb.ToString(); } private static void GenerateFurlingText(Dictionary knownTexts, int state, Player player) diff --git a/JotunnModStub/Skeleton/SkeletonPatches.cs b/JotunnModStub/Skeleton/SkeletonPatches.cs index 6f8c364..92a9c87 100644 --- a/JotunnModStub/Skeleton/SkeletonPatches.cs +++ b/JotunnModStub/Skeleton/SkeletonPatches.cs @@ -10,6 +10,35 @@ namespace RacesOfValheim private static Mesh skeletonMesh = null; private static Material[] skeletonMaterials = null; + /// + /// Makes the Skeleton's max health exactly what its progression promises. + /// + /// A Skeleton cannot eat, so SkeletonRace fakes three permanent foods whose values are + /// scaled to add up to the tier's bonus. That is a good way to keep food-based health + /// regeneration working - Valheim regenerates from the food list, so a Skeleton with no + /// food would never heal - but a bad way to land an exact number: the value the game reads + /// is Food.m_health, which UpdateFood recomputes every second as + /// Pow(remaining/burnTime, 0.3) * m_food, and anything that leaves those three foods + /// partly burnt, partly rebuilt or one short quietly costs health. A Bonemass-tier + /// Skeleton reported 95 max health where the table promises 25 + 140. + /// + /// So the foods stay, for regeneration, and the total they feed into is overwritten here. + /// GetTotalFoodValue has exactly one caller, Player.UpdateFood, which passes the result + /// straight to SetMaxHealth - so this is the single point where the number is decided, and + /// it now comes from the progression table rather than from three scaled sausages. + /// + [HarmonyPatch(typeof(Player), "GetTotalFoodValue")] + public static class Player_GetTotalFoodValue_SkeletonHealth_Patch + { + public static void Postfix(Player __instance, ref float hp) + { + if (__instance != Player.m_localPlayer || !SkeletonRace.IsSkeleton()) return; + + int state = BossProgressionManager.GetCurrentProgressionState(); + hp = __instance.m_baseHP + SkeletonProgression.GetMaxHealthBonus(state); + } + } + [HarmonyPatch(typeof(Player), "UseStamina")] public static class Player_UseStamina_Patch { diff --git a/JotunnModStub/Skeleton/SkeletonProgression.cs b/JotunnModStub/Skeleton/SkeletonProgression.cs index 082b18e..66d297b 100644 --- a/JotunnModStub/Skeleton/SkeletonProgression.cs +++ b/JotunnModStub/Skeleton/SkeletonProgression.cs @@ -34,6 +34,29 @@ namespace RacesOfValheim public UnityEngine.Vector3 ScaleMultiplier; } + public const string BaseModel = "Skeleton"; + public const string PoisonModel = "Skeleton_Poison"; + + // The published progression calls for a fire skeleton from Moder on, and the charred + // twitcher is the only burnt skeleton the game ships. It used to arrive at Fader; if that + // is preferred, move the model and its scale back to the state >= 8 block - nothing else + // in this file depends on where they sit. + public const string FireModel = "Charred_Twitcher"; + + // The charred rig is broader and shorter than a plain skeleton, so it needs squeezing to + // read as a player. Tied to the model, not to a tier. + public static readonly UnityEngine.Vector3 FireModelScale = new UnityEngine.Vector3(0.85f, 1.20f, 0.85f); + + public const string SummonPrefabName = "Skeleton_friendly"; + + /// + /// Every tier, exactly as the race's published progression describes it. The table had + /// drifted a long way from that description - poison immunity arrived two tiers late, + /// auto-stun four tiers late, and lifesteal jumped 20/30/40 instead of climbing in fives - + /// which is what players were reporting as "progression doesn't work". + /// + /// The blocks are cumulative: each one only states what its boss adds or replaces. + /// public static SkeletonRules GetRules(int state) { SkeletonRules rules = new SkeletonRules @@ -48,48 +71,50 @@ namespace RacesOfValheim SummonPrefab = "", AutoStunFirstHit = false, FireAura = false, - ModelPrefab = "Skeleton", + ModelPrefab = BaseModel, ScaleMultiplier = UnityEngine.Vector3.one }; - if (state >= 2) - { - rules.ModelPrefab = "Skeleton_Poison"; - rules.LifestealPercent = 0.20f; - } - if (state >= 3) - { - rules.EnhancedRegen = true; - } - if (state >= 4) + if (state >= 2) // Eikthyr { + rules.ModelPrefab = PoisonModel; rules.PoisonImmunity = true; + rules.LifestealPercent = 0.05f; + } + if (state >= 3) // The Elder + { + rules.LifestealPercent = 0.10f; + rules.AutoStunFirstHit = true; + } + if (state >= 4) // Bonemass + { + rules.LifestealPercent = 0.15f; rules.PoisonAttacks = true; } - if (state >= 5) + if (state >= 5) // Moder { + rules.LifestealPercent = 0.20f; + rules.ModelPrefab = FireModel; + rules.ScaleMultiplier = FireModelScale; + rules.FireAura = true; + rules.EnhancedRegen = true; + } + if (state >= 6) // Yagluth + { + rules.LifestealPercent = 0.25f; rules.AutoResurrect = true; } - if (state >= 6) + if (state >= 7) // The Queen { - rules.ModelPrefab = "Skeleton_Poison"; rules.LifestealPercent = 0.30f; rules.SummonOnKill = true; - rules.MaxSummons = 2; - rules.SummonPrefab = "Skeleton_friendly"; - rules.ScaleMultiplier = UnityEngine.Vector3.one * 1.1f; + rules.MaxSummons = 3; + rules.SummonPrefab = SummonPrefabName; } - if (state >= 7) + if (state >= 8) // Fader { - rules.AutoStunFirstHit = true; - rules.LifestealPercent = 0.40f; - } - if (state >= 8) - { - rules.ModelPrefab = "Charred_Twitcher"; - rules.SummonPrefab = "Charred_Twitcher"; - rules.FireAura = true; - rules.ScaleMultiplier = new UnityEngine.Vector3(0.85f, 1.20f, 0.85f); + rules.LifestealPercent = 0.35f; + rules.MaxSummons = 5; } return rules; diff --git a/JotunnModStub/Skeleton/SkeletonStatusEffects.cs b/JotunnModStub/Skeleton/SkeletonStatusEffects.cs index f3aea9a..398cd7b 100644 --- a/JotunnModStub/Skeleton/SkeletonStatusEffects.cs +++ b/JotunnModStub/Skeleton/SkeletonStatusEffects.cs @@ -5,29 +5,47 @@ namespace RacesOfValheim { public class SE_SkeletonStats : SE_Stats { + // The tier the current m_mods were built for. -1 means "never built". + private int m_appliedState = -1; + public override void Setup(Character character) { base.Setup(character); - - // Apply Damage Modifiers - int state = BossProgressionManager.GetCurrentProgressionState(); - SkeletonProgression.SkeletonRules rules = SkeletonProgression.GetRules(state); - - m_mods = new List(); - m_mods.Add(new HitData.DamageModPair { m_type = HitData.DamageType.Pierce, m_modifier = HitData.DamageModifier.Resistant }); - m_mods.Add(new HitData.DamageModPair { m_type = HitData.DamageType.Slash, m_modifier = HitData.DamageModifier.Resistant }); - m_mods.Add(new HitData.DamageModPair { m_type = HitData.DamageType.Blunt, m_modifier = HitData.DamageModifier.Weak }); - - if (rules.PoisonImmunity) - { - m_mods.Add(new HitData.DamageModPair { m_type = HitData.DamageType.Poison, m_modifier = HitData.DamageModifier.Immune }); - } + RebuildDamageMods(); } public override void UpdateStatusEffect(float dt) { base.UpdateStatusEffect(dt); - // Health is handled in SkeletonPatches.Player_GetMaxHealth_Patch + + // Setup runs once, when the effect is first applied - so the damage modifiers were + // frozen at whatever tier the player happened to be on then, usually tier 1 because the + // effect goes on at spawn before a boss is ever killed. Poison immunity therefore never + // arrived: killing the boss changed the rules, and nothing ever asked them again. + // Everything else the race does re-reads GetRules per hit, which is why only the + // modifiers looked broken. Re-check here instead; the state comparison makes it free. + RebuildDamageMods(); + } + + private void RebuildDamageMods() + { + int state = BossProgressionManager.GetCurrentProgressionState(); + if (state == m_appliedState) return; + m_appliedState = state; + + SkeletonProgression.SkeletonRules rules = SkeletonProgression.GetRules(state); + + m_mods = new List + { + new HitData.DamageModPair { m_type = HitData.DamageType.Pierce, m_modifier = HitData.DamageModifier.Resistant }, + new HitData.DamageModPair { m_type = HitData.DamageType.Slash, m_modifier = HitData.DamageModifier.Resistant }, + new HitData.DamageModPair { m_type = HitData.DamageType.Blunt, m_modifier = HitData.DamageModifier.Weak } + }; + + if (rules.PoisonImmunity) + { + m_mods.Add(new HitData.DamageModPair { m_type = HitData.DamageType.Poison, m_modifier = HitData.DamageModifier.Immune }); + } } } From f192f929f6eb35ed56b941471f41ce9e34f9a4c3 Mon Sep 17 00:00:00 2001 From: kanym Date: Wed, 5 Aug 2026 17:04:10 +0200 Subject: [PATCH 02/11] feat(skeleton): wear Skeleton_Hildir from Moder, not the charred twitcher Swaps the model the race takes at Moder. Hildir'''s skeleton is built on the same rig as the plain one, so the 0.85/1.20/0.85 squeeze goes with it - that existed only to make the charred twitcher'''s broader, shorter proportions read as a player, and the bone-by-name remapping the swap relies on now has an exact rig to match against rather than an approximate one. The compendium no longer claims the bones blacken, since they no longer do; the fire aura it describes is unchanged. An unresolved model id used to fail silently and invisibly - the human body is switched off before the replacement is built, so a bad name leaves a player with no mesh at all. It now warns once per name. --- JotunnModStub/RaceCompendium.cs | 4 ++-- JotunnModStub/Skeleton/SkeletonPatches.cs | 21 +++++++++++++++++++ JotunnModStub/Skeleton/SkeletonProgression.cs | 16 +++++++------- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/JotunnModStub/RaceCompendium.cs b/JotunnModStub/RaceCompendium.cs index 92707d6..58f907e 100644 --- a/JotunnModStub/RaceCompendium.cs +++ b/JotunnModStub/RaceCompendium.cs @@ -347,8 +347,8 @@ namespace RacesOfValheim if (state >= 5) { - sb.AppendLine("[Moder Unlock] Charred Bones:"); - sb.AppendLine("Your frame blackens and burns, and the fire clings to you: everything near enough to feel it is scorched. Your wounds also close faster than bone has any right to.\n"); + sb.AppendLine("[Moder Unlock] Bones Alight:"); + sb.AppendLine("Your frame is remade in a harder cast, and fire clings to it: everything near enough to feel it is scorched. Your wounds also close faster than bone has any right to.\n"); } if (state >= 6) diff --git a/JotunnModStub/Skeleton/SkeletonPatches.cs b/JotunnModStub/Skeleton/SkeletonPatches.cs index 92a9c87..4767e6c 100644 --- a/JotunnModStub/Skeleton/SkeletonPatches.cs +++ b/JotunnModStub/Skeleton/SkeletonPatches.cs @@ -10,6 +10,20 @@ namespace RacesOfValheim private static Mesh skeletonMesh = null; private static Material[] skeletonMaterials = null; + // Model names already reported as missing. The body swap runs from a visual refresh, so + // without this a mistyped prefab id would log every time equipment changes. + private static readonly System.Collections.Generic.HashSet warnedMissingModels = + new System.Collections.Generic.HashSet(); + + private static void WarnMissingModelOnce(string prefabName) + { + if (!warnedMissingModels.Add(prefabName)) return; + + Jotunn.Logger.LogWarning( + $"[Skeleton] Body model prefab '{prefabName}' not found - the race has no mesh at this tier. " + + "Check the id in SkeletonProgression."); + } + /// /// Makes the Skeleton's max health exactly what its progression promises. /// @@ -260,6 +274,13 @@ namespace RacesOfValheim if (skeletonBodyTransform == null) { GameObject skelPrefab = PrefabManager.Cache.GetPrefab(rules.ModelPrefab); + if (skelPrefab == null) + { + // The human body was switched off two lines up, so an unresolved + // model leaves an invisible player rather than an obvious error. + // Say so once per tier instead of failing silently. + WarnMissingModelOnce(rules.ModelPrefab); + } if (skelPrefab != null) { GameObject skelObj = new GameObject(targetBodyName); diff --git a/JotunnModStub/Skeleton/SkeletonProgression.cs b/JotunnModStub/Skeleton/SkeletonProgression.cs index 66d297b..1225a90 100644 --- a/JotunnModStub/Skeleton/SkeletonProgression.cs +++ b/JotunnModStub/Skeleton/SkeletonProgression.cs @@ -37,15 +37,15 @@ namespace RacesOfValheim public const string BaseModel = "Skeleton"; public const string PoisonModel = "Skeleton_Poison"; - // The published progression calls for a fire skeleton from Moder on, and the charred - // twitcher is the only burnt skeleton the game ships. It used to arrive at Fader; if that - // is preferred, move the model and its scale back to the state >= 8 block - nothing else - // in this file depends on where they sit. - public const string FireModel = "Charred_Twitcher"; + // The model worn from Moder on. It used to arrive at Fader; if that is preferred, move it + // and its scale back to the state >= 8 block - nothing else in this file depends on where + // they sit. + public const string FireModel = "Skeleton_Hildir"; - // The charred rig is broader and shorter than a plain skeleton, so it needs squeezing to - // read as a player. Tied to the model, not to a tier. - public static readonly UnityEngine.Vector3 FireModelScale = new UnityEngine.Vector3(0.85f, 1.20f, 0.85f); + // Hildir's skeleton is built on the same rig as the plain one, so it needs no reshaping to + // read as a player - unlike the charred twitcher this replaced, which is broader and + // shorter and wore a 0.85/1.20/0.85 squeeze to compensate. Tied to the model, not a tier. + public static readonly UnityEngine.Vector3 FireModelScale = UnityEngine.Vector3.one; public const string SummonPrefabName = "Skeleton_friendly"; From 6b890f71c44992ebd9f730277e9239b32994054d Mon Sep 17 00:00:00 2001 From: kanym Date: Wed, 5 Aug 2026 17:20:16 +0200 Subject: [PATCH 03/11] fix(skeleton): keep Undead Fortitude on the player, and light the skull The poison immunity fix before this one was necessary but not sufficient: it kept the damage modifiers current, on an effect that was not there. SE_SkeletonStats carries every damage modifier the race has - pierce and slash resistance, the weakness to blunt, and the poison immunity - and it was applied in exactly one place, the moment the player clicked Skeleton in the race menu. Status effects are not saved with a character and do not survive death, so from the next respawn or the next login onward a Skeleton simply had none of them. That is why a blob still poisoned a tier 5 Skeleton. It is now re-applied whenever it is missing. The Moder regeneration bonus was broken the same way round: SkeletonRace wrote m_healthRegenMultiplier onto the registered template, but SEMan.AddStatusEffect clones what it is given and adds the clone, so the write reached nobody. The effect now sets it on itself, alongside the modifiers it already rebuilds per tier. Also lights the skull. Cosmetic only, worn with the fire-tier model and nothing else. It is parented to the player and moved onto the head bone each frame rather than parented to the bone: the rig is authored at roughly 100x and a particle system inheriting that would put a bonfire where a candle belongs. --- JotunnModStub/Skeleton/SkeletonRace.cs | 138 ++++++++++++++++-- .../Skeleton/SkeletonStatusEffects.cs | 12 +- 2 files changed, 134 insertions(+), 16 deletions(-) diff --git a/JotunnModStub/Skeleton/SkeletonRace.cs b/JotunnModStub/Skeleton/SkeletonRace.cs index 5243096..bca6620 100644 --- a/JotunnModStub/Skeleton/SkeletonRace.cs +++ b/JotunnModStub/Skeleton/SkeletonRace.cs @@ -49,8 +49,19 @@ namespace RacesOfValheim Player.m_localPlayer.m_customData["Race"] == "Skeleton"; } + private static readonly int StatsEffectHash = "SE_SkeletonStats".GetStableHashCode(); + private float lastAuraTime = 0f; private GameObject fireAuraVFX = null; + + // Flames on the skull. Purely cosmetic, and deliberately not parented to the head bone: + // the player rig is authored at roughly 100x, which would blow the particle sizes up with + // it. Kept under the player and moved onto the bone each frame instead. + private GameObject headFlameVFX = null; + private Transform headFlameBone = null; + + // Above the head bone's own origin, which sits at the base of the skull. + private const float HeadFlameHeight = 0.18f; private static List[] cachedRealFoods = new List[9]; private List GetBestRealFoods(int state) @@ -210,6 +221,17 @@ namespace RacesOfValheim } } + // Undead Fortitude carries every one of the race's damage modifiers - the pierce and + // slash resistance, the weakness to blunt, and the poison immunity. It was applied in + // exactly one place: the moment the player clicked "Skeleton" in the race menu. Status + // effects are not saved with a character and do not survive death, so from the next + // respawn or the next login onward a Skeleton had none of them, which is why poison + // still landed at tiers that grant immunity. Put it back whenever it is missing. + if (!Player.m_localPlayer.GetSEMan().HaveStatusEffect(StatsEffectHash)) + { + Player.m_localPlayer.GetSEMan().AddStatusEffect(StatsEffectHash, true); + } + int state = BossProgressionManager.GetCurrentProgressionState(); var rules = SkeletonProgression.GetRules(state); @@ -331,25 +353,19 @@ namespace RacesOfValheim } } - // Enhanced Health Regeneration + // Enhanced Health Regeneration. The multiplier itself now lives on the status effect, + // which sets it on the live instance - writing it here only ever reached the template + // SEMan clones from, so it changed nothing for the player. What stays here is the tick + // rate, which is the player's own field. if (rules.EnhancedRegen) { - if (skeletonStatsSE != null) - { - skeletonStatsSE.m_healthRegenMultiplier = 1.5f; - } - // Speed up regen ticks by 20% (1.25x faster timer accumulation) float currentTimer = HarmonyLib.Traverse.Create(Player.m_localPlayer).Field("m_foodRegenTimer").Value; HarmonyLib.Traverse.Create(Player.m_localPlayer).Field("m_foodRegenTimer").SetValue(currentTimer + Time.deltaTime * 0.25f); } - else - { - if (skeletonStatsSE != null) - { - skeletonStatsSE.m_healthRegenMultiplier = 1.0f; - } - } + + // Flames on the skull, worn with the fire-tier model and nothing else. + EnsureHeadFlameVFX(rules.ModelPrefab == SkeletonProgression.FireModel); if (rules.FireAura) { @@ -366,6 +382,102 @@ namespace RacesOfValheim } } + /// + /// Flames burning on the skull. Cosmetic only - it deals nothing and blocks nothing. + /// + /// Built from the same particle source as the fire aura, small and tight rather than a + /// cloud, and left in world simulation space so the flames trail behind a running player + /// instead of riding rigidly on the bone. The object is parented to the player and moved + /// onto the head each frame rather than being parented to the head bone itself: the + /// player's rig is authored at roughly 100x, and a particle system inheriting that scale + /// would put a bonfire where a candle belongs. + /// + private void EnsureHeadFlameVFX(bool enable) + { + if (!enable) + { + if (headFlameVFX != null && headFlameVFX.activeSelf) headFlameVFX.SetActive(false); + return; + } + + if (Player.m_localPlayer == null) return; + + if (headFlameVFX == null) + { + Animator anim = Player.m_localPlayer.GetComponentInChildren(); + headFlameBone = anim != null ? anim.GetBoneTransform(HumanBodyBones.Head) : null; + if (headFlameBone == null) return; // rig not up yet; try again next frame + + GameObject sourceVFX = PrefabManager.Cache.GetPrefab("vfx_smoke") ?? + PrefabManager.Cache.GetPrefab("vfx_surtling_death"); + ParticleSystemRenderer sourceRenderer = + sourceVFX != null ? sourceVFX.GetComponentInChildren() : null; + if (sourceRenderer == null) return; + + headFlameVFX = new GameObject("SkeletonHeadFlameVFX"); + headFlameVFX.transform.SetParent(Player.m_localPlayer.transform, false); + + ParticleSystem ps = headFlameVFX.AddComponent(); + + var main = ps.main; + main.loop = true; + main.duration = 1f; + main.startLifetime = new ParticleSystem.MinMaxCurve(0.35f, 0.6f); + main.startSize = new ParticleSystem.MinMaxCurve(0.18f, 0.38f); + main.startSpeed = new ParticleSystem.MinMaxCurve(0.4f, 0.9f); + main.simulationSpace = ParticleSystemSimulationSpace.World; + + headFlameVFX.GetComponent().material = sourceRenderer.material; + + var shape = ps.shape; + shape.shapeType = ParticleSystemShapeType.Sphere; + shape.radius = 0.11f; + + var emission = ps.emission; + emission.rateOverTime = 28f; + + // Straight up, so it reads as burning rather than drifting. + var velocity = ps.velocityOverLifetime; + velocity.enabled = true; + velocity.space = ParticleSystemSimulationSpace.World; + velocity.y = new ParticleSystem.MinMaxCurve(0.5f); + + var colorOverLifetime = ps.colorOverLifetime; + colorOverLifetime.enabled = true; + Gradient grad = new Gradient(); + grad.SetKeys( + new GradientColorKey[] + { + new GradientColorKey(new Color(1f, 0.95f, 0.55f), 0.0f), // pale yellow core + new GradientColorKey(new Color(1f, 0.45f, 0.05f), 0.45f), // orange + new GradientColorKey(new Color(0.35f, 0.05f, 0.0f), 1.0f) // ember, guttering out + }, + new GradientAlphaKey[] + { + new GradientAlphaKey(0.0f, 0.0f), + new GradientAlphaKey(0.8f, 0.15f), + new GradientAlphaKey(0.5f, 0.7f), + new GradientAlphaKey(0.0f, 1.0f) + } + ); + colorOverLifetime.color = grad; + + // Tapers as it rises, the way a flame narrows toward its tip. + var sizeOverLifetime = ps.sizeOverLifetime; + sizeOverLifetime.enabled = true; + sizeOverLifetime.size = new ParticleSystem.MinMaxCurve( + 1f, new AnimationCurve(new Keyframe(0f, 0.6f), new Keyframe(0.3f, 1f), new Keyframe(1f, 0.15f))); + } + + if (!headFlameVFX.activeSelf) headFlameVFX.SetActive(true); + + // Follows the skull without inheriting its scale. + if (headFlameBone != null) + { + headFlameVFX.transform.position = headFlameBone.position + Vector3.up * HeadFlameHeight; + } + } + private void EnsureFireAuraVFX(bool enable) { if (enable && Player.m_localPlayer != null) diff --git a/JotunnModStub/Skeleton/SkeletonStatusEffects.cs b/JotunnModStub/Skeleton/SkeletonStatusEffects.cs index 398cd7b..553a760 100644 --- a/JotunnModStub/Skeleton/SkeletonStatusEffects.cs +++ b/JotunnModStub/Skeleton/SkeletonStatusEffects.cs @@ -11,7 +11,7 @@ namespace RacesOfValheim public override void Setup(Character character) { base.Setup(character); - RebuildDamageMods(); + RebuildForState(); } public override void UpdateStatusEffect(float dt) @@ -24,10 +24,10 @@ namespace RacesOfValheim // arrived: killing the boss changed the rules, and nothing ever asked them again. // Everything else the race does re-reads GetRules per hit, which is why only the // modifiers looked broken. Re-check here instead; the state comparison makes it free. - RebuildDamageMods(); + RebuildForState(); } - private void RebuildDamageMods() + private void RebuildForState() { int state = BossProgressionManager.GetCurrentProgressionState(); if (state == m_appliedState) return; @@ -35,6 +35,12 @@ namespace RacesOfValheim SkeletonProgression.SkeletonRules rules = SkeletonProgression.GetRules(state); + // Set here, on the live effect, rather than by SkeletonRace on the registered + // template: SEMan.AddStatusEffect clones what it is given and adds the clone, so + // anything written to the template afterwards reaches nobody. That is why the Moder + // regeneration bonus never applied either. + m_healthRegenMultiplier = rules.EnhancedRegen ? 1.5f : 1.0f; + m_mods = new List { new HitData.DamageModPair { m_type = HitData.DamageType.Pierce, m_modifier = HitData.DamageModifier.Resistant }, From 59c250b4f82aab9ca460397ccc7a0dc02d2ed85e Mon Sep 17 00:00:00 2001 From: kanym Date: Wed, 5 Aug 2026 17:30:15 +0200 Subject: [PATCH 04/11] fix(skeleton): reattach the mandible, light the skull for real, and grow at Fader The jaw hung off the side of the skull because a creature rig carries bones a human rig has no answer for. Unmatched bones fell back to bones[0] - the root - so the mandible was skinned to the hips and followed them. The remap now walks the creature'''s own hierarchy upward until something matches, which lands a jaw on the head. It no longer opens, which no player will notice, and it is attached, which every player did. Teeth and any other facial part the model carries are fixed by the same walk. The head flame never appeared. It was built by hand out of the smoke material with a hand-rolled fire gradient, which at best would have read as a wisp rather than a burning skull, and at worst never resolved a source at all and returned in silence. It now clones real fire particles off a vanilla prefab - the torch first, ground torches and the fire pit behind it - and says in the log which one it took, or warns if none of them resolved. The torch light comes with it, at half range and reduced intensity, since a light tuned to fill a corridor from waist height blows out a face at point-blank range. Fader now stands 15% taller. That scale goes on the player root, which is how this race has always sized itself, so the collider, the camera pivot and every equipment attachment scale with the mesh rather than leaving the model to drift away from them. --- JotunnModStub/Skeleton/SkeletonPatches.cs | 33 ++++- JotunnModStub/Skeleton/SkeletonProgression.cs | 6 + JotunnModStub/Skeleton/SkeletonRace.cs | 126 ++++++++++-------- 3 files changed, 109 insertions(+), 56 deletions(-) diff --git a/JotunnModStub/Skeleton/SkeletonPatches.cs b/JotunnModStub/Skeleton/SkeletonPatches.cs index 4767e6c..0498b8b 100644 --- a/JotunnModStub/Skeleton/SkeletonPatches.cs +++ b/JotunnModStub/Skeleton/SkeletonPatches.cs @@ -298,14 +298,13 @@ namespace RacesOfValheim Transform[] newBones = new Transform[newSmr.bones.Length]; for (int i = 0; i < newSmr.bones.Length; i++) { - Transform matchedBone = FindBoneByName(playerBones, newSmr.bones[i].name); - newBones[i] = matchedBone != null ? matchedBone : playerBones[0]; + newBones[i] = ResolveBone(playerBones, newSmr.bones[i]); } newSmr.bones = newBones; - + if (newSmr.rootBone != null) { - newSmr.rootBone = FindBoneByName(playerBones, newSmr.rootBone.name) ?? playerBones[0]; + newSmr.rootBone = ResolveBone(playerBones, newSmr.rootBone); } } @@ -397,6 +396,32 @@ namespace RacesOfValheim catch (System.Exception e) { } } + /// + /// Finds the player bone a creature bone should be skinned to. + /// + /// A creature rig carries bones a human rig has no answer for - a jaw above all, but + /// also teeth and tails. Those used to fall back to bones[0], the root, which skinned + /// the mandible to the hips and left it hanging off the side of the skull. Follow the + /// creature's own hierarchy upward instead until something matches, so a jaw lands on + /// the head and rides it. It cannot open any more, which no player will notice, and it + /// is attached, which every player did. + /// + private static Transform ResolveBone(Transform[] playerBones, Transform sourceBone) + { + if (sourceBone == null) return playerBones[0]; + + Transform direct = FindBoneByName(playerBones, sourceBone.name); + if (direct != null) return direct; + + for (Transform parent = sourceBone.parent; parent != null; parent = parent.parent) + { + Transform match = FindBoneByName(playerBones, parent.name); + if (match != null) return match; + } + + return playerBones[0]; + } + private static Transform FindBoneByName(Transform[] bones, string skelBoneName) { // Exact match first diff --git a/JotunnModStub/Skeleton/SkeletonProgression.cs b/JotunnModStub/Skeleton/SkeletonProgression.cs index 1225a90..2e6d9d6 100644 --- a/JotunnModStub/Skeleton/SkeletonProgression.cs +++ b/JotunnModStub/Skeleton/SkeletonProgression.cs @@ -49,6 +49,11 @@ namespace RacesOfValheim public const string SummonPrefabName = "Skeleton_friendly"; + // Fader's dead stand taller than everyone else's. Applied to the player's root transform, + // which is how this race has always sized itself - so it carries the collider, the camera + // pivot and every equipment attachment up with it, rather than only the mesh. + public static readonly UnityEngine.Vector3 FaderScale = UnityEngine.Vector3.one * 1.15f; + /// /// Every tier, exactly as the race's published progression describes it. The table had /// drifted a long way from that description - poison immunity arrived two tiers late, @@ -115,6 +120,7 @@ namespace RacesOfValheim { rules.LifestealPercent = 0.35f; rules.MaxSummons = 5; + rules.ScaleMultiplier = FaderScale; } return rules; diff --git a/JotunnModStub/Skeleton/SkeletonRace.cs b/JotunnModStub/Skeleton/SkeletonRace.cs index bca6620..9ba8679 100644 --- a/JotunnModStub/Skeleton/SkeletonRace.cs +++ b/JotunnModStub/Skeleton/SkeletonRace.cs @@ -62,6 +62,46 @@ namespace RacesOfValheim // Above the head bone's own origin, which sits at the base of the skull. private const float HeadFlameHeight = 0.18f; + + // Torch flames are authored for a fist-sized fire on a stick. This is the two knobs to + // turn if the skull ends up wearing a bonfire or a birthday candle. + private const float HeadFlameScale = 1.8f; + + // Fire sources in preference order. The torch is an item every world has; the ground + // torch and the fire pit are the building pieces to fall back on. + private static readonly string[] FlameSourcePrefabs = + { + "Torch", "piece_groundtorch_wood", "piece_groundtorch", "fire_pit" + }; + + private static GameObject cachedFlameSource; + private static bool flameSourceResolved; + + /// + /// Finds a vanilla prefab that carries real fire particles. Resolved once per session, + /// failure included, so a miss cannot turn into a per-frame log. + /// + private static GameObject ResolveFlameSource() + { + if (flameSourceResolved) return cachedFlameSource; + flameSourceResolved = true; + + foreach (string name in FlameSourcePrefabs) + { + GameObject prefab = PrefabManager.Cache.GetPrefab(name); + if (prefab == null) continue; + if (prefab.GetComponentsInChildren(true).Length == 0) continue; + + Jotunn.Logger.LogInfo($"[Skeleton] Head flame source resolved to '{name}'."); + cachedFlameSource = prefab; + return cachedFlameSource; + } + + Jotunn.Logger.LogWarning( + "[Skeleton] No fire prefab resolved (" + string.Join(", ", FlameSourcePrefabs) + + "); the skull stays unlit."); + return null; + } private static List[] cachedRealFoods = new List[9]; private List GetBestRealFoods(int state) @@ -408,65 +448,47 @@ namespace RacesOfValheim headFlameBone = anim != null ? anim.GetBoneTransform(HumanBodyBones.Head) : null; if (headFlameBone == null) return; // rig not up yet; try again next frame - GameObject sourceVFX = PrefabManager.Cache.GetPrefab("vfx_smoke") ?? - PrefabManager.Cache.GetPrefab("vfx_surtling_death"); - ParticleSystemRenderer sourceRenderer = - sourceVFX != null ? sourceVFX.GetComponentInChildren() : null; - if (sourceRenderer == null) return; + GameObject source = ResolveFlameSource(); + if (source == null) return; // already logged once by the resolver headFlameVFX = new GameObject("SkeletonHeadFlameVFX"); headFlameVFX.transform.SetParent(Player.m_localPlayer.transform, false); + headFlameVFX.transform.localScale = Vector3.one * HeadFlameScale; - ParticleSystem ps = headFlameVFX.AddComponent(); + // Real fire is cloned rather than built by hand. The first attempt at this made a + // particle system from scratch on the smoke material, and a hand-rolled gradient + // over a smoke sprite reads as a wisp, not a burning skull. + foreach (ParticleSystem ps in source.GetComponentsInChildren(true)) + { + GameObject copy = Instantiate(ps.gameObject, headFlameVFX.transform); + copy.name = ps.gameObject.name; + copy.transform.localPosition = Vector3.zero; + copy.transform.localRotation = Quaternion.identity; + copy.SetActive(true); - var main = ps.main; - main.loop = true; - main.duration = 1f; - main.startLifetime = new ParticleSystem.MinMaxCurve(0.35f, 0.6f); - main.startSize = new ParticleSystem.MinMaxCurve(0.18f, 0.38f); - main.startSpeed = new ParticleSystem.MinMaxCurve(0.4f, 0.9f); - main.simulationSpace = ParticleSystemSimulationSpace.World; + // So the holder's scale actually enlarges the fire rather than just spreading + // out where the particles spawn. + ParticleSystem.MainModule main = copy.GetComponent().main; + main.scalingMode = ParticleSystemScalingMode.Hierarchy; + } - headFlameVFX.GetComponent().material = sourceRenderer.material; + // A torch's own light is tuned to light a corridor from waist height; on a head it + // blows out the whole face. Keep the glow, lose the floodlight. + foreach (Light light in headFlameVFX.GetComponentsInChildren(true)) + { + light.range *= 0.5f; + light.intensity *= 0.6f; + } - var shape = ps.shape; - shape.shapeType = ParticleSystemShapeType.Sphere; - shape.radius = 0.11f; - - var emission = ps.emission; - emission.rateOverTime = 28f; - - // Straight up, so it reads as burning rather than drifting. - var velocity = ps.velocityOverLifetime; - velocity.enabled = true; - velocity.space = ParticleSystemSimulationSpace.World; - velocity.y = new ParticleSystem.MinMaxCurve(0.5f); - - var colorOverLifetime = ps.colorOverLifetime; - colorOverLifetime.enabled = true; - Gradient grad = new Gradient(); - grad.SetKeys( - new GradientColorKey[] - { - new GradientColorKey(new Color(1f, 0.95f, 0.55f), 0.0f), // pale yellow core - new GradientColorKey(new Color(1f, 0.45f, 0.05f), 0.45f), // orange - new GradientColorKey(new Color(0.35f, 0.05f, 0.0f), 1.0f) // ember, guttering out - }, - new GradientAlphaKey[] - { - new GradientAlphaKey(0.0f, 0.0f), - new GradientAlphaKey(0.8f, 0.15f), - new GradientAlphaKey(0.5f, 0.7f), - new GradientAlphaKey(0.0f, 1.0f) - } - ); - colorOverLifetime.color = grad; - - // Tapers as it rises, the way a flame narrows toward its tip. - var sizeOverLifetime = ps.sizeOverLifetime; - sizeOverLifetime.enabled = true; - sizeOverLifetime.size = new ParticleSystem.MinMaxCurve( - 1f, new AnimationCurve(new Keyframe(0f, 0.6f), new Keyframe(0.3f, 1f), new Keyframe(1f, 0.15f))); + // Anything that made the source a torch rather than a fire. + foreach (MonoBehaviour comp in headFlameVFX.GetComponentsInChildren(true)) + { + Destroy(comp); + } + foreach (Collider col in headFlameVFX.GetComponentsInChildren(true)) + { + Destroy(col); + } } if (!headFlameVFX.activeSelf) headFlameVFX.SetActive(true); From 5c75170a599697fc86bcb6ca4a17046897cce552 Mon Sep 17 00:00:00 2001 From: kanym Date: Wed, 5 Aug 2026 17:39:30 +0200 Subject: [PATCH 05/11] fix(skeleton): pin the whole skull to the head bone, and report how bones land The previous attempt only helped bones that matched nothing, and the mandible did not move - which says the jaw was matching something directly all along, and being bound to it. A creature jaw is authored against its own skull, so whatever it lands on, a bone-for-bone match included, puts the mandible near the face rather than on it. Jaw, teeth, tongue and chin are now pinned to the head bone as a group, before any name matching runs, so the skull renders as one piece. It cannot open any more, which is a fair trade for being attached. If that is still not it, the shape of the problem is not visible in a screenshot: it matters whether the jaw has a bone at all, whether it matched, and what it matched. The body build now reports exactly that, once per model per session - every skull part and every bone that fell through to the root - so the next look starts from data instead of another guess. --- JotunnModStub/Skeleton/SkeletonPatches.cs | 69 ++++++++++++++++++++--- 1 file changed, 62 insertions(+), 7 deletions(-) diff --git a/JotunnModStub/Skeleton/SkeletonPatches.cs b/JotunnModStub/Skeleton/SkeletonPatches.cs index 0498b8b..fef3b6a 100644 --- a/JotunnModStub/Skeleton/SkeletonPatches.cs +++ b/JotunnModStub/Skeleton/SkeletonPatches.cs @@ -15,6 +15,10 @@ namespace RacesOfValheim private static readonly System.Collections.Generic.HashSet warnedMissingModels = new System.Collections.Generic.HashSet(); + // Model parts whose bone mapping has already been reported this session. + private static readonly System.Collections.Generic.HashSet loggedBoneMaps = + new System.Collections.Generic.HashSet(); + private static void WarnMissingModelOnce(string prefabName) { if (!warnedMissingModels.Add(prefabName)) return; @@ -295,6 +299,8 @@ namespace RacesOfValheim // Map bones by name Transform[] playerBones = __instance.m_bodyModel.bones; + LogBoneMapping(rules.ModelPrefab, newSmr, playerBones); + Transform[] newBones = new Transform[newSmr.bones.Length]; for (int i = 0; i < newSmr.bones.Length; i++) { @@ -396,23 +402,36 @@ namespace RacesOfValheim catch (System.Exception e) { } } + // Parts of a skull that must ride the head as one piece. A creature's jaw is authored + // against its own skull, so binding it to a same-named bone on the player - or letting + // it fall through to the root - puts the mandible somewhere near the face rather than + // on it. Pinning the whole group to the head keeps the skull in one piece; the jaw + // stops being able to open, which is a fair trade for it being attached. + private static readonly string[] SkullParts = { "jaw", "teeth", "tooth", "tongue", "chin", "mandible" }; + /// /// Finds the player bone a creature bone should be skinned to. - /// - /// A creature rig carries bones a human rig has no answer for - a jaw above all, but - /// also teeth and tails. Those used to fall back to bones[0], the root, which skinned - /// the mandible to the hips and left it hanging off the side of the skull. Follow the - /// creature's own hierarchy upward instead until something matches, so a jaw lands on - /// the head and rides it. It cannot open any more, which no player will notice, and it - /// is attached, which every player did. /// private static Transform ResolveBone(Transform[] playerBones, Transform sourceBone) { if (sourceBone == null) return playerBones[0]; + string name = sourceBone.name.ToLower(); + foreach (string part in SkullParts) + { + if (!name.Contains(part)) continue; + + Transform head = FindBoneByName(playerBones, "Head"); + if (head != null) return head; + break; + } + Transform direct = FindBoneByName(playerBones, sourceBone.name); if (direct != null) return direct; + // Nothing by that name. Follow the creature's own hierarchy upward until something + // matches, so an unmapped part rides its nearest real parent rather than being + // dumped on bones[0], which is the root. for (Transform parent = sourceBone.parent; parent != null; parent = parent.parent) { Transform match = FindBoneByName(playerBones, parent.name); @@ -422,6 +441,42 @@ namespace RacesOfValheim return playerBones[0]; } + /// + /// Reports how a model's bones landed on the player rig, once per model per session. + /// The mandible problem is not diagnosable from a screenshot - it matters whether the + /// jaw has a bone at all, whether it matched something, and what it matched - and this + /// answers all three in one line each. + /// + private static void LogBoneMapping(string modelName, SkinnedMeshRenderer smr, Transform[] playerBones) + { + if (!loggedBoneMaps.Add($"{modelName}/{smr.name}")) return; + + Jotunn.Logger.LogInfo($"[Skeleton] '{modelName}' part '{smr.name}': {smr.bones.Length} bones."); + + foreach (Transform bone in smr.bones) + { + if (bone == null) continue; + + string lower = bone.name.ToLower(); + bool interesting = false; + foreach (string part in SkullParts) + { + if (lower.Contains(part)) { interesting = true; break; } + } + + Transform resolved = ResolveBone(playerBones, bone); + bool isRootFallback = resolved == playerBones[0] && + FindBoneByName(playerBones, bone.name) == null; + + if (!interesting && !isRootFallback) continue; + + Jotunn.Logger.LogInfo( + $"[Skeleton] '{bone.name}' -> '{(resolved != null ? resolved.name : "null")}'" + + (isRootFallback ? " (ROOT FALLBACK)" : "") + + (interesting ? " (skull part)" : "")); + } + } + private static Transform FindBoneByName(Transform[] bones, string skelBoneName) { // Exact match first From d9b87e97f07cb37e8cc432922d92e7b1c294b010 Mon Sep 17 00:00:00 2001 From: kanym Date: Wed, 5 Aug 2026 17:47:46 +0200 Subject: [PATCH 06/11] fix(skeleton): put the jaw mapping back, and dim the head flame The log settled it. All three skeleton models share one rig - 53 bones each, a bone named Jaw in every one, and not a single bone falling through to the root - which means the player rig has a real Jaw bone and the plain name match was landing on it correctly all along. That is why the plain and poison skeletons always looked right, and why pinning the skull group to the head deformed them. Reverted; the parent walk stays for bones that genuinely match nothing. Which leaves the real question: three models, one rig, one mapping, and only Hildir wears its jaw wrongly. The difference has to be in how that jaw is posed or bound rather than where it is mapped, so the diagnostic now prints the rest transform of every skull bone alongside the player's own. One session loading a working model and the broken one gives the exact correction instead of a third guess at it. The flame works - it resolved to the torch - but at 1.8 it was a white-hot bloom that washed out the screen and hid the skull underneath, which is no way to judge a jaw. Down to 1.1, with the torch light cut further. --- JotunnModStub/Skeleton/SkeletonPatches.cs | 39 ++++++++++++++--------- JotunnModStub/Skeleton/SkeletonRace.cs | 11 ++++--- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/JotunnModStub/Skeleton/SkeletonPatches.cs b/JotunnModStub/Skeleton/SkeletonPatches.cs index fef3b6a..61a92a5 100644 --- a/JotunnModStub/Skeleton/SkeletonPatches.cs +++ b/JotunnModStub/Skeleton/SkeletonPatches.cs @@ -402,11 +402,10 @@ namespace RacesOfValheim catch (System.Exception e) { } } - // Parts of a skull that must ride the head as one piece. A creature's jaw is authored - // against its own skull, so binding it to a same-named bone on the player - or letting - // it fall through to the root - puts the mandible somewhere near the face rather than - // on it. Pinning the whole group to the head keeps the skull in one piece; the jaw - // stops being able to open, which is a fair trade for it being attached. + // Bones worth reporting on. Not remapped - the player rig has a real 'Jaw' bone and the + // name match lands on it correctly, which is exactly why the plain and poison skeletons + // always looked right. An earlier attempt pinned this group to the head instead and + // deformed all three models; the log is what settled it. private static readonly string[] SkullParts = { "jaw", "teeth", "tooth", "tongue", "chin", "mandible" }; /// @@ -416,16 +415,6 @@ namespace RacesOfValheim { if (sourceBone == null) return playerBones[0]; - string name = sourceBone.name.ToLower(); - foreach (string part in SkullParts) - { - if (!name.Contains(part)) continue; - - Transform head = FindBoneByName(playerBones, "Head"); - if (head != null) return head; - break; - } - Transform direct = FindBoneByName(playerBones, sourceBone.name); if (direct != null) return direct; @@ -470,10 +459,30 @@ namespace RacesOfValheim if (!interesting && !isRootFallback) continue; + // The rest pose comes with it. Three models share this rig bone for bone, yet + // only one of them wears its jaw wrongly - so the difference is in how that + // jaw is posed or bound, not in where it is mapped. Printing the source + // transform next to the player's own gives the exact correction to apply + // rather than another guess at it. + Transform playerEquivalent = FindBoneByName(playerBones, bone.name); + Jotunn.Logger.LogInfo( $"[Skeleton] '{bone.name}' -> '{(resolved != null ? resolved.name : "null")}'" + (isRootFallback ? " (ROOT FALLBACK)" : "") + (interesting ? " (skull part)" : "")); + + if (!interesting) continue; + + Jotunn.Logger.LogInfo( + $"[Skeleton] source rest: pos={bone.localPosition:F4} " + + $"rot={bone.localRotation.eulerAngles:F2} scale={bone.localScale:F3}"); + + if (playerEquivalent != null) + { + Jotunn.Logger.LogInfo( + $"[Skeleton] player rest: pos={playerEquivalent.localPosition:F4} " + + $"rot={playerEquivalent.localRotation.eulerAngles:F2} scale={playerEquivalent.localScale:F3}"); + } } } diff --git a/JotunnModStub/Skeleton/SkeletonRace.cs b/JotunnModStub/Skeleton/SkeletonRace.cs index 9ba8679..8f7438c 100644 --- a/JotunnModStub/Skeleton/SkeletonRace.cs +++ b/JotunnModStub/Skeleton/SkeletonRace.cs @@ -63,9 +63,10 @@ namespace RacesOfValheim // Above the head bone's own origin, which sits at the base of the skull. private const float HeadFlameHeight = 0.18f; - // Torch flames are authored for a fist-sized fire on a stick. This is the two knobs to - // turn if the skull ends up wearing a bonfire or a birthday candle. - private const float HeadFlameScale = 1.8f; + // Torch flames are authored for a fist-sized fire on a stick. 1.8 turned the head into a + // white-hot bloom that washed out the whole screen - and, more to the point, hid the skull + // underneath it. This is the knob to turn if it still burns too bright or too small. + private const float HeadFlameScale = 1.1f; // Fire sources in preference order. The torch is an item every world has; the ground // torch and the fire pit are the building pieces to fall back on. @@ -476,8 +477,8 @@ namespace RacesOfValheim // blows out the whole face. Keep the glow, lose the floodlight. foreach (Light light in headFlameVFX.GetComponentsInChildren(true)) { - light.range *= 0.5f; - light.intensity *= 0.6f; + light.range *= 0.35f; + light.intensity *= 0.4f; } // Anything that made the source a torch rather than a fire. From dc635f49cbce37468ac88c15c9885bb91c10692c Mon Sep 17 00:00:00 2001 From: kanym Date: Wed, 5 Aug 2026 17:57:01 +0200 Subject: [PATCH 07/11] fix(skeleton): stop hiding Fader's jaw, and take the race off properly on reset Fader collapsed the jaw bone deliberately: the charred twitcher it used to wear there carried a jaw of its own and the two doubled up. That model is gone from every tier now, and the skeleton worn in its place has a jaw that belongs on the face - so tier 8 was losing its mandible for no reason. The collapse is gone and what remains is a restore, so anyone left jawless by the old build gets it back on their next frame. Resetting to Human left a burning skull and an invisible jaw behind. Everything the race puts on the player is taken off in one branch - the one entered the moment IsSkeleton stops being true - and neither the head flame nor the jaw was ever listed there. The flame was only ever switched off from inside the Skeleton branch, which by then is unreachable, and the jaw was only restored at tiers below 8, which a Human never evaluates. Both now come off with everything else, alongside the body scale that already did. --- JotunnModStub/Skeleton/SkeletonRace.cs | 53 ++++++++++++++++---------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/JotunnModStub/Skeleton/SkeletonRace.cs b/JotunnModStub/Skeleton/SkeletonRace.cs index 8f7438c..1d82864 100644 --- a/JotunnModStub/Skeleton/SkeletonRace.cs +++ b/JotunnModStub/Skeleton/SkeletonRace.cs @@ -228,9 +228,16 @@ namespace RacesOfValheim if (Player.m_localPlayer == null) return; - if (!IsSkeleton() || Player.m_localPlayer.IsDead()) + if (!IsSkeleton() || Player.m_localPlayer.IsDead()) { + // Everything the race puts on the player has to come off here, because this is the + // only path taken once they stop being one. A Fader-tier Skeleton who reset to + // Human kept a burning skull and a collapsed jaw, since neither the flame nor the + // jaw was ever switched back from outside the Skeleton branch below. EnsureFireAuraVFX(false); + EnsureHeadFlameVFX(false); + RestoreJawBone(); + if (Player.m_localPlayer.transform.localScale != Vector3.one) { Player.m_localPlayer.transform.localScale = Vector3.one; @@ -305,25 +312,12 @@ namespace RacesOfValheim } } - // Hide Charred Twitcher Jaw - if (currentVis != null && currentVis.m_bodyModel != null && currentVis.m_bodyModel.bones != null) - { - foreach (Transform bone in currentVis.m_bodyModel.bones) - { - if (bone != null && bone.name.ToLower().Contains("jaw")) - { - if (state >= 8) - { - if (bone.localScale != Vector3.zero) bone.localScale = Vector3.zero; - } - else - { - if (bone.localScale == Vector3.zero) bone.localScale = Vector3.one; - } - break; - } - } - } + // Fader used to collapse this bone, because the charred twitcher it wore there carried + // a jaw of its own and the two doubled up. That model is gone from every tier now, and + // the skeleton worn in its place has a jaw that belongs on the face - so the tier lost + // its mandible for no reason at all. Kept as a restore so anyone left with a collapsed + // jaw by the old build gets it back. + RestoreJawBone(); // Apply Scale Vector3 targetScale = rules.ScaleMultiplier; @@ -423,6 +417,25 @@ namespace RacesOfValheim } } + /// + /// Puts the player's jaw back if anything collapsed it. Safe to call every frame and for + /// any race - it does nothing unless the bone is actually at zero scale. + /// + private static void RestoreJawBone() + { + VisEquipment vis = Player.m_localPlayer != null + ? Player.m_localPlayer.GetComponent() + : null; + if (vis == null || vis.m_bodyModel == null || vis.m_bodyModel.bones == null) return; + + foreach (Transform bone in vis.m_bodyModel.bones) + { + if (bone == null || !bone.name.ToLower().Contains("jaw")) continue; + if (bone.localScale == Vector3.zero) bone.localScale = Vector3.one; + break; + } + } + /// /// Flames burning on the skull. Cosmetic only - it deals nothing and blocks nothing. /// From f012c969115df426c2974beff9b03fe56839ce08 Mon Sep 17 00:00:00 2001 From: kanym Date: Wed, 5 Aug 2026 18:09:04 +0200 Subject: [PATCH 08/11] style(skeleton): put the head flame back to full size Both halves of the dimming are reverted: scale to 1.8 and the torch light to half range at 60% intensity. It was only turned down to get a clear look at the jaw underneath, and the jaw is settled. The blaze is the point. --- JotunnModStub/Skeleton/SkeletonRace.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/JotunnModStub/Skeleton/SkeletonRace.cs b/JotunnModStub/Skeleton/SkeletonRace.cs index 1d82864..9489bf1 100644 --- a/JotunnModStub/Skeleton/SkeletonRace.cs +++ b/JotunnModStub/Skeleton/SkeletonRace.cs @@ -63,10 +63,10 @@ namespace RacesOfValheim // Above the head bone's own origin, which sits at the base of the skull. private const float HeadFlameHeight = 0.18f; - // Torch flames are authored for a fist-sized fire on a stick. 1.8 turned the head into a - // white-hot bloom that washed out the whole screen - and, more to the point, hid the skull - // underneath it. This is the knob to turn if it still burns too bright or too small. - private const float HeadFlameScale = 1.1f; + // Torch flames are authored for a fist-sized fire on a stick, so the skull wears a big + // multiple of one. This was briefly dropped to 1.1 to get a clear look at the jaw + // underneath; the blaze is the point, so it is back where it was. + private const float HeadFlameScale = 1.8f; // Fire sources in preference order. The torch is an item every world has; the ground // torch and the fire pit are the building pieces to fall back on. @@ -490,8 +490,8 @@ namespace RacesOfValheim // blows out the whole face. Keep the glow, lose the floodlight. foreach (Light light in headFlameVFX.GetComponentsInChildren(true)) { - light.range *= 0.35f; - light.intensity *= 0.4f; + light.range *= 0.5f; + light.intensity *= 0.6f; } // Anything that made the source a torch rather than a fire. From 892b970df4a55e2e57bc77862a1696fc664ce103 Mon Sep 17 00:00:00 2001 From: kanym Date: Wed, 5 Aug 2026 18:22:57 +0200 Subject: [PATCH 09/11] fix(skeleton): let everyone see the burning skull The head flame was built inside SkeletonRace, a single MonoBehaviour that only ever looks at Player.m_localPlayer, so the fire existed on one client and on one player. Everyone else saw a bare skull. Same shape as the Draugh aura, same fix: the build moves to SkeletonVisuals.HeadFlame, which takes a Player, and RacesVisualController grows one for every remote skeleton it can see. Held per player rather than statically - a static would hand the second skeleton in view the first one is fire. Nothing is networked and nothing needs to be: the tier is already on the ZDO, so each client works out for itself who should be alight. The remote path also still collapsed the jaw at Fader, the charred-twitcher leftover that was removed from the local path two commits ago - so other players would have gone on seeing a Fader with no mandible. It is a restore there now too. --- JotunnModStub/Skeleton/SkeletonRace.cs | 136 +------------------- JotunnModStub/Skeleton/SkeletonVisuals.cs | 150 ++++++++++++++++++++++ JotunnModStub/ZdoVisualSync.cs | 26 ++-- 3 files changed, 170 insertions(+), 142 deletions(-) create mode 100644 JotunnModStub/Skeleton/SkeletonVisuals.cs diff --git a/JotunnModStub/Skeleton/SkeletonRace.cs b/JotunnModStub/Skeleton/SkeletonRace.cs index 9489bf1..fa1b74f 100644 --- a/JotunnModStub/Skeleton/SkeletonRace.cs +++ b/JotunnModStub/Skeleton/SkeletonRace.cs @@ -1,4 +1,4 @@ -using UnityEngine; +using UnityEngine; using Jotunn.Managers; using Jotunn.Entities; using System.Collections.Generic; @@ -54,55 +54,11 @@ namespace RacesOfValheim private float lastAuraTime = 0f; private GameObject fireAuraVFX = null; - // Flames on the skull. Purely cosmetic, and deliberately not parented to the head bone: - // the player rig is authored at roughly 100x, which would blow the particle sizes up with - // it. Kept under the player and moved onto the bone each frame instead. - private GameObject headFlameVFX = null; - private Transform headFlameBone = null; + // The local player's burning skull. The build lives in SkeletonVisuals so that + // RacesVisualController can grow the same one on every remote skeleton - this script only + // ever sees the player at the keyboard, which is why nobody else could see the fire. + private readonly SkeletonVisuals.HeadFlame headFlame = new SkeletonVisuals.HeadFlame(); - // Above the head bone's own origin, which sits at the base of the skull. - private const float HeadFlameHeight = 0.18f; - - // Torch flames are authored for a fist-sized fire on a stick, so the skull wears a big - // multiple of one. This was briefly dropped to 1.1 to get a clear look at the jaw - // underneath; the blaze is the point, so it is back where it was. - private const float HeadFlameScale = 1.8f; - - // Fire sources in preference order. The torch is an item every world has; the ground - // torch and the fire pit are the building pieces to fall back on. - private static readonly string[] FlameSourcePrefabs = - { - "Torch", "piece_groundtorch_wood", "piece_groundtorch", "fire_pit" - }; - - private static GameObject cachedFlameSource; - private static bool flameSourceResolved; - - /// - /// Finds a vanilla prefab that carries real fire particles. Resolved once per session, - /// failure included, so a miss cannot turn into a per-frame log. - /// - private static GameObject ResolveFlameSource() - { - if (flameSourceResolved) return cachedFlameSource; - flameSourceResolved = true; - - foreach (string name in FlameSourcePrefabs) - { - GameObject prefab = PrefabManager.Cache.GetPrefab(name); - if (prefab == null) continue; - if (prefab.GetComponentsInChildren(true).Length == 0) continue; - - Jotunn.Logger.LogInfo($"[Skeleton] Head flame source resolved to '{name}'."); - cachedFlameSource = prefab; - return cachedFlameSource; - } - - Jotunn.Logger.LogWarning( - "[Skeleton] No fire prefab resolved (" + string.Join(", ", FlameSourcePrefabs) + - "); the skull stays unlit."); - return null; - } private static List[] cachedRealFoods = new List[9]; private List GetBestRealFoods(int state) @@ -235,7 +191,7 @@ namespace RacesOfValheim // Human kept a burning skull and a collapsed jaw, since neither the flame nor the // jaw was ever switched back from outside the Skeleton branch below. EnsureFireAuraVFX(false); - EnsureHeadFlameVFX(false); + headFlame.Apply(Player.m_localPlayer, false); RestoreJawBone(); if (Player.m_localPlayer.transform.localScale != Vector3.one) @@ -400,7 +356,7 @@ namespace RacesOfValheim } // Flames on the skull, worn with the fire-tier model and nothing else. - EnsureHeadFlameVFX(rules.ModelPrefab == SkeletonProgression.FireModel); + headFlame.Apply(Player.m_localPlayer, rules.ModelPrefab == SkeletonProgression.FireModel); if (rules.FireAura) { @@ -436,84 +392,6 @@ namespace RacesOfValheim } } - /// - /// Flames burning on the skull. Cosmetic only - it deals nothing and blocks nothing. - /// - /// Built from the same particle source as the fire aura, small and tight rather than a - /// cloud, and left in world simulation space so the flames trail behind a running player - /// instead of riding rigidly on the bone. The object is parented to the player and moved - /// onto the head each frame rather than being parented to the head bone itself: the - /// player's rig is authored at roughly 100x, and a particle system inheriting that scale - /// would put a bonfire where a candle belongs. - /// - private void EnsureHeadFlameVFX(bool enable) - { - if (!enable) - { - if (headFlameVFX != null && headFlameVFX.activeSelf) headFlameVFX.SetActive(false); - return; - } - - if (Player.m_localPlayer == null) return; - - if (headFlameVFX == null) - { - Animator anim = Player.m_localPlayer.GetComponentInChildren(); - headFlameBone = anim != null ? anim.GetBoneTransform(HumanBodyBones.Head) : null; - if (headFlameBone == null) return; // rig not up yet; try again next frame - - GameObject source = ResolveFlameSource(); - if (source == null) return; // already logged once by the resolver - - headFlameVFX = new GameObject("SkeletonHeadFlameVFX"); - headFlameVFX.transform.SetParent(Player.m_localPlayer.transform, false); - headFlameVFX.transform.localScale = Vector3.one * HeadFlameScale; - - // Real fire is cloned rather than built by hand. The first attempt at this made a - // particle system from scratch on the smoke material, and a hand-rolled gradient - // over a smoke sprite reads as a wisp, not a burning skull. - foreach (ParticleSystem ps in source.GetComponentsInChildren(true)) - { - GameObject copy = Instantiate(ps.gameObject, headFlameVFX.transform); - copy.name = ps.gameObject.name; - copy.transform.localPosition = Vector3.zero; - copy.transform.localRotation = Quaternion.identity; - copy.SetActive(true); - - // So the holder's scale actually enlarges the fire rather than just spreading - // out where the particles spawn. - ParticleSystem.MainModule main = copy.GetComponent().main; - main.scalingMode = ParticleSystemScalingMode.Hierarchy; - } - - // A torch's own light is tuned to light a corridor from waist height; on a head it - // blows out the whole face. Keep the glow, lose the floodlight. - foreach (Light light in headFlameVFX.GetComponentsInChildren(true)) - { - light.range *= 0.5f; - light.intensity *= 0.6f; - } - - // Anything that made the source a torch rather than a fire. - foreach (MonoBehaviour comp in headFlameVFX.GetComponentsInChildren(true)) - { - Destroy(comp); - } - foreach (Collider col in headFlameVFX.GetComponentsInChildren(true)) - { - Destroy(col); - } - } - - if (!headFlameVFX.activeSelf) headFlameVFX.SetActive(true); - - // Follows the skull without inheriting its scale. - if (headFlameBone != null) - { - headFlameVFX.transform.position = headFlameBone.position + Vector3.up * HeadFlameHeight; - } - } - private void EnsureFireAuraVFX(bool enable) { if (enable && Player.m_localPlayer != null) diff --git a/JotunnModStub/Skeleton/SkeletonVisuals.cs b/JotunnModStub/Skeleton/SkeletonVisuals.cs new file mode 100644 index 0000000..75f9e7e --- /dev/null +++ b/JotunnModStub/Skeleton/SkeletonVisuals.cs @@ -0,0 +1,150 @@ +using Jotunn.Managers; +using UnityEngine; + +namespace RacesOfValheim +{ + /// + /// The Skeleton's cosmetics that any client can grow for itself. + /// + /// The head flame started life inside SkeletonRace, which is a single MonoBehaviour that only + /// ever looks at Player.m_localPlayer - so the fire existed on one client, on one player, and + /// everyone else saw a bare skull. Same shape of bug as the Draugh's aura, and the same fix: + /// the build takes a Player, and each client grows a copy for every skeleton it can see. + /// + /// Nothing here is networked and nothing needs to be. The tier is already on the ZDO, so every + /// client can work out for itself whether a given skeleton should be alight. + /// + public static class SkeletonVisuals + { + // Fire sources in preference order. The torch is an item every world has; the ground + // torch and the fire pit are the building pieces to fall back on. + private static readonly string[] FlameSourcePrefabs = + { + "Torch", "piece_groundtorch_wood", "piece_groundtorch", "fire_pit" + }; + + private static GameObject cachedFlameSource; + private static bool flameSourceResolved; + + /// + /// Finds a vanilla prefab that carries real fire particles. Resolved once per session, + /// failure included, so a miss cannot turn into a per-frame log. + /// + private static GameObject ResolveFlameSource() + { + if (flameSourceResolved) return cachedFlameSource; + flameSourceResolved = true; + + foreach (string name in FlameSourcePrefabs) + { + GameObject prefab = PrefabManager.Cache.GetPrefab(name); + if (prefab == null) continue; + if (prefab.GetComponentsInChildren(true).Length == 0) continue; + + Jotunn.Logger.LogInfo($"[Skeleton] Head flame source resolved to '{name}'."); + cachedFlameSource = prefab; + return cachedFlameSource; + } + + Jotunn.Logger.LogWarning( + "[Skeleton] No fire prefab resolved (" + string.Join(", ", FlameSourcePrefabs) + + "); the skull stays unlit."); + return null; + } + + /// + /// One player's burning skull. Cosmetic only - it deals nothing and blocks nothing. + /// + /// Held per player rather than statically: a static would hand the second skeleton in view + /// the first one's fire. Call Apply every frame; it builds once and then only follows. + /// + public class HeadFlame + { + // Above the head bone's own origin, which sits at the base of the skull. + private const float Height = 0.18f; + + // Torch flames are authored for a fist-sized fire on a stick, so the skull wears a big + // multiple of one. + private const float Scale = 1.8f; + + private GameObject m_instance; + private Transform m_headBone; + + public void Apply(Player player, bool enable) + { + if (!enable) + { + if (m_instance != null && m_instance.activeSelf) m_instance.SetActive(false); + return; + } + + if (player == null) return; + + if (m_instance == null && !Build(player)) return; + + if (!m_instance.activeSelf) m_instance.SetActive(true); + + // Follows the skull without inheriting its scale. + if (m_headBone != null) + { + m_instance.transform.position = m_headBone.position + Vector3.up * Height; + } + } + + /// Returns false while the pieces it needs are not ready yet. + private bool Build(Player player) + { + Animator anim = player.GetComponentInChildren(); + m_headBone = anim != null ? anim.GetBoneTransform(HumanBodyBones.Head) : null; + if (m_headBone == null) return false; // rig not up yet; try again next frame + + GameObject source = ResolveFlameSource(); + if (source == null) return false; // already logged once by the resolver + + // Deliberately not parented to the head bone: the player rig is authored at + // roughly 100x, and a particle system inheriting that would put a bonfire where a + // candle belongs. It hangs off the player and is moved onto the bone each frame. + m_instance = new GameObject("SkeletonHeadFlameVFX"); + m_instance.transform.SetParent(player.transform, false); + m_instance.transform.localScale = Vector3.one * Scale; + + // Real fire is cloned rather than built by hand. The first attempt at this made a + // particle system from scratch on the smoke material, and a hand-rolled gradient + // over a smoke sprite reads as a wisp, not a burning skull. + foreach (ParticleSystem ps in source.GetComponentsInChildren(true)) + { + GameObject copy = Object.Instantiate(ps.gameObject, m_instance.transform); + copy.name = ps.gameObject.name; + copy.transform.localPosition = Vector3.zero; + copy.transform.localRotation = Quaternion.identity; + copy.SetActive(true); + + // So the holder's scale actually enlarges the fire rather than just spreading + // out where the particles spawn. + ParticleSystem.MainModule main = copy.GetComponent().main; + main.scalingMode = ParticleSystemScalingMode.Hierarchy; + } + + // A torch's own light is tuned to light a corridor from waist height; on a head it + // blows out the whole face. Keep the glow, lose the floodlight. + foreach (Light light in m_instance.GetComponentsInChildren(true)) + { + light.range *= 0.5f; + light.intensity *= 0.6f; + } + + // Anything that made the source a torch rather than a fire. + foreach (MonoBehaviour comp in m_instance.GetComponentsInChildren(true)) + { + Object.Destroy(comp); + } + foreach (Collider col in m_instance.GetComponentsInChildren(true)) + { + Object.Destroy(col); + } + + return true; + } + } + } +} diff --git a/JotunnModStub/ZdoVisualSync.cs b/JotunnModStub/ZdoVisualSync.cs index 87039f2..6a8e688 100644 --- a/JotunnModStub/ZdoVisualSync.cs +++ b/JotunnModStub/ZdoVisualSync.cs @@ -40,6 +40,7 @@ namespace RacesOfValheim private GameObject m_currentFormInstance = null; private GameObject m_fireAuraVFX = null; private GameObject m_draughAuraVFX = null; + private readonly SkeletonVisuals.HeadFlame m_skeletonHeadFlame = new SkeletonVisuals.HeadFlame(); private float m_lastFlightLog = 0f; private void Awake() @@ -148,27 +149,25 @@ namespace RacesOfValheim } } - // Hide Jaw for Charred Twitcher + // Fader used to collapse this bone here too, for the charred twitcher it wore at + // that tier. That model is gone and the skeleton in its place has a jaw of its + // own, so this is only a restore now - the same as the local path. Without it, + // other players would still see a Fader with no mandible. if (vis.m_bodyModel != null && vis.m_bodyModel.bones != null) { foreach (Transform bone in vis.m_bodyModel.bones) { - if (bone != null && bone.name.ToLower().Contains("jaw")) - { - if (state >= 8) - { - if (bone.localScale != Vector3.zero) bone.localScale = Vector3.zero; - } - else - { - if (bone.localScale == Vector3.zero) bone.localScale = Vector3.one; - } - break; - } + if (bone == null || !bone.name.ToLower().Contains("jaw")) continue; + if (bone.localScale == Vector3.zero) bone.localScale = Vector3.one; + break; } } } + // The burning skull, grown locally for whoever we are looking at. The tier is on the + // ZDO, so this client can work out for itself whether they should be alight. + m_skeletonHeadFlame.Apply(m_player, rules.ModelPrefab == SkeletonProgression.FireModel); + // Apply Scale Vector3 targetScale = rules.ScaleMultiplier; if (m_player.transform.localScale != targetScale) @@ -269,6 +268,7 @@ namespace RacesOfValheim if (m_currentFormInstance != null) Destroy(m_currentFormInstance); EnsureFireAuraVFX(false); DraughVisuals.EnsureAura(m_player, false, ref m_draughAuraVFX); + m_skeletonHeadFlame.Apply(m_player, false); // Takes the crown off a Trenta who has died or changed race; a no-op for everyone else. TrentaVisuals.ApplyCrown(m_player); From ece767de4915aa9ae486cde331f01e983e15899c Mon Sep 17 00:00:00 2001 From: kanym Date: Wed, 5 Aug 2026 18:32:11 +0200 Subject: [PATCH 10/11] chore(release): 1.3.12 Both manifests and the plugin version. The changelog is written at merge, as always, so the README is untouched here. --- JotunnModStub/Package/manifest.json | 2 +- JotunnModStub/RacesOfValheim.cs | 2 +- manifest.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/JotunnModStub/Package/manifest.json b/JotunnModStub/Package/manifest.json index 7db7025..2ea7b24 100644 --- a/JotunnModStub/Package/manifest.json +++ b/JotunnModStub/Package/manifest.json @@ -1,7 +1,7 @@ { "name": "RacesOfValheim", "description": "A Valheim mod that adds nine custom playable races (Aswid, Draugh, Dvergar, Fenrir, Furling, Skadi, Skeleton, Trenta, Trol) each with unique abilities, traits, and a deep boss-driven progression system.", - "version_number": "1.3.11", + "version_number": "1.3.12", "website_url": "", "dependencies": [ "denikson-BepInExPack_Valheim-5.4.2333", diff --git a/JotunnModStub/RacesOfValheim.cs b/JotunnModStub/RacesOfValheim.cs index fc537f0..c1bf198 100644 --- a/JotunnModStub/RacesOfValheim.cs +++ b/JotunnModStub/RacesOfValheim.cs @@ -15,7 +15,7 @@ namespace RacesOfValheim { public const string PluginGUID = "com.nandor.racesofvalheim"; public const string PluginName = "Races Of Valheim"; - public const string PluginVersion = "1.3.11"; + public const string PluginVersion = "1.3.12"; private readonly Harmony harmony = new Harmony(PluginGUID); diff --git a/manifest.json b/manifest.json index 7db7025..2ea7b24 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "RacesOfValheim", "description": "A Valheim mod that adds nine custom playable races (Aswid, Draugh, Dvergar, Fenrir, Furling, Skadi, Skeleton, Trenta, Trol) each with unique abilities, traits, and a deep boss-driven progression system.", - "version_number": "1.3.11", + "version_number": "1.3.12", "website_url": "", "dependencies": [ "denikson-BepInExPack_Valheim-5.4.2333", From 13a2b0548d485264c86a61812e7ad7fff45fc317 Mon Sep 17 00:00:00 2001 From: kanym Date: Wed, 5 Aug 2026 18:38:23 +0200 Subject: [PATCH 11/11] docs(readme): changelog for 1.3.12 Skadi flight, the Fenrir body, the Trenta crown, the Draugh rot in multiplayer, and the Skeleton progression. Build and packaging changes are left out - the changelog is written for players. --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 323bdc6..10a993b 100644 --- a/README.md +++ b/README.md @@ -181,6 +181,20 @@ Please write to us on my Discord server: **https://discord.gg/gbBEK2VTE** ## Changelog +**v1.3.12** +- **Skadi**: Dragon flight reworked. The stasis that holds a form level after you stop powering now lasts 5 seconds instead of 2. Hold Shift with W to spend 15 stamina a second on a burst of speed - the only part of flight that costs anything, since the drake arrives at The Elder long before you could pay just to stay airborne, and running dry drops you back to normal speed rather than out of the sky. S beats backwards along your aim, pitch included: look down and press it to rise away from whatever you are watching, without turning to face away from it. +- **Skadi**: Water is no longer a trap. A flying form beats its way back out of the sea instead of paddling on the surface until it finds land. Valheim hands a swimming character to its swimming code before it ever asks whether they are flying, which is why the Aswid's bat could always take off from water and Moder never could. +- **Fenrir**: The human body no longer stands inside the wolf. Every form hid you by shrinking your body to nothing, and the reset that keeps a non-Trol player at normal size put it straight back a frame later. Wolf, Ulv, Fenring and Cultist are all fixed, and so is the copy other players see. +- **Trenta**: A crown of horns and dead branches now grows from your head - a greydwarf shaman's, sunk into the skull until only the branches clear it. +- **Draugh**: The rot is visible to everyone. The drifting smoke and the cloud of flies only ever existed on your own screen, so in multiplayer every other player saw an ordinary, unrotted Viking. +- **Skeleton**: The progression finally does what its description says. Poison immunity arrived at Bonemass instead of Eikthyr, auto-stun at The Queen instead of The Elder, and lifesteal jumped 20/30/40% where the list promises a climb in fives from 5% to 35%. Every tier now matches, boss for boss. +- **Skeleton**: Poison immunity - and the physical resistances alongside it - never survived a death or a login. Undead Fortitude was applied once, the moment you picked the race from the menu, and status effects are not saved with a character, so from your next respawn onward you had none of it. It is kept on you now, and a boss killed mid-session takes effect immediately instead of waiting for a respawn. +- **Skeleton**: Max health is exactly what the tier promises. A Skeleton cannot eat, so the race feeds you three permanent invisible meals to carry the bonus - good for keeping regeneration alive, bad for landing an exact number, and a Bonemass Skeleton could find itself at 95 health where the table promises 165. The meals stay; the total no longer depends on them. +- **Skeleton**: The Moder regeneration bonus now applies at all. +- **Skeleton**: Skeleton Secrets unfolds tier by tier with the real numbers, instead of the same "will be revealed soon" line at every standing. It opens by naming the standing you are on, so when a boss falls and nothing seems to change you can tell at a glance whether the tier failed to advance or the unlock failed to fire. +- **Skeleton**: From Moder on you wear Hildir's bones with your skull alight, and the flames are visible to other players. At Fader you stand 15% taller. +- **Skeleton**: Fader no longer loses its lower jaw, and returning to Human no longer leaves you with a burning skull and an invisible one. + **v1.3.11** - **NEW RACE - Trenta**: Added the ninth playable race, the Trenta. Tree-born folk, kin to root and leaf: green-skinned, fed on what grows, and digesting it twice as slowly as anyone else. Stand still in daylight and you put down roots, healing and standing up Rested. The forest does not see you as prey - greylings, greydwarves, fulings, trolls, leeches and deathsquitos leave you alone from the very first tier. Later comes healing pollen that poisons whatever fights you, a portal home that ignores the ore restriction, a nest of hornets that stings anything that comes near, and finally The Elder's own shape. Full progression across all 8 tiers - see Trenta Progression above. - **Dvergur is now the Dvergar**: The race has been renamed. Characters created as a Dvergur are migrated automatically on your next spawn - you keep your race, your tier and your progress, and nothing needs re-picking.