May 18May 18 Localization The game maps use this format; each level has a map divided into sections. I'll also send the textures to help with visualization. If anyone knows a way to edit or convert them, I would be grateful. ST01-TEXTURE.zip ST01.zip
May 18May 18 Supporter Solution Looks simple. First you must parse vertex buffer, index buffer and then is table with info about shapes and textures. //------------------------------------------------ //--- 010 Editor v14.0 Binary Template // // File: Tenchu: Return from Darkness // Authors: // Version: // Purpose: // Category: // File Type: *.bgm // ID Bytes: // History: //------------------------------------------------ LittleEndian();OutputPaneClear(); local uint32 i,j,k,l,ElementBaseOffset,IndexBaseOffset; FSeek(36); uint32 TotalElementCount; ElementBaseOffset=FTell(); byte Elements[TotalElementCount * 24]; uint32 TotalIndexCount; IndexBaseOffset=FTell(); ushort Indices[TotalIndexCount]; struct { uint32 ShapeIndex; struct { uint32 IndexOffset,IndexCount,ElementOffset,ElementCount; uint32 ShapeId; string TextureName; FSeek(startof(TextureName)); FSkip(32); uint32 Unk4; float BBox[6]; }Shape[ShapeIndex]<optimize=false>; }Shapes; FSeek(ElementBaseOffset); struct { for (i=0; i < Shapes.ShapeIndex; i++) { struct { FSeek(ElementBaseOffset + Shapes.Shape[i].ElementOffset * 24); struct { float VPosX,VPosY,VPosZ; ubyte R,G,B,A; float UVPosX,UVPosY; }Elements[Shapes.Shape[i].ElementCount]<optimize=false>; FSeek(IndexBaseOffset + Shapes.Shape[i].IndexOffset * 2); struct { uint16 Index; }Indices[Shapes.Shape[i].IndexCount]<optimize=false>; }ShapeBuffer; } }ShapeBuffers; from inc_noesis import * import noesis import rapi import os def registerNoesisTypes(): handle = noesis.register("Tenchu: Return from Darkness - Mesh", ".bgm") noesis.setHandlerTypeCheck(handle, noepyCheckType) noesis.setHandlerLoadModel(handle, noepyLoadModel) noesis.logPopup() return 1 def noepyCheckType(data): bs = NoeBitStream(data) if len(data) < 20: return 0 return 1 def noepyLoadModel(data, mdlList): bs = NoeBitStream(data) baseName = rapi.getExtensionlessName(rapi.getLocalFileName(rapi.getInputName())) ctx = rapi.rpgCreateContext() Underline = "_" CurPos = bs.tell() bs.read(20) Type = bs.readUInt() if Type == 1: bs.seek(CurPos, NOESEEK_ABS) bs.read(36) else: bs.seek(CurPos, NOESEEK_ABS) TotalElementCount = bs.readUInt() ElementBaseOffset = bs.tell(); ElementBuffer = bs.read(TotalElementCount * 24) rapi.rpgBindPositionBufferOfs(ElementBuffer, noesis.RPGEODATA_FLOAT, 24, 0) rapi.rpgBindColorBufferOfs(ElementBuffer, noesis.RPGEODATA_UBYTE, 24, 12, 4) rapi.rpgBindUV1BufferOfs(ElementBuffer, noesis.RPGEODATA_FLOAT, 24, 16) TotalIndexCount = bs.readUInt() IndexBaseOffset = bs.tell(); bs.read(TotalIndexCount * 2) ShapeIndex = bs.readUInt() for i in range(0, ShapeIndex): IndexOffset = bs.readUInt() * 2 IndexCount = bs.readUInt() ElementOffset = bs.readUInt() * 24 ElementCount = bs.readUInt() ShapeId = bs.readUInt() TNamePos = bs.tell() TextureName = bs.readString() bs.seek(TNamePos, NOESEEK_ABS) bs.read(32) Unknown = bs.readUInt() BBox = bs.read(24) cPos = bs.tell() ShapeId = "{:04d}".format(ShapeId) rapi.rpgSetName(baseName + Underline + ShapeId) rapi.rpgSetMaterial(TextureName) if IndexCount != 0: bs.seek(IndexBaseOffset + IndexOffset, NOESEEK_ABS) IndexBuffer = bs.read(IndexCount * 2) rapi.rpgCommitTriangles(IndexBuffer, noesis.RPGEODATA_USHORT, IndexCount, noesis.RPGEO_TRIANGLE_STRIP) bs.seek(cPos, NOESEEK_ABS) mdl = rapi.rpgConstructModel() mdlList.append(mdl) return 1 Just drop the bgm into the texture folder named as the bgm. Noesis should open it with texture applied. Not sure when export tho. I set material name as texture name. Vertex color works too. Edited May 18May 18 by h3x3r
Create an account or sign in to comment