May 23May 23 Localization 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 23May 23 by hohenheim
May 24May 24 Supporter 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 24May 24 by shak-otay
June 2Jun 2 Supporter 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.
June 2Jun 2 Supporter 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...
June 5Jun 5 Author Localization 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 June 5Jun 5 by hohenheim
June 5Jun 5 Supporter 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 June 5Jun 5 by shak-otay
June 5Jun 5 Supporter 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:
June 5Jun 5 Supporter 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. 😴💤
June 5Jun 5 Supporter 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!
June 5Jun 5 Supporter 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
June 6Jun 6 Author Localization 16 hours ago, shak-otay said: 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: 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: Just to clarify a few things: I copied what I had already said in my first post, and added that the format seemed complicated based on what others on the forum were saying about it back in May. About the source/comments being in Portuguese, i'm actually from Brazil, and the script was originally in Portuguese. I only asked GPT to translate the script to English for convenience lol, so my bad for not making that clear right away. It generated tons of different versions of the script while trying to get it right, but this was as far as it got. Regarding "KMDExtractor", I didn't use it because I didn't even know it existed.
June 6Jun 6 Supporter 4 hours ago, hohenheim said: Just to clarify a few things: I copied what I had already said in my first post, and added that the format seemed complicated based on what others on the forum were saying about it back in May. [...] and the script was originally in Portuguese. I only asked GPT to translate the script to English for convenience lol, so my bad for not making that clear right away. Thanks for the clarification. It would be nice, btw, if we had that original script, just translated by google (or similar, but AI free).
June 7Jun 7 Author Localization 21 hours ago, shak-otay said: Thanks for the clarification. It would be nice, btw, if we had that original script, just translated by google (or similar, but AI free). There is no original script in this case. I sent TgMD sample files to the AI, and after around 60 attempts or so, it finally managed to display a model in Noesis, although it was still glitched. After that, it figured out the texture format, K2Tx, and after a few more attempts it displayed the model as shown in the photo I sent. So the script itself came from the AI. It was not translated from an older script or based on someone else’s original code. I can, however, send some older scripts that the AI generated a few weeks ago, if that helps.
June 7Jun 7 Supporter 4 hours ago, hohenheim said: There is no original script in this case. Well, that's a little bit confusing, because you wrote: Quote the script was originally in Portuguese. I only asked GPT to translate the script to English Quote So the script itself came from the AI. Yeah, created a monster of 76 kB which could be much simpler, see roocker666's solution. But AI provided (or copied from existing source) a solution for the triangles problem, admitted. Quote It was not translated from an older script or based on someone else’s original code. From your side, ok, For me it looks as if ChatGpt copied some parts, that seems to be clear (see first quote here). Let's see what AI says itself: Quote ChatGPT never directly copies or pastes code from the web. Instead, it synthesizes new scripts word-by-word (or token-by-token) using deep learning algorithms trained on vast datasets of open-source programming code This sounds as if Elon Musk himself had spoken. Not "copied" but "trained" on open-source programming code? Quote I can, however, send some older scripts that the AI generated a few weeks ago, if that helps. Thank you very much for the suggestion, but, no. I'd prefer using roocker666's script which is much shorter. Edited June 7Jun 7 by shak-otay
June 7Jun 7 Author Localization On 6/5/2026 at 4:13 PM, roocker666 said: 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 8.54 kB · 5 downloads About the bones; The game had a PSP version, and in that version, there's a file with the 3D models in .gmo format, and another file with what appears to be the bones of those models? I'm not entirely sure how it works in this case, but perhaps this will help. About the models; I don't remember if I mentioned it, but in the game, some parts of the models have movement, mainly small parts like hair, and the scarf on the model I'm going to send. Also, the script doesn't seem to read very simple models, like the animal models in the game. PSP Bones.zip model with scarf.zip
Create an account or sign in to comment