Members hohenheim Posted May 23 Members Posted May 23 (edited) I'm trying to export and edit the models from this game. From what I understand so far, the game uses a 3D model archive-like format called TgMD. A TgMD file can contain multiple model parts, such as the character body, accessories, hair, masks, and other optional/variant parts. The textures seem to be TIM2-based, but with a different/custom header named K2Tx. They do not seem to be too unusual otherwise. The format appears to store several things together: geometry, textures, UVs, possibly animations or animation-related data. Inside the TgMD, I have found a few different block types: KMDs = main geometry/model data KMDp = additional parts, details, variants, hair, face parts, etc. Some models do not seem to have KMDp blocks. (Models have bones too) K2Tx = texture data, apparently 8bpp indexed textures with palettes TEXx / KMTv = texture/material-related data, and possibly animation-related data Im not that good with coding or with dealing with unknow 3d formats, but the more confusing to me was the UV and textures part. Any help would be appreciated. Samples.zip Edited May 23 by hohenheim
Engineers shak-otay Posted May 24 Engineers Posted May 24 (edited) On 5/23/2026 at 2:54 AM, hohenheim said: , but the more confusing to me was the UV and textures part. Some PS2 expert needs to check it, uvs show some characteristic PS2 uv problem (while the mesh looks horrible): Edited May 24 by shak-otay
Engineers roocker666 Posted Tuesday at 07:11 PM Engineers Posted Tuesday at 07:11 PM I think it will be better to split kmds(mesh with skeleton) and kmdp(mesh only) because both have different formats. I was analyzing the first kmds and I got something similar. About Uvs, the format is: UV tag 79 80 XX 7D(third byte is count) Then UV buffer: 2 shorts Uvs, 4 bytes padding or flag? The problem are the polygons, I don't know if strip flag is in vertices or Uvs. About verts there is a tag too: 00 80 XX 7D, then 4 unk shorts (I think vert count is here but I used te count from the tag /2). It seems like in those 4 unk shorts one of them is vert count but sometimes it changes position, so there are 2 vert counts(vcount1 and vcount2) and the mesh uses one or the other or something like that, it is very confusing, lol. That is why I used vert count from vert TAG. 1
Engineers roocker666 Posted Tuesday at 07:54 PM Engineers Posted Tuesday at 07:54 PM And this is kmdp format, those FF FF FF FF maybe is some kind of identifier then it has two vcounts too.., that is all I got for now...
Members hohenheim Posted 19 hours ago Author Members Posted 19 hours ago (edited) I asked chatgpt to analyze some samples and try to generate some script for Noesis, even after sending example files, it only got this far. I don't know if its okay to use ai to help, so im sorry if its not. fmt_tenchu_ps2.py Edited 19 hours ago by hohenheim 1
Engineers shak-otay Posted 14 hours ago Engineers Posted 14 hours ago (edited) 6 hours ago, hohenheim said: I don't know if its okay to use ai to help, Rule 17 does not forbid it. But for ai generated scripts it should be mandatory, imho, to provide the link to the basic source(s), here, in this monster of a script (76 kB!), there's a hint, only: Quote # v9.0: # Uses the KMDs reader based on the forum hypothesis in normal mode too. # so there's only wild guessing which source is meant, maybe here? (but is a c sharp source) The real source seems to be portuguese ("# Base sempre usada nos modos finais."). edit: Quote Professional & Academic Content: Yes. Citing sources allows readers to verify claims and dive deeper into the topic. It also helps avoid plagiarism by properly crediting original authors. Edited 13 hours ago by shak-otay 1
Engineers roocker666 Posted 13 hours ago Engineers Posted 13 hours ago That is a big script, lol. Mine reads only kmds, then I made other for kmdp and finally I made other to read kmds and kmp from .TgMD container but without textures. TgMD has a table with pointers to all kmds/kmdp and textures but mine does not read textures yet, lol. And I fixed the strips. Check this: 1
Engineers roocker666 Posted 13 hours ago Engineers Posted 13 hours ago I'll share the TgMD script later; I just need to clean it up a bit, it's a little messy, haha. Also, it's 3:00 AM here, so I'm going to sleep. 😴💤
Engineers shak-otay Posted 12 hours ago Engineers Posted 12 hours ago 8 minutes ago, roocker666 said: Also, it's 3:00 AM here, so I'm going to sleep. 😴💤 Haha, so it's not Western Europe? Good night! 1
Engineers roocker666 Posted 2 hours ago Engineers Posted 2 hours ago No, I am from Mexico, lol. OK here is TgMD script; It searches for kmdps/kmdp and then it searches for verts/normals/uv tags on each file. Strip flags are in UV buffer. It does not read textures or skeleton. I will try to check the skeleton later, it looks similar to Silent Hill 2/3/4(matrix 4x4 and bone parent table). It seems like all kmds have a copy of the same skeleton but I don't know why.... Anyway, here is the script: fmt_tenchu_fs_ps2_tgmd.py 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now