Skip to content

Don't draw the body's own head mesh when Mdl_SetVisualBody sets a head - #1090

Open
pieterdeschepper wants to merge 1 commit into
Try:masterfrom
pieterdeschepper:hide-body-head-attachment
Open

pieterdeschepper wants to merge 1 commit into
Try:masterfrom
pieterdeschepper:hide-body-head-attachment

Conversation

@pieterdeschepper

@pieterdeschepper pieterdeschepper commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Some Gothic 1 NPCs have a broken face: Stone, Snaf, Rice Lord, Viper, Balam and Omid. All of them use hum_Body_CookSmith.

Cause

HUM_BODY_COOKSMITH.MDM has its own mesh attached to BIP01 HEAD. Its texture, HUM_HEAD_VLK_V02_C1.TGA, doesn't exist in the game data, so it is drawn with DEFAULT.TGA. The mesh is about the size of the real head, so it overlaps the head set by Mdl_SetVisualBody (for Stone, Hum_Head_Pony) and the two fight around the face.

The MDM is loaded without a skeleton, so implSetBody turns this attachment into a slot attachment on the head bone, next to the real head.

Fix

In MdlVisual::implSetBody, skip a body attachment on the head bone when a head is bound. ZenGin does the same: the head visual replaces whatever the mesh library put on the head node.

Other meshes

I scanned all MDMs in the G1 data. Only nine have a mesh on BIP01 HEAD: HUM_BODY_COOKSMITH, GOL_BODY, GOL_FIRE_BODY, GOL_ICE_BODY, SKE_BODY, SKE_BODY2, SKE_BODY3, SKE_FLY_BODY and UOS_BODY.

All the non-human ones are passed an empty head in Mdl_SetVisualBody, so they keep their own head. No armor MDM has a head attachment. I couldn't check Gothic 2 data.

Testing

Tested in Gothic 1 (English) on macOS, in a local build.

  • I added a temporary log and loaded a save in the Old Camp. The head attachment was skipped for the CookSmith NPCs only.
  • In game, Stone's face renders correctly.
  • Golems and skeletons still show their heads.

🤖 Generated with Claude Code

hum_Body_CookSmith.MDM has its own mesh on BIP01 HEAD (texture
HUM_HEAD_VLK_V02_C1.TGA, which doesn't exist). It was drawn on top of
the head from Mdl_SetVisualBody, so the faces of Stone, Snaf, Rice Lord,
Viper, Balam and Omid flickered.

In ZenGin the head visual replaces whatever the mesh puts on the head
node. Bodies that set no head (golems, skeletons, UOS) keep their own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant