fix(aswid): land the borrowed eye sockets on the face, and make the sliders able to say so

Scale is inherited, so source.localScale could not come across either:
it is authored under a parent that puts the object at 0.02 lossy scale,
and re-parenting it under a head bone at ~95 drew the mesh some 4750x
too big - an eye the size of the character, centred near the face,
therefore mostly inside the skull with the corners reading as flat
rectangles. "Wrong place" and "blocky" were one scale error seen from
two angles. Carries lossyScale (the size the game actually draws it at
on a real skeleton) over the new parent's scale instead.

The remaining offset would not compute cleanly from either rig, so it
was dialled in on screen and written down as the new defaults rather
than guessed at again - size 1.1, forward 0.01, separation 0.007, yaw
24.664, roll -180 (the socket arrives upside down on a player's head
bone; that is the half turn that rights it).

The sliders that found those numbers could not have: they were bound at
+/-0.1 m and 0.1-5x, nowhere near far enough to pull the pair out of the
skull, so they read as doing nothing at all. Widened to +/-0.5 m and
0.01-50x.

Eye Rotation Y is now mirrored - the left eye takes the negative - so
the pair toes in or out together instead of both turning off the same
shoulder. X and Z stay shared on purpose: both eyes pitching up is a
face looking up, where mirroring pitch or roll would cross them.

Confirmed correct in game.
This commit is contained in:
kanym 2026-08-12 16:25:51 +02:00
commit cb69d3af3e
2 changed files with 86 additions and 26 deletions

View file

@ -242,28 +242,49 @@ namespace RacesOfValheim
new ConfigDescription("How bright the final-stage red burns - the single knob for it, since the hue is already pure. Expect a floor: below the bloom threshold the eyes stop glowing and become flat dots.",
new AcceptableValueRange<float>(0f, 3f), new ConfigurationManagerAttributes { Order = 87 }));
EyeSizeMultiplier = config.Bind(eyes, "Eye Size Multiplier", 1f,
new ConfigDescription("Scales both sockets. 1 is the size the source creature wears them at.",
new AcceptableValueRange<float>(0.1f, 5f), new ConfigurationManagerAttributes { Order = 80 }));
// ─── Ranges are deliberately wide ────────────────────────────────
// These started at +/-0.1 m and 0.1-5x, on the assumption that the borrowed sockets
// land close to right and only need nudging. They do not, and a slider that cannot
// reach the correct value is worse than no slider - it looks like the setting does not
// work. Wide enough to dig the pair out of the skull from any starting point, and to
// find the right size by eye when the source model's own scale does not transfer.
// Every one of these is live: the eye ticker reapplies them each frame, so a drag in
// Configuration Manager moves them while you watch.
EyeForwardOffset = config.Bind(eyes, "Eye Forward Offset", 0f,
new ConfigDescription("Moves both eyes out of (or into) the face. 0 leaves them where the source creature wears them.",
new AcceptableValueRange<float>(-0.1f, 0.1f), new ConfigurationManagerAttributes { Order = 70 }));
// ─── The defaults below were found in game, not derived ──────────
// The borrowed sockets do not arrive on the face by themselves: their authored pose
// and scale belong to the Skeleton's own rig and none of it transfers cleanly to a
// player armature (see AswidVisuals.BuildEyes for what does and does not carry over).
// Four attempts to compute the remainder each missed, so it was dialled in on screen
// instead and the answer written down here. That is what these seven numbers are - a
// measurement, not a taste. Treat them as the working baseline: a fresh install lands
// on a correct face, and the sliders are then free to be about taste again.
//
// The -180 on Z is the honest shape of it: the socket arrives upside down relative to
// the player's head bone, and this is the half turn that rights it.
EyeSizeMultiplier = config.Bind(eyes, "Eye Size Multiplier", 1.1f,
new ConfigDescription("Scales both sockets. 1 is the size the source creature wears them at.",
new AcceptableValueRange<float>(0.01f, 50f), new ConfigurationManagerAttributes { Order = 80 }));
EyeForwardOffset = config.Bind(eyes, "Eye Forward Offset", 0.01f,
new ConfigDescription("Moves both eyes out of (or into) the face, in metres. Positive is forward, out of the skull.",
new AcceptableValueRange<float>(-0.5f, 0.5f), new ConfigurationManagerAttributes { Order = 70 }));
EyeHeightOffset = config.Bind(eyes, "Eye Height Offset", 0f,
new ConfigDescription("Moves both eyes up or down the face.",
new AcceptableValueRange<float>(-0.1f, 0.1f), new ConfigurationManagerAttributes { Order = 69 }));
EyeSeparationOffset = config.Bind(eyes, "Eye Separation Offset", 0f,
new ConfigDescription("Pushes the two eyes apart (or together). Each moves away from the centre of the face, so this is half the change in the gap.",
new AcceptableValueRange<float>(-0.1f, 0.1f), new ConfigurationManagerAttributes { Order = 68 }));
new ConfigDescription("Moves both eyes up or down the face, in metres. Positive is up.",
new AcceptableValueRange<float>(-0.5f, 0.5f), new ConfigurationManagerAttributes { Order = 69 }));
EyeSeparationOffset = config.Bind(eyes, "Eye Separation Offset", 0.007f,
new ConfigDescription("Pushes the two eyes apart (or together), in metres. Each moves away from the centre of the face, so this is half the change in the gap.",
new AcceptableValueRange<float>(-0.5f, 0.5f), new ConfigurationManagerAttributes { Order = 68 }));
EyeRotationX = config.Bind(eyes, "Eye Rotation X", 0f,
new ConfigDescription("Turns both eyes on the spot. Only matters if the borrowed socket is flat enough to be seen edge-on.",
new AcceptableValueRange<float>(-180f, 180f), new ConfigurationManagerAttributes { Order = 60 }));
EyeRotationY = config.Bind(eyes, "Eye Rotation Y", 0f,
new ConfigDescription("As above, around the second axis.",
EyeRotationY = config.Bind(eyes, "Eye Rotation Y", 24.664f,
new ConfigDescription("As above, around the second axis - but MIRRORED: the left eye turns the opposite way, so the pair toes in or out together instead of both pointing off the same shoulder.",
new AcceptableValueRange<float>(-180f, 180f), new ConfigurationManagerAttributes { Order = 59 }));
EyeRotationZ = config.Bind(eyes, "Eye Rotation Z", 0f,
new ConfigDescription("As above, around the third axis.",
EyeRotationZ = config.Bind(eyes, "Eye Rotation Z", -180f,
new ConfigDescription("As above, around the third axis. The default half turn is what rights the borrowed socket, which arrives upside down on a player's head bone.",
new AcceptableValueRange<float>(-180f, 180f), new ConfigurationManagerAttributes { Order = 58 }));
EyeSmoke = config.Bind(eyes, "Eye Smoke", true,