Repository navigation
Load Dark Cloud's models from glTF, and add Enhanced cloth - #234
Merged
Merged
Conversation
Phases 1 to 3 of docs/MODEL_FRAMEWORK.md. Extraction: dcdata reads Dark Cloud's .cfg and .clo files word for word as ReadInfo, CTextureAnime::LoadCFGFile and InitCloth do (tools/dcdata/character_profile.hpp), taking a KEY's name from the comment on its line, and hands them to Kazarov's converter, which publishes every model, motion, skin weight and bind pose as glTF with a sidecar and indexes them in data/models.json. extract and the new bake-assets command convert the textures and models together; convert-models writes the conversion to a folder of its own, and strip-models empties the converted sources in the data in place. Loading: the game's loaders are unchanged. As DataReadLoadFile reads a file, data/model_gltf.cpp rebuilds each published source inside it, pack members and scenes at offsets alike, and writes it where the disc has it. Models, weights, bind poses and motions come back byte for byte. A motion keeps the disc's key frames and channel order, since the game reads every vertex channel of a frame at the first one's key. A source is written only over the bytes it was converted from or the zeros stripping left, and only if it matches their CRC; a failure leaves the file as read, except on stripped data, which stops with a message to rebake. Tests: the configuration reader, on fixtures made in code. On the PAL disc (DC_MODEL_DATA, DC_MODEL_RAW, DC_MODEL_STRIPPED, split across processes with DC_MODEL_PART): every model, weight, bind pose and motion rebuilds byte for byte, every motion keeps its poses in every action, every motion spliced into its pack matches the disc, and stripped data reads back as the disc's. Pins Kazarov to its Dark Cloud model profile (models_convert_dc1).
Phase 4 of docs/MODEL_FRAMEWORK.md. Cloth gets an Original/Enhanced choice on the Display page (video.cloth, Original by default). Enhanced keeps the PS2's step as it is, so the cloth moves as it always has, then pushes the free vertices out of the body the way the step pushes them out of the .clo boxes. The body is the skeleton as capsules: - Arms and legs: a capsule along each joint. Each vertex keeps the clearance from each limb it had when the cloth settled, so cloth authored against an arm stays there, and an arm raised through where it rests pushes it. - Chest and pelvis: fitted, when the cloth settles, to the character's drawn skinned mesh, measured from the spine in 12 directions at 6 heights in the spine joint's frame. Each vertex of the mesh goes to the capsule it lies nearest, head, hands and feet among them, so a hand at the side doesn't widen the torso. Cloth authored resting inside the torso (Toan's collar) goes no deeper than it rests. - A limb pressing cloth towards the torso stops it at the torso's surface, or where it rests if that is nearer. Measured against Original in scripted headless runs: the same tick-to-tick motion, neck stretch and hem; a quick about-turn swings Toan's poncho round his chest rather than through it; the back panel hangs as Original's and never goes into his back; the deepest overlap of his arms and the poncho in the attract movie falls from 0.74 to 0.34. A full position-based solver was tried first and dropped: the cloth is authored for the PS2's soft springs, and it rode up or stiffened. The remaining clipping in the attract movie is the PS2's own, and Original's is the same: the collar is authored up to 0.8 inside Toan's chest, and in the movie's raised-arm poses the skinned chest and shoulders swell over it.
Adubbz
added a commit
that referenced
this pull request
Oct 28, 2026
BtbN prunes its dated autobuilds, so the pinned FFmpeg archive stopped downloading and the Windows job failed while installing its dependencies. Kazarov now cross-compiles its LGPL kz-ffmpeg configuration for Windows and publishes it, with cxxbridge, in its deps release; acquire.ps1 and acquire-rust.ps1 download both from there instead of BtbN and a personal fork, and nothing is built from source. Updates Kazarov to master, which merges the Dark Cloud model profile that #234 pinned from its pull request and adds the Windows FFmpeg build.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Dark Cloud's models, motions, skin weights and bind poses are converted to glTF 2.0 at extraction, through Kazarov's model converter as Dark Cloud 2's are, and the game loads them from there. Cloth gets an optional Enhanced mode that keeps it out of the body. The design, the measurements and what is left for later are in
docs/MODEL_FRAMEWORK.md.Depends on the Kazarov pull request from
SirFancyBacon:chronicle-models-on-master(a game profile for the model converter). The submodule pins that branch's head, two commits on top of the current pin.Models
dcdata extractconverts the models with the textures.convert-modelswrites a conversion to a folder of its own,bake-assetspublishes one into extracted data, andstrip-modelsempties the converted originals. The character configuration (.cfg,.clo) is read word for word as the game reads it (tools/dcdata/character_profile.hpp) and handed to Kazarov as a profile reader. EachKEYbecomes a named glTF action that keeps its source frames, because Dark Cloud's hit windows compare absolute motion frames. Dark Cloud adds 2,293 names to Kazarov's motion name table.DataReadLoadFilereads a file,port/src/data/model_gltf.cpprebuilds every published source inside it (pack members, nested packs, scenes at offsets) and writes it where the disc has it.Enhanced cloth
Display → Cloth: Original (the default) or Enhanced (
video.cloth). Enhanced runs the PS2's step unchanged, then pushes the cloth out of the body the way the step pushes it out of the.cloboxes:Measured against Original in scripted headless runs:
The clipping left in the attract movie is retail's: the collar is authored inside his chest, and Original shows the same.
Testing
CharacterProfile.*, on fixtures made in code.ClothEnhanced.*, 14 cases on synthetic skeletons and meshes.ModelGltf.*, opt-in throughDC_MODEL_DATA,DC_MODEL_RAWandDC_MODEL_STRIPPED, sharded withDC_MODEL_PART.GfxValidationcases, because the SDK has no validation layer;GfxMisc.PipelineCache;GfxGpuColorWriteMaskcases.