Page 1 of 2

Twelvesky2 model files

Posted: Thu Apr 16, 2020 10:47 am
by Sancje
I need model files of TwelveSky 2. I will use this model file in a different game. I need to transfer the model file to 3ds max.
I just extracted texture using "offzip". I couldn't extract the meshes. I would really appreciate if you can help.

include *.SOBJECT files : 3d meshes and textures

http://www.mediafire.com/file/ufdtyuvx0 ... _files.zip

Re: Twelvesky2 model files

Posted: Thu Apr 16, 2020 4:11 pm
by shakotay2
Y0170001-Sobject-decompressed.png

Re: Twelvesky2 model files

Posted: Thu Apr 16, 2020 5:07 pm
by Sancje
shakotay2 wrote: Thu Apr 16, 2020 4:11 pm Y0170001-Sobject-decompressed.png
wow, super. Very thanks Did you just use meshextractor? I also have no knowledge of these issues. Is it possible to automatically extract all meshes with script?

Re: Twelvesky2 model files

Posted: Thu Apr 16, 2020 5:13 pm
by shakotay2
Sancje wrote: Thu Apr 16, 2020 5:07 pmIs it possible to automatically extract all meshes with script?
Guess so - but you need to find someone who's motivated to write a script.

Re: Twelvesky2 model files

Posted: Thu Apr 16, 2020 6:05 pm
by Sancje
shakotay2 wrote: Thu Apr 16, 2020 5:13 pm
Sancje wrote: Thu Apr 16, 2020 5:07 pmIs it possible to automatically extract all meshes with script?
Guess so - but you need to find someone who's motivated to write a script.
I will have a few questions and a request.I would be glad if you help.

1-) did you just use mesh extractor to extract the meshes ? did you use any other tools? (offzip, quickbms...)
2-) In your extracted model, the edges are a bit sharp. Is it possible to soften edges using Meshextractor?
3-) Could you do a few more examples?
4-)Which version of meshextractor are you using?

Re: Twelvesky2 model files

Posted: Thu Apr 16, 2020 7:54 pm
by shakotay2
Sancje wrote: Thu Apr 16, 2020 6:05 pm 1-) did you just use mesh extractor to extract the meshes ? did you use any other tools? (offzip, quickbms...)
decompressed sobject with offzip
2-) In your extracted model, the edges are a bit sharp. Is it possible to soften edges using Meshextractor?
Nope, it's a (data format) converter only (with attached 3D viewer) not a 3D tool.
Use File\SaveAs mesh to export as wavefront obj file. Load that into the 3D tool of your choice for beautifying, whatever.
3-) Could you do a few more examples?
Not atm.
4-)Which version of meshextractor are you using?
Current version (view link in my sig).

Re: Twelvesky2 model files

Posted: Thu Apr 16, 2020 8:57 pm
by Sancje
shakotay2 wrote: Thu Apr 16, 2020 7:54 pm
Sancje wrote: Thu Apr 16, 2020 6:05 pm 1-) did you just use mesh extractor to extract the meshes ? did you use any other tools? (offzip, quickbms...)
decompressed sobject with offzip
2-) In your extracted model, the edges are a bit sharp. Is it possible to soften edges using Meshextractor?
Nope, it's a (data format) converter only (with attached 3D viewer) not a 3D tool.
Use File\SaveAs mesh to export as wavefront obj file. Load that into the 3D tool of your choice for beautifying, whatever.
3-) Could you do a few more examples?
Not atm.
4-)Which version of meshextractor are you using?
Current version (view link in my sig).
thank you for your answers. Finally, some places on the model are black. how can i fix ? Thanks again.

Image

Re: Twelvesky2 model files

Posted: Thu Apr 16, 2020 10:40 pm
by shakotay2
I usually provide the first submesh only. So it's not a matter of "fixing" you just need to search for further submeshes:

0x43024 1590
Vb1
76 68
0x3A874 457
020000
0x0 255

Create an empty .txt file, copy above 6 lines into it, save as "whatever.H2O" and load it into hex2obj.

Or simply in the meshextractor gui replace the following parameters addr (without the "0x") and count (for face indices and vertices) of the first submesh to get the missing one:
0x43024 1590
0x3A874 457

Re: Twelvesky2 model files

