Fat protagonist #1

Closed
opened 2026-11-26 20:02:22 +00:00 by github-bot · 6 comments
Owner

@⁠moosedonkeycow14 on GitHub · 2026-11-21 21:19 UTC · original

So I'm guessing the default blend shape basis is fat but the problem is the glb's don't have blend shapes

Also would be really cool if you add hair support but i understand if not since it's done in engine

**@⁠moosedonkeycow14** on GitHub · 2026-11-21 21:19 UTC · [original](https://github.com/holdmysocks/SixNG/issues/1) So I'm guessing the default blend shape basis is fat but the problem is the glb's don't have blend shapes Also would be really cool if you add hair support but i understand if not since it's done in engine
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:02:22 +00:00
Author
Owner

@⁠vladbondarenko97 on GitHub · 2026-11-21 21:46 UTC · original

Did a first pass on this from the mesh side; not solved, but here's what I found in case it helps whoever picks it up (format facts and aggregate numbers only).

Probe: player_story000_00_basetopssports_fr1_000_compression_cc_un_non_full (packs.rpf), geometry 0, 2,085 vertices. Its mesh blob has 16 vertex streams; SixNG decodes 0, 1, 2, 3, 4, 6, 8, 11, 14, 15. The rest:

Slot Fmt Bytes/vertex Observation
7 0x26 4 same format as weights (6): likely a second set of 4 skin weights
9 0x25 4 same format as joints (8): likely a second set of 4 joint indices (8 influences/vertex)
12 0x26 4 64 % of vertices non-zero
13 0x26 4 all zero on this mesh
17 0x84 16 first 2 bytes are a sane f16 (1.87 to 43.25, median 8.5); the other 14 bytes are high-entropy (6.5 to 7.5 bits/byte). As i16s none correlates with position or normal (abs r < 0.15), so it's packed/encoded, not plain deltas
19 0x27 4 tangent-format like slot 11; equal to slot 11 in the low 30 bits on 53 % of vertices, differs on the rest. Looks like a second tangent frame, which is what a morph target would carry

(Slot 14 is fmt 0x42 like the position stream, but it decodes cleanly as 2 × f32 UVs, so the current UV2 reading is right.)

Skeleton side: the drawable has 69 bones, most of them GM_U01_* girth helpers around the body (C_Spine0..5_{CF,CB,LF,LB,RF,RB}, C_Pelvis_*, {L,R,C}_Thigh01_{CF,CB,O}, {L,R}_Delt_{O,F,B}, Trap, Armpit, Neck1_*). So body girth looks at least partly bone-driven: the runtime would move these per character, and an export in bind pose shows whatever shape the bind pose is. The per-character values for these bones aren't located yet.

My guess at the order of work: (1) decode slots 7/9 as a second influence set, so the GM bones actually skin the mesh; (2) find where the GM bone offsets per body type live (meta/PSO); (3) slot 17 + 19 as a possible packed morph. I haven't checked how "fat" the current export actually looks, so treat this as a lead, not a diagnosis.

**@⁠vladbondarenko97** on GitHub · 2026-11-21 21:46 UTC · [original](https://github.com/holdmysocks/SixNG/issues/1#issuecomment-7069716185) Did a first pass on this from the mesh side; not solved, but here's what I found in case it helps whoever picks it up (format facts and aggregate numbers only). Probe: `player_story000_00_basetopssports_fr1_000_compression_cc_un_non_full` (packs.rpf), geometry 0, 2,085 vertices. Its mesh blob has 16 vertex streams; SixNG decodes 0, 1, 2, 3, 4, 6, 8, 11, 14, 15. The rest: | Slot | Fmt | Bytes/vertex | Observation | |---:|---|---:|---| | 7 | 0x26 | 4 | same format as weights (6): likely a second set of 4 skin weights | | 9 | 0x25 | 4 | same format as joints (8): likely a second set of 4 joint indices (8 influences/vertex) | | 12 | 0x26 | 4 | 64 % of vertices non-zero | | 13 | 0x26 | 4 | all zero on this mesh | | 17 | 0x84 | 16 | first 2 bytes are a sane f16 (1.87 to 43.25, median 8.5); the other 14 bytes are high-entropy (6.5 to 7.5 bits/byte). As i16s none correlates with position or normal (abs r < 0.15), so it's packed/encoded, not plain deltas | | 19 | 0x27 | 4 | tangent-format like slot 11; equal to slot 11 in the low 30 bits on 53 % of vertices, differs on the rest. Looks like a second tangent frame, which is what a morph target would carry | (Slot 14 is fmt 0x42 like the position stream, but it decodes cleanly as 2 × f32 UVs, so the current UV2 reading is right.) Skeleton side: the drawable has 69 bones, most of them `GM_U01_*` girth helpers around the body (`C_Spine0..5_{CF,CB,LF,LB,RF,RB}`, `C_Pelvis_*`, `{L,R,C}_Thigh01_{CF,CB,O}`, `{L,R}_Delt_{O,F,B}`, `Trap`, `Armpit`, `Neck1_*`). So body girth looks at least partly bone-driven: the runtime would move these per character, and an export in bind pose shows whatever shape the bind pose is. The per-character values for these bones aren't located yet. My guess at the order of work: (1) decode slots 7/9 as a second influence set, so the GM bones actually skin the mesh; (2) find where the GM bone offsets per body type live (meta/PSO); (3) slot 17 + 19 as a possible packed morph. I haven't checked how "fat" the current export actually looks, so treat this as a lead, not a diagnosis.
Author
Owner

@⁠holdmysocks on GitHub · 2026-11-21 21:50 UTC · original

Thanks both! Vlad, this is super helpful. The second weight/joint set lines up with what we're currently skipping, so that's probably the first thing to try, and the GM helper bones would explain a lot. Hair still looks like it's built in engine (the hair models are basically empty stubs), so that one's less likely. I'll dig into it but can't confirm anything yet, no promises.

**@⁠holdmysocks** on GitHub · 2026-11-21 21:50 UTC · [original](https://github.com/holdmysocks/SixNG/issues/1#issuecomment-7069761168) Thanks both! Vlad, this is super helpful. The second weight/joint set lines up with what we're currently skipping, so that's probably the first thing to try, and the GM helper bones would explain a lot. Hair still looks like it's built in engine (the hair models are basically empty stubs), so that one's less likely. I'll dig into it but can't confirm anything yet, no promises.
Author
Owner

@⁠moosedonkeycow14 on GitHub · 2026-11-21 22:50 UTC · original

Thanks also one more thing I looked at a bunch of heads and there materials don't have any textures named so if you could fix that would be great or make it so you can use the scroll wheel to just scroll through textures because dude my fingers are starting it hurt going through thousands of hashed textures

**@⁠moosedonkeycow14** on GitHub · 2026-11-21 22:50 UTC · [original](https://github.com/holdmysocks/SixNG/issues/1#issuecomment-7070466536) Thanks also one more thing I looked at a bunch of heads and there materials don't have any textures named so if you could fix that would be great or make it so you can use the scroll wheel to just scroll through textures because dude my fingers are starting it hurt going through thousands of hashed textures
Author
Owner

@⁠vladbondarenko97 on GitHub · 2026-11-21 22:58 UTC · original

Scrolling: #7 adds it. In the Textures tab, scroll the mouse wheel over the preview (one texture per notch, at fit zoom) or use ↑ / ↓ (Page Up / Page Down for 10 at a time); it also steps past textures that can't decode.

Head textures: I looked into why heads show no textures. It's not a naming problem: human ped heads (a_head_base_*, player_story*_head_*, cs_*_head_*, hc_*_head_*) have their texture slots unbound in the drawable itself. The head shader (379efcef) lists 9 parameters, but all 9 texture-slot pointers are null, so there's no hash64 to show. Props and animal heads bind theirs normally. So the game assigns head/skin textures at run time, as the README already says for skin.

Where they seem to come from (format facts, aggregate counts only):

  • Scanning packs.rpf for any 8-byte value that is a ttpf texture hash, the big hits besides drawables are PSO files and 7a meta resources referencing thousands of ttdb_peds_* textures. The largest PSO (packs.rpf@11ccb2000, about 9.8 MB) holds about 10.9 K of them.
  • In that PSO, struct 147fdab5 is a four-texture set (fields 41acf8eb, 9d1000d8, d689b17f, ead733fc; formats line up with colour BC7-sRGB, normal BC5, mask BC1/BC7), about 13.5 K + 10.6 K hits. It sits in ebacf18c[].e7cb9e1b of struct f795e8ba (19,828 entries), which looks like a per-component variation table.
  • Struct 31266ed5 (129 entries) is another four-texture set (677df1b8, b4932687, cca891ec: BC5; 05d6bb54: BC7). This might be the head/skin detail set, but that's a guess.
  • joaat("player_story000_00_head_fr1_lat_000_m") occurs in that PSO only inside eae70a33 item arrays, never directly in a f795e8ba field. So the drawable → texture-set link goes through an array or index indirection I haven't worked out.

If someone maps f795e8ba to its component/drawable, heads (and probably the white clothing materials) could get their textures from those sets.

**@⁠vladbondarenko97** on GitHub · 2026-11-21 22:58 UTC · [original](https://github.com/holdmysocks/SixNG/issues/1#issuecomment-7070555641) **Scrolling:** #7 adds it. In the Textures tab, scroll the mouse wheel over the preview (one texture per notch, at fit zoom) or use ↑ / ↓ (Page Up / Page Down for 10 at a time); it also steps past textures that can't decode. **Head textures:** I looked into why heads show no textures. It's not a naming problem: human ped heads (`a_head_base_*`, `player_story*_head_*`, `cs_*_head_*`, `hc_*_head_*`) have their texture slots unbound in the drawable itself. The head shader (`379efcef`) lists 9 parameters, but all 9 texture-slot pointers are null, so there's no `hash64` to show. Props and animal heads bind theirs normally. So the game assigns head/skin textures at run time, as the README already says for skin. Where they seem to come from (format facts, aggregate counts only): - Scanning `packs.rpf` for any 8-byte value that is a ttpf texture hash, the big hits besides drawables are PSO files and `7a` meta resources referencing thousands of `ttdb_peds_*` textures. The largest PSO (`packs.rpf@11ccb2000`, about 9.8 MB) holds about 10.9 K of them. - In that PSO, struct `147fdab5` is a four-texture set (fields `41acf8eb`, `9d1000d8`, `d689b17f`, `ead733fc`; formats line up with colour BC7-sRGB, normal BC5, mask BC1/BC7), about 13.5 K + 10.6 K hits. It sits in `ebacf18c[].e7cb9e1b` of struct `f795e8ba` (19,828 entries), which looks like a per-component variation table. - Struct `31266ed5` (129 entries) is another four-texture set (`677df1b8`, `b4932687`, `cca891ec`: BC5; `05d6bb54`: BC7). This might be the head/skin detail set, but that's a guess. - `joaat("player_story000_00_head_fr1_lat_000_m")` occurs in that PSO only inside `eae70a33` item arrays, never directly in a `f795e8ba` field. So the drawable → texture-set link goes through an array or index indirection I haven't worked out. If someone maps `f795e8ba` to its component/drawable, heads (and probably the white clothing materials) could get their textures from those sets.
Author
Owner

@⁠holdmysocks on GitHub · 2026-11-21 23:01 UTC · original

Nice, I've got most of this already set up, will check your PR and add it in, scrolling is a good touch.

**@⁠holdmysocks** on GitHub · 2026-11-21 23:01 UTC · [original](https://github.com/holdmysocks/SixNG/issues/1#issuecomment-7070583198) Nice, I've got most of this already set up, will check your PR and add it in, scrolling is a good touch.
Author
Owner

@⁠holdmysocks on GitHub · 2026-11-21 23:05 UTC · original

Closing this one out, here's where things landed:

  • Scrolling: #7 is merged, so the mouse wheel and arrow keys step through textures now. It'll be in the next release (not in v0.4.0).
  • Second weight/joint set: got it working locally. Clothing gets all 8 influences, and joints map to the shared ped skeleton, so it deforms properly. Not pushed yet, it'll come in a later update.
  • Body shape: the weight/muscle sliders don't look like mesh blend shapes. They drive helper bones through a rig program, which still needs decoding, so no promises on when.
  • Head textures: like Vlad found, they're assigned at runtime, not stored in the head models. That one's still open.
  • Hair: built in engine, so probably not happening.

Thanks both for digging in. If any of these turns into something concrete, feel free to open a new issue for it.

**@⁠holdmysocks** on GitHub · 2026-11-21 23:05 UTC · [original](https://github.com/holdmysocks/SixNG/issues/1#issuecomment-7070632429) Closing this one out, here's where things landed: - **Scrolling:** #7 is merged, so the mouse wheel and arrow keys step through textures now. It'll be in the next release (not in v0.4.0). - **Second weight/joint set:** got it working locally. Clothing gets all 8 influences, and joints map to the shared ped skeleton, so it deforms properly. Not pushed yet, it'll come in a later update. - **Body shape:** the weight/muscle sliders don't look like mesh blend shapes. They drive helper bones through a rig program, which still needs decoding, so no promises on when. - **Head textures:** like Vlad found, they're assigned at runtime, not stored in the head models. That one's still open. - **Hair:** built in engine, so probably not happening. Thanks both for digging in. If any of these turns into something concrete, feel free to open a new issue for it.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/holdmysocks--SixNG#1
No description provided.