Commit graph

56 commits

Author SHA1 Message Date
f3d3c0ebb5 feat: new looks for the Race Menu Ward, Contract Bank and Bone Servant tables
Recolour and kitbash from vanilla parts, no new assets. PieceLook copies
materials before tinting so vanilla pieces keep their colours. ModelBorrow
gains activeOnly, which drops hidden snow, fire and broken meshes before
a borrowed piece is measured.
2026-10-28 12:40:33 +01:00
5b3b2ac88d refactor(eyes): bake the tuned eye corrections in, drop the sliders
The Eyes Position sections were a tuning tool. Their per-body, per-eye values
from playtest now live in RaceEyeTuning as constants, so every player gets
the tuned faces and Configuration Manager loses four sections. The Aswid -
Eyes section stays for now.
2026-10-27 17:46:36 +01:00
132d7e034f feat(eyes): per-eye sliders, Aswid female defaults from playtest
Each Eyes Position section now has a set per body and per eye (the
character's own left and right), because the face is not symmetric enough for
one set to fit both eyes. The Aswid female defaults are the per-eye values
dialled in on screen; Alfar and Dvergar copy their female values to both eyes.
The old shared keys are dropped: they only ever existed in test builds.
2026-10-27 16:03:24 +01:00
8b2b5180ed feat(eyes): per-race eye position sliders in Configuration Manager
One 'Eyes Position - <race>' section each for the Alfar, Aswid, Dvergar and
Sverm, with a female and a male set: forward, height, separation and size,
plus rotation X/Y/Z for the Alfar and Aswid. All are deltas on the computed
placement (0 and size 1 change nothing), read live, and left local by
ConfigSync because they only change how this client draws faces.
2026-10-27 15:21:19 +01:00
a7e9996441 fix(eyes): lower female eyes further, push Alfar/Dvergar out, enlarge Aswid points
Playtest on female characters: every race's eyes still sat about an eye-height
above the painted ones. Female height shift goes from -6 to -14 mm. Alfar and
Dvergar centres move 4 mm forward out of the face, and the Aswid socket goes
from 0.5 to 0.75 of the borrowed size so it covers the painted eye.
2026-10-27 15:15:10 +01:00
026def2fde fix(eyes): female face placement, smaller Dvergar/Aswid eyes, grey Alfar eyes
The female body maps the painted eyes about 6 mm lower and a quarter closer
together than the male one (read from bodymale/bodyfem and the skin UVs), so
every race's male-tuned eyes sat on the female brow. PlayerFace moves them for
the Dvergar, Aswid, Sverm and Alfar.

Dvergar eyes shrink to an 18 mm radius. The Aswid's borrowed sockets are
halved before the config multiplier and the smoke is off by default.

Alfar eyes become slanted, wrapped black almonds with a wet sheen. They are
placed in fixed head-local units: the live lossyScale under the non-uniform
Alfar body drifted as the head turned, and the 0.5 s cosmetic pass made the
eyes trail the face.
2026-10-27 15:01:44 +01:00
32c49a8af0 fix(dvergar): build pieces accept the smithing discount
The build menu showed the discounted metal cost, but Player.HaveRequirements(Piece)
read m_amount directly, so placing a piece still needed the full vanilla amount.
It now goes through GetAmount like the rest of the cost path.

Piece.DropResources also read m_amount, which would have refunded 10 tin for a
cauldron that cost 6. A piece placed by a Dvergar now stores the discount paid,
and dismantling it drops that amount.
2026-10-19 14:20:28 +02:00
916ba5bd6f fix(pieces): placement ghost vanished off terrain for most stations
Eleven pieces set m_groundPiece. Player.UpdatePlacementGhost switches
the ghost off outright and returns whenever the aim is not on a
Heightmap, which vanilla means for hoe and cultivator pieces. Floors,
rocks and a troll cave's mesh floor are not a Heightmap, so players
saw no ghost at all there, and with either flag Valheim never shows
the blue placement marker. Reported for the Trol War Totem.

m_groundPiece is off everywhere now. The stations (War Totem, Cursed
Body Pile, Dvergar Bank, Rune Barrel, Pack Trough, Skadi Golem, Bone
Servants) drop m_groundOnly too and go on floors, foundations and in
caves, like the Bone Pile since 1.5.8. The living pieces (Furling
bushes, Sverm nest and Hive Market, Trenta Elder Root) keep
m_groundOnly: terrain only, and the ghost shows red elsewhere.
2026-10-17 15:59:08 +02:00
87d0f2642c fix(texts): four messages showed as [msg_...]
Four tokens the mod printed exist in no vanilla table (checked on
Valheim 1.0.20) and were never registered by the mod, so players saw
the raw name in brackets.

- $msg_eatanother (Trol, a food still being digested): vanilla's
  $msg_nomore, "You can't eat more $1", called as Player.CanEat calls it.
- $msg_canteatanymore (Trol, every stomach full): vanilla's $msg_isfull.
- $msg_ate (Aswid, Vae Victis): vanilla's $msg_consumed.
- $msg_notenoughmoney (Dvergar bank, Trol totem): a new mod text,
  rov_msg_not_enough_coins, in English, Italian and Russian.
2026-10-17 15:51:53 +02:00
5910c4f746 feat(text): the race compendium comes from translation files
Every paragraph of the compendium pages now reads from compendium.json.
Values computed from the config become $1, $2; the Sverm fire clause, which
had two wordings folded into one sentence, is two sentences. The pages'
titles are tokens that the game's Texts dialog localizes, and since those
titles are also the pages' keys in the saved m_knownTexts, the refresh
clears the old English keys too. Boss names use the game's tokens.

Song titles and quotes stay in the original, in every language.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 19:03:59 +02:00
1bd09ed31d feat(text): merchants, troops and the hive's shelf come from translation files
The faction merchants' 90 jokes, their generic lines and their names now
read from merchants.json. Merchant names use the game's own creature
tokens where one matches, so they arrive translated in every language
Valheim ships; the Dverg keeps a key of its own, since vanilla's token
reads "Dvergr Rogue".

The Dvergar and Trol troop names and terms, and the Sverm hive's goods,
refusals, stage names and brood kinds, follow. Their panels fill TMP texts
themselves, so they localize the names where they draw them.

The jokes have English text only for now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 18:50:54 +02:00
99a1817eb0 feat(text): hover texts come from translation files
What the stations, thralls, the ward and the hive show under the
crosshair now reads its text through ModText.Get, and hover.json holds
50 texts in English and Italian.

The Aswid thralls and the Race Menu Ward wrote the use key as a literal
E; they now use $KEY_Use, which shows the key the player actually bound.
For that to work, ModText.Get runs a second localization pass when a $
is left in the result: Valheim resolves tokens once and never looks
inside what it inserted, and hover texts go to the HUD without another
pass.

The Sverm hive stage names stay English for now: the compendium and the
hive's goods show them too, and those come with the merchants step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 13:55:14 +02:00
b0d18b0654 feat(text): on-screen messages come from translation files
Every message the mod puts in the middle or corner of the screen now reads
its text through ModText.Get, and messages.json holds 191 texts in English
and Italian. Values computed in code become $1, $2 in the text, so a
translator can put them wherever the sentence needs them. Branching
messages get one key per branch.

A few messages travel through a field before they are shown: thralls'
refusals and the building limits now hold a token or key there. Boss and
form names inside messages use tokens too, the bosses the game's own, so
"The Elder" arrives translated.

ModText.Get now localizes each argument before inserting it. A token
argument left for a later pass ran into the text after it: "$1's power"
became the unknown token "enemy_eikthyr's".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 20:30:03 +02:00
b177c89c71 feat(text): item, piece and creature names come from translation files
The mod's own items, build pieces and summoned creatures now carry
$rov_item_, $rov_piece_ and $rov_creature_ tokens for their names and
descriptions, and items.json holds the texts in English and Italian.
Valheim localizes these fields wherever it shows them: tooltips, hover
texts, messages, the build menu.

Where a name doubles as an identifier, both sides use the same constant,
so the comparisons still hold. The Aswid foods keep their prefix as a
constant for the refinery's check and now name the creature with its
vanilla token, so "Boar" translates too. The Furling crops get one whole
description per crop instead of an English sentence with the metal dropped
in. The Race Menu Ward's panel title is a mod UI Text, so it reads the
translation directly.

Saves are unaffected: items and eaten foods are stored by prefab name.
The Sverm hive's goods stay for the merchant step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 19:58:53 +02:00
9bf144aedc feat(text): status effect names and tooltips come from translation files
Every status effect the mod registers now carries a $rov_se_ token instead
of English, and status_effects.json holds the texts in English and Italian.
Valheim localizes both fields itself when it shows them. The blood
potion's tooltip has numbers in it, so SE_BloodPotion fills its $1 and $2
in GetTooltipString, at display time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 19:51:10 +02:00
Ferdinando
5f74c57e72 fix: race buildings keep their own message when an item is used on them
Humanoid.UseItem shows the generic $msg_cantuseon whenever the
interactable's UseItem returns false, covering the refusal message the
building had just shown. Same fix as the Trol totem in v1.4.18, applied
to the Servant table, Dvergar barrel and bank, Fenrir trough, Draugr and
Skeleton piles, Blood Refinery, Grove and Composter: an item in hand
always counts as handled. Empty-handed interactions are unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-18 17:13:16 +02:00
Ferdinando
c7cbd6bece chore(release): v1.4.18 - Valheim hotfix flight fix, 1.0 shop fixes, Fenrir speed
Drake flight resolves ZInput.GetJoyLeftStickY at runtime, since the
hotfix dropped its bool parameter. Faction merchant TradeItems now set
the 1.0 fields StoreGui dereferences (m_tooltip, m_buyPlayerEffects),
and the Dvergar trader discount clones the whole TradeItem instead of
rebuilding four fields. Trol totem refusals return true so vanilla's
$msg_cantuseon no longer covers them. The Fenrir curse speed modifier
is the bonus alone (SE_Stats adds it), not 1 + bonus. New Discord link.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-18 17:10:24 +02:00
Ferdinando
6193b3ee2d 1.0 compatibility 2026-09-10 18:05:24 +02:00
c2212df322 Merge branch 'war-vulture' into main
Brings in v1.4.3-v1.4.5 work: Trol's Hammer, Bone Servants, War Vulture
craftability, and the Aswid/Fenrir timed-claws rework, on top of the
bugfixes merged into main since v1.4.2.

Resolved conflicts in 7 files where main's post-v1.4.2 fixes overlapped
war-vulture's claws rework:
- README.md, manifest.json: took war-vulture's v1.4.5 content (main
  hadn't touched either since the v1.4.2 release).
- RacesOfValheim.cs: plugin version -> 1.4.5.
- RaceClaws.cs: kept war-vulture's lazy EnsureRoster() fix for the
  Fenrir claw-registration bug over main's belt-and-suspenders
  Register(this), and dropped the now-stale comment referencing the
  removed static constructor. Main's SetupDragItem race-ownership fix
  carried through untouched.
- AswidConfig.cs/AswidRace.cs/AswidPatches.cs: adopted war-vulture's
  single-key design (I toggles both Vampiric Aura and Devour together)
  to match the documented v1.4.5 trader-safety fix, removing a duplicate
  AuraEnabled field the two branches had each declared independently.
  Kept main's IsDownIgnoringHeldKeys() input fix on top.
- RaceCompendium.cs: kept main's fact-checked Aswid/Fenrir entries
  (war-vulture's copies were pre-fix stubs, one referencing a
  nonexistent variable) and layered in war-vulture's timed-claws
  wording.

Build verified clean (0 errors) after resolution.
2026-08-18 17:36:42 +02:00
Ferdinando
0aa1dc4dc8 warvulture 2026-08-16 07:44:44 +02:00
3f09c7cf3f fix(visuals): measure the skull's facing from the bind pose, for all three clawed races
The eye frame was read from the head bone's pose ON THE FRAME THE EYES
WERE BUILT, snapped to the nearest axis, then cached for the life of the
eyes. Catch the head a few degrees into a turn and the snap picks the
neighbouring axis, and the pair stays wrong until something rebuilds it.

Each race met this separately and each added the same guard - do not
build while attached, mid-attack or asleep - which caught the loud cases
and left the quiet one: a race change rebuilds while the rig is still
settling, which is none of those three. That is why resetting into a
race could break the placement while logging out and back in silently
fixed it. The logout was never a fix, only a rebuild at a calmer moment,
and no fourth guard condition would have closed it - the read itself had
to stop depending on when it happens.

sharedMesh.bindposes[headBone] is the rig as authored: no animation in
it, no timing, the same answer on frame one and frame ten thousand. A
rebuild is now deterministic and a bad moment cannot exist. Falls back to
the live read, warning once, on a rig that carries no bind pose.

Lives in one shared RigBindPose rather than in three copies. The three
eye implementations are separate files by design - they differ in what
they hang and how it is coloured - but this is the one piece of maths
where a divergence would be a bug in whichever copy got fixed second,
and it had already been fixed twice. The three now-dead private
SnapToAxis copies go with it.

Also updates the Aswid eye defaults to the values dialled in on screen:
forward 0.013, height 0.004, yaw 22.068.
2026-08-12 17:33:46 +02:00
26bfd339e8 fix(visuals): stop the glow eyes from occasionally landing behind the skull
AswidVisuals/DvergarVisuals measure which way the head bone faces
exactly once, the first time BuildEyes runs for a given character, by
reading the bone's live pose at that instant and snapping it to the
nearest axis - then cache the result for as long as the eyes exist.
Taken while sitting, attached, mid-attack or asleep, the head can be
turned away from the body's own forward, and the snap picks whichever
axis is closest to that pose - landing the eyes behind the skull
instead of on the face, and staying wrong for the rest of the session.

ApplyEyes now defers the first build while the player is attached,
attached to a ship, mid-attack or asleep, since it runs again on every
subsequent UpdateColors anyway. Reduces the obvious bad-timing cases;
does not by itself rule out a mistimed read during ordinary idle
animation, which would need the measurement moved to the model's bind
pose (animation-independent) to close out completely.

Also shrinks the Aswid's eyes by 10% (EyeSize 0.062 -> 0.0558), per
request.

Confirmed improved by playtest.
2026-08-09 16:48:35 +02:00
25795a05e9 fix(input): abilities no longer die while a movement key is held
BepInEx's KeyboardShortcut.IsDown() ends in ModifierKeyTest, which
requires that no key outside the shortcut is currently held - it only
exempts the mouse buttons. That is right for a config-menu hotkey and
wrong for a game ability: holding W (or any other movement key) made
every bound ability in the mod stop responding, for every race, mouse
bindings included. Vanilla attacks kept working because they go
through ZInput, which is what made it look like a Skadi/dragon bug.

Adds RaceInput.IsDownIgnoringHeldKeys / IsPressedIgnoringHeldKeys -
main key down plus every modifier held, without the blocking rule -
and switches all 27 call sites across Aswid, Dvergar, Fenrir, Skadi,
Trenta and Trol over to them.

Arrived with the rebindable-keybind work that shipped in 1.4.0.
2026-08-09 12:33:41 +02:00
Ferdinando
5c5b8c34d2 feat(races): Skadi hollow chain, plus the pending Dvergar and Fenrir ones
Three per-race item chains had accumulated uncommitted. They land
together because FactionMerchantCatalog.cs carries hunks from all
three and cannot be split without interactive staging.

Skadi (new this session):
- SkadiNokkel - "Skadis Nokkel", a StaffSkeleton clone recoloured to
  ice, stripped of its eitr and health costs and of the skeleton
  summon, opening an ice-blue portal to a troll cave the player
  claims as their own. Crafted at the forge after Moder from a
  1500-coin Greater Frost Heart, a DragonTear and a TrophySkeleton.
- SkadiFrostHeart - the bought leg of that recipe, sold by the
  Cultist bench.
- SkadiHollow / SkadiHollowPortal - claims one existing TrollCave02
  in the Black Forest, half a world radius out and south of the
  equator, and opens a linked local portal pair to it.
- RaceCaveBuilding - Skadi and Trol may build inside any troll cave.

Two facts worth keeping, both paid for the hard way:
- a troll cave counts as a DUNGEON, so the flag that refuses a piece
  there is the per-piece Piece.m_allowedInDungeons, not the
  per-location Location.m_noBuild. Player.m_placementStatus names the
  exact refusal reason and is now logged.
- Object.DestroyImmediate is forbidden inside an animation event
  callback, and a staff cast runs in one - it fails silently there.

Also carried in, from earlier sessions and unverified in game:
- Dvergar contract bank and barrel (DvergarBanco*, DvergarBotte*)
- Fenrir Ulvsblod trough (FenrirMangiatoia*)
- the Wolf -> Ulv merchant bench move, so tameable wolves stop
  answering the E key with a shop window

Status: compiles clean with no new warnings. The Skadi chain has NOT
been confirmed working in game - the most recent fix to the troll
cave detection is still untested.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-08 14:58:43 +02:00
3607d7323d feat(dvergar): make ability numbers and keybinds BepInEx-configurable
Adds DvergarConfigManagement.cs rather than reusing the DvergarConfig
name: that existing class is a different kind of thing - identity
constants that must never change (renaming RaceId would orphan saved
characters), hand-tuned cosmetic placement numbers (eye/hood position),
and per-tier tables (health malus, smithing/trader discounts) left alone
under the same boundary drawn for every other race's progression table.

Only the genuine ability knobs move: Runic Ping and Runic Overcharge
(cost, radius, duration, cooldown, marker light) each get a Configuration
Manager section, plus mining and weapon-affinity percentages under
Passive Combat, plus the two keybinds. DvergarConfig's fields for those
now forward to DvergarConfigManagement (same const-to-property trick used
for Skadi), so all 109 existing call sites across 11 files kept working
unchanged except the two keybind consumers (DvergarAbilities,
RaceCompendium's in-game ability text), which now read the live
configured key so a rebind stays reflected everywhere it's shown.

Weapon-affinity DamagePercent/StaminaPercent are overridden with the live
config value inside DvergarProgression.GetRules rather than baked into
the static WeaponAffinities array, since that array evaluates at
class-load time - before RacesOfValheim.Awake() calls Bind - and would
risk a null-reference on the ConfigEntry.

Config sections stay bound alphabetically by race (Aswid, Draugh,
Dvergar, Skadi) in RacesOfValheim.Awake().
2026-08-06 13:56:00 +02:00
c3c8494137 style(dvergar): dim the eyes to 0.3
Applies to all three tiers, so the base teal, the one-star cyan and the two-star magenta come down together and keep their relative brightness.
2026-08-05 22:02:07 +02:00
ef8fae888a style(dvergar): shrink the model's left eye on its own
The pair is placed symmetrically and does not come out symmetrical, because the face is not flat: near the midline the skull juts forward, near the temple it falls away, and a 24mm ball spanning that curve shows more of itself on the receding side.

Rather than shrink both and give back the socket depth just gained, the eye that comes out proud is taken to 0.85 on its own. If the wrong one shrinks, the sideways axis resolved the other way round and the multiplier belongs on the other index - which is written down where it is applied.
2026-08-05 21:59:26 +02:00
e6bf266eea fix(dvergar): derive the sideways axis so both eyes sit at the same depth
One eye reading correctly while the other creeps up the forehead is what an out-of-square frame looks like. The three axes were each rounded to the nearest one independently, which guarantees nothing about the angles between them - and a right that shares an axis with forward is no longer sideways, so the separation pushes one eye out of the face and pulls the other into it.

Right is now a cross product of the other two, which cannot be anything but perpendicular to both. Symmetric by construction rather than by luck of the pose the head was in when the eyes were built.
2026-08-05 21:54:26 +02:00
e3ade9aa63 style(dvergar): sink the eyes a centimetre, drop them, and dim to half
A centimetre deeper is a centimetre more radius. The ball cleared the face by 2mm at a 15mm radius, so moving the centre in on its own would have buried it - growing the radius to 24mm lets the centre sit at 63mm and still reach through. Same size of eye, deeper socket, flatter cap.

Down about 15mm as well, and the glow scaled to 0.5 across all three tiers.
2026-08-05 21:50:46 +02:00
dae1f96852 style(dvergar): sink the eyes slightly and take the glare off them
EyeForward 0.096 to 0.094, which sounds like nothing and is not: at this radius the ball clears the face by 4mm and shows a 20mm eye, and 2mm of clearance shows about 16mm. 0.090 would bury it outright, so depth is a fine adjustment here rather than a coarse one.

Glow scaled to 0.65 as well. The colours are the game's own HDR values - one star is (0, 4, 3.3) - and everything past 1 clips to white before the bloom pass, which is why the centres read as white lamps instead of teal ones. Dimming them brings the colour back as much as it lowers the brightness.
2026-08-05 21:47:41 +02:00
bd27bd8fd4 chore(dvergar): retire the eye trace and the shader survey
Both were built to answer questions and both answered them: the trace found the camera anchor sitting half a metre above the head bone, the counter-rotating axes, and the tilt that put the eyes at the jaw; the survey established that Custom/Player carries no desaturation control and never will make a pale Dvergar.

Neither belongs in a session log now that the answers are known, so the trace goes and the survey's finding stays as the comment that stops anyone re-deriving it. The one-line reports that remain are the ones a game update could invalidate - which glow shader resolved, and the star offsets read off the creature prefab.
2026-08-05 21:44:50 +02:00
aee34caafd style(dvergar): shrink the cap from most of a face to an eye
The buried-ball idea is right and the first sizing of it was not: a 30mm radius clearing the face by 9mm showed a 43mm cap.

Radius halved to 15mm and the centre pulled out to keep about 4mm of clearance, which gives roughly a 20mm eye. Halving the radius also halves how hard the cap reacts to a millimetre of depth, which matters more than the size itself - the big ball made every adjustment an overshoot.
2026-08-05 21:40:22 +02:00
fc608d677a feat(dvergar): make the eye a buried ball showing only its cap
Your idea, and a better shape for the problem than balancing a small sphere on the surface. A large ball centred well inside the skull breaks the face with a slice of itself, so the face bounds the glow, it cannot float off the cheek, and the visible size is set by how deep the centre sits rather than by the sphere alone.

Sized from the two depths already measured: visible at a centre of 82mm with an 8mm radius, gone at 74mm with the same, which puts the face surface around 85-90mm from the head bone. A 30mm radius centred at 65mm clears that by about a centimetre.
2026-08-05 21:37:43 +02:00
38ba444f64 style(dvergar): make the eyes bigger and round again
0.014 was 11mm across on a Dvergar, which buried enough of the sphere that the visible cap read as a flat decal rather than an eye. Up to 0.026, past the 0.020 it started at, so more of the ball stands clear of the skull and gets its roundness back.
2026-08-05 21:35:58 +02:00
db482ede87 style(dvergar): back to the deepest depth that still shows, and smaller eyes
0.067 buried them, so the floor at the eye line is now measured too: the usable band runs from just under 0.105 to about 0.140, and 0.105 is the far end of what reads as inset.

Depth being spent, the remaining lever is size. What reads as protruding in profile is mostly the bloom halo rather than the ball, and both scale together - so EyeSize drops from 0.020 to 0.014, which pulls the halo in and leaves less cap standing out without moving the centre back onto the cheek.
2026-08-05 21:31:09 +02:00
f4f575b181 style(dvergar): sink the eyes three centimetres
EyeForward 0.105 to 0.067, which is 3cm on a Dvergar.

This goes well past the depth that buried them before, but that reading was taken with the eyes 10cm lower and on tilted axes, so it does not necessarily describe the face at the eye line. If they vanish, the real floor at this height is now known and 0.105 is the way back.
2026-08-05 21:29:28 +02:00
8c004e3d7f style(dvergar): sink the eyes another centimetre
EyeForward 0.115 to 0.105, about a centimetre on a Dvergar. Agreed on the profile - they were still reading as sitting on the face rather than in it.

Also records the usable range, which is narrow: 0.095 buried them completely and 0.140 stood them off the skull, so the whole band is four centimetres and the eye is a two-centimetre ball. Most of it is meant to be inside.
2026-08-05 21:09:02 +02:00
376000da49 style(dvergar): sink the eyes into the sockets
EyeForward 0.140 to 0.115 - the axis is depth into the face, and 0.025 before the race scale is about the 2cm asked for on a Dvergar. In profile the glow was sitting off the front of the skull rather than in it.
2026-08-05 21:06:13 +02:00
e323530a58 style(dvergar): raise the eyes again, onto the painted ones
0.140 to 0.200 before the race scale - about five centimetres on a Dvergar, half again as much as the last nudge, since the glow was still sitting a full eye below the ones on the skin.
2026-08-05 21:04:06 +02:00
d752dba10d style(dvergar): raise the eyes to the eye line
They were sitting at cheekbone height. Up from 0.100 to 0.140 before the race scale, which is about three centimetres on a Dvergar.
2026-08-05 21:02:00 +02:00
7c9c1ca630 fix(dvergar): square the skull's axes so the eyes sit on the eye line
The trace showed the offsets arriving tilted: 0.109m of forward and 0.078m of up came out as 0.124 forward and 0.059 up, which is the jaw rather than the eyes. towardFace read 0.99, so the direction was never wrong - only leaning.

The axes are measured from whatever pose the head is in on the frame the eyes are built, and a head pitched a few degrees hands back a forward that leans down and an up that leans back. A bone's real axes are square, so the measurement is now rounded to the nearest one. The tilt was the pose at the moment of asking and nothing else.
2026-08-05 20:59:01 +02:00
196e413573 fix(dvergar): measure the skull's axes once, so the eyes turn with the head
The eyes were parented to the head bone and still ignored every head animation,
which should have been impossible - a child cannot refuse its parent's rotation.
It was not refusing it. It was being handed the exact opposite every frame.

The offsets were built from directions computed as
headBone.InverseTransformDirection(playerRoot.forward), and that was recomputed
on every placement. As the head turns, the same world direction expressed in the
head's local space rotates by exactly the negative of the head's rotation - so
the local offset counter-rotated and cancelled the animation out. The eyes rode
the head's position perfectly and its rotation not at all, which is exactly what
it looked like from the first screenshot onwards.

The axes are now measured once, at build time, while the head is still looking
where the body is, and kept on the eye holder. Fixed in the skull's frame, they
ride every animation for free - which was the whole point of parenting to the
bone in the first place.
2026-08-05 20:54:30 +02:00
e512dcfb93 fix(dvergar): push the eyes out to the surface of the face
Placement is right and the trace proves it - 0.095m from the head bone, exactly the offsets after the race scale, parented to Head and following it. They were simply still inside the skull, and the shader that resolved is depth-tested, so the head hid them completely.

The bone sits at the base of the skull and a face is further forward than it looks. Offsets raised to land about 0.109m out on a Dvergar. The trace now also reports how far up the eye ended up and whether it is on the face side of the head at all, so the next look distinguishes too shallow from the wrong direction entirely.
2026-08-05 20:51:11 +02:00
f93b57ceff fix(dvergar): stop measuring the eyes from the camera anchor
The trace found it. An eye sat at local (0, 0.0066, 0) on a bone with a scale of
78, which is 0.513m straight up - exactly the distance being reported from the
head. The offsets in play are 0.0007 local units, three orders of magnitude too
small to account for that, so the drift was never in them.

It was the origin. The previous version started from Character.m_eye on the
reasoning that it is the game's own answer to where a player's eyes are, and it
is not: it is where the camera goes, half a metre above the head bone. Everything
after that was correct arithmetic applied to the wrong point, which is why five
rounds of adjusting the offsets changed nothing.

Placement now starts at the head bone and nowhere else. The offsets return to
real distances for a face - forward to the surface of the skull, up from its base
- and the frame conversion is left alone, since the same trace proved it right:
0.0002 local units on a bone scaled 78 rendered as a 0.016m eye, exactly as
asked.
2026-08-05 20:47:17 +02:00
7651a07279 chore(dvergar): trace where the eyes actually are, not where they should be
The arithmetic puts them 7cm from the head bone and the screen puts them metres away, so the offsets are not the thing to keep adjusting. Traces position, parent, local and world transforms and the distance from the head, six times over the first few seconds - enough to tell a bad offset from an object that is not parented, or one that is parented and then moved.
2026-08-05 20:43:24 +02:00
c974977f64 fix(dvergar): hang the eyes on the bone the mesh is actually skinned to
A child transform cannot ignore its parent's rotation, so eyes that followed the
body but sat out every idle bob of the head were never parented to the head that
was moving. They were parented to the Animator avatar's HumanBodyBones.Head,
which on this rig is a transform that travels with the player and is not the one
the animation drives.

The rest of the mod has never used the avatar for this. The hood, the Skeleton's
body swap and the Furling's head all take the bone off
VisEquipment.m_bodyModel.bones - the array the skinned mesh deforms with, which
is by definition the rig that moves. The eyes do too now, with the avatar left as
a fallback only for the case where the body model is not up yet.

The one-shot log prints both candidates side by side and says whether they are
the same transform, so the next report confirms or kills this outright rather
than leaving it to inference.
2026-08-05 20:37:45 +02:00
e7d60f61ba fix(dvergar): measure where the eyes go instead of guessing at it
Three attempts have now placed these by picking a distance from a bone and hoping,
and all three landed somewhere wrong - above the head, on the camera, and inside
the skull. The distance was never the thing to fix.

Character.m_eye is the game's own answer to where a player's eyes are. Asking the
head bone to express that point in its local space gives an offset that is
correct by construction: no working out which way the bone points, no hand-picked
distance from the base of the skull, and because the result is local it rides
every head animation without being recomputed. The config offsets stay as small
nudges in metres on top of that, with EyeForward pushing out of the skull to the
surface of the face.

Also logs the bone name, its scale and the measured eye point once per session,
so the next round starts from numbers rather than from another guess.
2026-08-05 20:33:13 +02:00
8014986f0a fix(dvergar): socket the eyes into the head bone instead of following it
They were placed from the player root's axes every frame, which follows where the
body faces and knows nothing about where the head is looking - so an idle
animation turned the head and left the eyes behind, reading as attached to the
camera rather than to the face.

They are children of the head bone now, so position and rotation are inherited
and no longer computed. The reason that was avoided in the first place was not
knowing which way a rig bone points, and the answer turned out to be to stop
guessing: the body's forward and up, expressed in the head bone's local space,
are exactly the directions wanted, and because they are local they go on meaning
the same thing as the head turns. Measured once at build time, while the head is
still looking where the body is.

Scale is the only thing still asserted each frame, because it can change under
us. The bone carries the armature's hundredfold scale multiplied by whatever the
race renders at; dividing it out leaves the holder standing at exactly the race's
scale, which keeps the offsets underneath honest metres and keeps the eyes
shrinking with a Dvergar.
2026-08-05 20:28:01 +02:00
bb952ac4c2 fix(dvergar): make the eyes solid, so the camera angle stops deciding whether they exist
Two symptoms, one cause each, and both were choices from the first version.

Vanishing from certain angles: the eyes were quads. A quad has no thickness, so
seen edge-on it is a line and there is nothing to draw. Now spheres, which read
the same from every direction.

Drawing in front of the face, and visible from behind: the shader resolver was
asked for Sprites/Default first and got it. That is a transparent shader with
depth writing off and backface culling off - so the eyes drew over whatever was
in front of them and stayed visible through the back of the head. The resolver
now asks for an unlit opaque shader first, which the skull occludes like any
other solid thing.

Between them, an eye is now a small solid glowing ball in a face rather than a
sticker that only exists at some angles.
2026-08-05 20:20:53 +02:00
76b89a8e5a fix(dvergar): put the eyes on the head instead of on the camera
Both faults reported came from the same wrong anchor. Character.m_eye is the
camera's eye point, not the model's: it lives outside the scaled rig, so on a
Dvergar - who renders at 78% - the quads hung where a full-height human's face
would have been, a foot above the head. And it turns with the look direction
rather than with the face, so they pointed wherever the player was looking rather
than wherever the head was.

They now hang off the player root, unscaled, and are placed onto the head bone in
world space every frame: position from the bone, orientation from the player's
own facing, and every offset multiplied by the race's visual scale so they shrink
with the body. That also means the placement constants are honest metres measured
from the base of the skull, which is what makes them tunable at all.

Driven per frame from the two places that already tick a Dvergar - the race
script for the local player, the visual controller for remote ones - because
world-space placement has to be re-applied rather than inherited.
2026-08-05 20:14:08 +02:00