Posted: Fri Apr 17, 2020 1:26 pm
by Sancje
shakotay2 wrote: Thu Apr 16, 2020 10:40 pm I usually provide the first submesh only. So it's not a matter of "fixing" you just need to search for further submeshes:

0x43024 1590
Vb1
76 68
0x3A874 457
020000
0x0 255

Create an empty .txt file, copy above 6 lines into it, save as "whatever.H2O" and load it into hex2obj.

Or simply in the meshextractor gui replace the following parameters addr (without the "0x") and count (for face indices and vertices) of the first submesh to get the missing one:
0x43024 1590
0x3A874 457
very thanks again.

Re: Twelvesky2 model files

Posted: Fri Apr 17, 2020 7:28 pm
by Sancje
I decompressed the model files of the game with quickbms. I need a automatic script to open this models (for obj,fbx,.). I would be happy if you help
Can you help me please ?

include original game *.SOBJECT files : 3d meshes and textures
http://www.mediafire.com/file/ufdtyuvx0 ... _files.zip

Decompressed *.SOBJECT files: 3d meshes and textures.(*.mdl extension) Opened with quickbms.
https://www.mediafire.com/file/sj33z4xb ... _FILES.zip

Quickbms download link : http://aluigi.altervista.org/papers/quickbms.zip

Quickbms Twelvesky2 unpack script:

Code: Select all

dword numResource
struct RES
{
<compressed model data>
<compressed Texture data>
}


Code:

# Game: 
# by
# script

get PRENAME basename
get NUMRES long
savepos OFS_RES
for i = 1 to NUMRES
goto OFS_RES
get FLAG1 long
get USIZE long
if FLAG1 != 1
math FLAG1 -= USIZE
math FLAG1 *= -1
else
math FLAG1 -= 1
endif
get CSIZE long
savepos OFS_RES
set RESNAME PRENAME
string RESNAME += _
if i < 10
string RESNAME += "0"
endif
string RESNAME += i
string RESNAME += .mdl
if USIZE > 0
clog RESNAME OFS_RES CSIZE USIZE
endif
math OFS_RES += CSIZE
math OFS_RES += FLAG1

goto OFS_RES
get FLAG1 long
get USIZE long
if FLAG1 != 1
math FLAG1 -= USIZE
math FLAG1 *= -1
else
math FLAG1 -= 1
endif
get CSIZE long
savepos OFS_RES
set RESNAME PRENAME
string RESNAME += _
if i < 10
string RESNAME += "0"
endif
string RESNAME += i
string RESNAME += .dds
if USIZE > 0
clog RESNAME OFS_RES CSIZE USIZE
endif
math OFS_RES += CSIZE
math OFS_RES += FLAG1
next i

Re: Twelvesky2 model files

Posted: Sat Apr 18, 2020 9:04 am
by shakotay2
Don't trust this script! It's intended to be used as a startup only. So don't blame me. :D

Finding the start address of the second submesh will require some fiddling (using a while loop for example).
(The addr output refers to Y017001_01 only!)

Since you're free with the model extension "mdl2" (for example) is better than "mdl" which is widely spread.

Code: Select all

from inc_noesis import *
import noesis
import rapi

def registerNoesisTypes():
	handle = noesis.register("TwelveSkies2_test",".mdl2")
	noesis.setHandlerTypeCheck(handle, noepyCheckType)
	noesis.setHandlerLoadModel(handle, noepyLoadModel)
	return 1
	
NOEPY_HEADER = 0x0003

def noepyCheckType(data):
   bs = NoeBitStream(data)
   if len(data) < 3:
       return 0
   sig = bs.readUInt()
   if sig not in [NOEPY_HEADER]:
       print("wrong Header <> 03 00!")
       return 0
   return 1  

