Wardrobe: prefer tag names and ped body class / head prefix in ped-variations #70

Manually merged
github merged 1 commit from gh-pr/70/head into gh-pr/70/base 2026-11-26 20:07:27 +00:00
Owner

@⁠Ahmet-Dedeler on GitHub · 2026-11-23 18:53 UTC · original
Ahmet-Dedeler:fix/wardrobe-drawable-pick → master · +103 −13 · 1 files · 1 commits · merged 2026-11-23 19:11 UTC

In wardrobe::variations(), drawable selection previously picked the highest-texture-count model globally and broke ties alphabetically, only falling back to an item's resolved tag name when counts was empty. That caused three recurring mis-picks on ped wardrobe resources:

  1. Tag-resolved items overwritten by shared textures: hair, brow, and garment items whose tag (4bfd27dd / 023e5a2f / 2a8cdb1d) resolved to their exact prefix were overridden whenever another drawable shared the same texture count and sorted earlier (e.g. dummy strand-hair drawables resolving to an unrelated infant brow drawable, or numbered garment variants shifting to an earlier index).
  2. Wrong body class on shared skin textures: body-part items whose textures are shared across female/male body classes (fc1, fr1, mr1, etc.) broke ties alphabetically into the wrong class.
  3. Wrong eyes drawable in head sets: eye items sharing textures across heads broke ties alphabetically to another character's eyes instead of matching the head in the same variation.

Changes (crates/sixng-core/src/wardrobe.rs)

  • Infer the resource's ped body class (fr1, mr1, fc1, etc.) from tag-resolved item names across the resource.
  • Extract the variation's head stem (4bfd27dd, walking parent chains) when present.
  • Prefer candidates matching the item's resolved tag prefix when present (pick_with_name), falling back to the tag's _full drawable rather than an unrelated texture-count tie.
  • Break texture-count ties in pick_for() by head stem match, ped body class, _full suffix, then name. Existing pick() signature is preserved.
  • Added unit tests pick_for_breaks_ties_by_head_prefix_and_body_class and pick_with_name_prefers_tag_prefix_over_shared_dummy_texture.

Verification

  • cargo test -p sixng-core --no-default-features: 139 passed, 0 failed.
  • Checked against a 13-variation packs.rpf wardrobe resource (387e010): all hair/brow items, garment tag overrides, body class parts (fr1), and head-set eyes now resolve to their matching drawables.
**@⁠Ahmet-Dedeler** on GitHub · 2026-11-23 18:53 UTC · [original](https://github.com/holdmysocks/SixNG/pull/70) `Ahmet-Dedeler:fix/wardrobe-drawable-pick` → `master` · +103 −13 · 1 files · 1 commits · merged 2026-11-23 19:11 UTC In `wardrobe::variations()`, drawable selection previously picked the highest-texture-count model globally and broke ties alphabetically, only falling back to an item's resolved tag name when `counts` was empty. That caused three recurring mis-picks on ped wardrobe resources: 1. **Tag-resolved items overwritten by shared textures**: hair, brow, and garment items whose tag (`4bfd27dd` / `023e5a2f` / `2a8cdb1d`) resolved to their exact prefix were overridden whenever another drawable shared the same texture count and sorted earlier (e.g. dummy strand-hair drawables resolving to an unrelated infant brow drawable, or numbered garment variants shifting to an earlier index). 2. **Wrong body class on shared skin textures**: body-part items whose textures are shared across female/male body classes (`fc1`, `fr1`, `mr1`, etc.) broke ties alphabetically into the wrong class. 3. **Wrong eyes drawable in head sets**: eye items sharing textures across heads broke ties alphabetically to another character's eyes instead of matching the head in the same variation. ### Changes (`crates/sixng-core/src/wardrobe.rs`) - Infer the resource's ped body class (`fr1`, `mr1`, `fc1`, etc.) from tag-resolved item names across the resource. - Extract the variation's head stem (`4bfd27dd`, walking parent chains) when present. - Prefer candidates matching the item's resolved tag prefix when present (`pick_with_name`), falling back to the tag's `_full` drawable rather than an unrelated texture-count tie. - Break texture-count ties in `pick_for()` by head stem match, ped body class, `_full` suffix, then name. Existing `pick()` signature is preserved. - Added unit tests `pick_for_breaks_ties_by_head_prefix_and_body_class` and `pick_with_name_prefers_tag_prefix_over_shared_dummy_texture`. ### Verification - `cargo test -p sixng-core --no-default-features`: 139 passed, 0 failed. - Checked against a 13-variation `packs.rpf` wardrobe resource (`387e010`): all hair/brow items, garment tag overrides, body class parts (`fr1`), and head-set eyes now resolve to their matching drawables.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:07:26 +00:00
github manually merged commit 8d63bc7951 into gh-pr/70/base 2026-11-26 20:07:27 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.