def noepyLoadModel(data, mdlList):
	ctx = rapi.rpgCreateContext()
	bs = NoeBitStream(data)
	addr= 0x180; vAddr= addr + 4 ; VBSize = int(76)
	bs.seek(addr)
	vCnt1 = bs.readUInt()
	VBuff = bs.readBytes(vCnt1 * VBSize)
	fiCntAddr= vAddr + VBSize * vCnt1
	bs.seek(fiCntAddr, NOESEEK_ABS)#
	fCnt1 = bs.readUInt()
	print("vCnt1  fCnt1", vCnt1,fCnt1)

	rapi.rpgBindPositionBufferOfs(VBuff, noesis.RPGEODATA_FLOAT, VBSize, 0)
	rapi.rpgBindUV1BufferOfs(VBuff, noesis.RPGEODATA_FLOAT, VBSize,VBSize-8)

	offset= bs.tell()
	print("FIs at:", hex(offset)); FBSize= fCnt1 * 3 * 2
	FBuff = bs.readBytes(FBSize)
	rapi.rpgCommitTriangles(FBuff, noesis.RPGEODATA_USHORT, fCnt1*3, noesis.RPGEO_TRIANGLE, 1)
	# handling submesh 2, got LOD instead
	addr= fiCntAddr + 4 + FBSize
	fileBuff = bs.data[addr:bs.dataSize]# reminder: Size must be reduced here
	addr1= fileBuff.find(b'\x01\x00\x00\x00')
	addr += addr1
	bs.seek(addr-4)
	b = bs.readUInt()
	offset= bs.tell()
	print("LOD at:", hex(offset), b); 
	# submesh 2?
	addr += 4
	fileBuff = bs.data[addr:bs.dataSize]# reminder: Size must be reduced here
	addr1= fileBuff.find(b'\x01\x00\x00\x00')
	addr += addr1
	bs.seek(addr)
	offset= bs.tell()
	print("SM2? at:", hex(offset)); 

	mdl = rapi.rpgConstructModel()
	mdlList.append(mdl)
	
	rapi.rpgClearBufferBinds()
	return 1
.
Y03_2001.png

Re: Twelvesky2 model files

Posted: Sat Apr 18, 2020 10:38 am
by Sancje
thank you so much :) . these things are very hard for me. I'm very amateur. I was trying to learn your hex2obj. I haven't even figured it out yet.

Re: Twelvesky2 model files

Posted: Sat Apr 18, 2020 6:26 pm
by Sancje
shakotay2 wrote: Thu Apr 16, 2020 10:40 pm I usually provide the first submesh only. So it's not a matter of "fixing" you just need to search for further submeshes:

0x43024 1590
Vb1
76 68
0x3A874 457
020000
0x0 255

Create an empty .txt file, copy above 6 lines into it, save as "whatever.H2O" and load it into hex2obj.

Or simply in the meshextractor gui replace the following parameters addr (without the "0x") and count (for face indices and vertices) of the first submesh to get the missing one:
0x43024 1590
0x3A874 457
hi, How did you calculate the FVFsize and UVpos value(76,68) ? Are these values constant?

Re: Twelvesky2 model files

Posted: Sat Apr 18, 2020 7:48 pm
by shakotay2
Sancje wrote: Sat Apr 18, 2020 6:26 pmhi, How did you calculate the FVFsize
There's no general recipe.
Here it's (startAddrFIs - startOfVertices) / vertexCount
(FI= faceIndex)
Getting the startOfVertices is a matter of experience usually.
and UVpos value(76,68) ?
No recipe. Position of float uvs (tx, ty) usually is a multiple of 4, here it's 76 - 8. (8= sizeOfTx + sizeOfTy)
Are these values constant?
Usually. (But there's 3D formats which use 3 or more different values in one model file.)

Re: Twelvesky2 model files

Posted: Sat Apr 18, 2020 8:15 pm
by Sancje
shakotay2 wrote: Sat Apr 18, 2020 7:48 pm
Sancje wrote: Sat Apr 18, 2020 6:26 pmhi, How did you calculate the FVFsize
There's no general recipe.
Here it's (startAddrFIs - startOfVertices) / vertexCount
(FI= faceIndex)
Getting the startOfVertices is a matter of experience usually.
and UVpos value(76,68) ?
No recipe. Position of float uvs (tx, ty) usually is a multiple of 4, here it's 76 - 8. (8= sizeOfTx + sizeOfTy)
Are these values constant?
Usually. (But there's 3D formats which use 3 or more different values in one model file.)
Getting the startOfVertices is a matter of experience usually.
Thanks for sharing this valuable information with me, it is really helpful. so how can we gain experience? How can I guess? what should be the approach for "Getting the startOfVertices"? is there an easy method ?