Page 1 of 2

Tales of Fantasy

Posted: Fri Jul 08, 2011 2:37 am
by finale00
Homepage & client download: http://tof.igg.com/

Screenshot:

Image

Formats: meshes (skem, sm), textures (qtx), animations (anim)
Notes: each folder of .sm models contains a (plain) text file called "GeomTriList.txt". In it contains a list of entries that resemble the model names and has a number beside it
Caijt_I_Fushi02=116 2006/7/26 13:43:35
Caijt_I_Fushi03=120 2006/7/26 13:43:35
Caijt_I_Jiangshi02=44 2006/7/26 13:43:35
Caijt_I_Mamian02=344 2006/7/26 13:43:37
Cai_I_dunpai2=128 2006/7/26 13:43:37
Cai_I_fazhang01=468 2006/7/26 13:43:49
Cai_I_futou01=242 2006/7/26 13:43:51
Maybe it's the number of faces in the model, but it would be quite annoying to have to parse this file to get it.

Formats don't seem to complicated.
It's just that each property in the vertex struct is grouped sequentially, so it'll say "70 coords" followed by all 70 coords, and then "70 normals" followed by 70 normals, and then "70 UV" followed by 70 UV, etc.

There's a lot of values I'm not sure what they are, though they are all grouped nicely.

For sm files, the groups are

float_3 coords
float_3 ??? (normals?)
float_2 uv
float_3 ???

Two additional groups appear for skem models, which are in a folder called "skelmesh" so presumably these deal with weights and...some other thing.

float_4 ???
float_4 ???

There are also a lot of stuff with the faces as well...no clue what they are.

Don't know what the last 3 might be.
If you run a find-all for the numVerts, you'll get that number.

Samples attached (sm, skem, qtx)

Re: Tales of Fantasy

Posted: Fri Jul 08, 2011 3:00 am
by finale00
Image

Basic geometry has been sorted out.
Now just need to figure out the unknown values and figure out how to deal with the textures.

Re: Tales of Fantasy

Posted: Sat Jul 09, 2011 8:47 am
by Szkaradek123

Code: Select all

format .skem files in game [PC]Tales of Fantasy
dword[a] = 4 bytes*a
word[a]  = 2 bytes*a
float[a] = 4 bytes*a



dword[1] - nBodyPartType(hands,heads,hair,...)
nBodyPartType x {
dword[1] - ?
dword[1] - nBodyPartPerType(hair1,hair2,hair3,...,heads1.heads2,heads3,...)
nBodyPartPerType x {
word[1] - nChar
string[nChar] - name body part
dword[1] - ?
dword[1] - nVertexCoord
nVertexCoord x {
float[3]
}
dword[1] - nUnknow1(normals ?)
nUnknow1 x {
float[3]
}
dword[1] - nUvCoord
nUvCoord x {
float[2]
}
dword[1] - nUnknow2
nUnknow2 x {
float[3]
}
dword[1] - nVertexWeight
nVertexWeight x {
float[4]
}
dword[1] - nVertexIndices
nVertexIndices x {
float[4] as integer[4]
}
dword[1] - nFacesIndices
nFaces = nFacesIndices/3
nFaces x {
word[3]
}
dword[4] - unknow
byte[1]  - unknow
dword[1] - uUnknow3
nUnknow3 x {
word[1]
}
dword[1] - uUnknow4
nUnknow4 x {
dword[3]
}
} - end BodyPartPerType
} - end BodyPartType

=======================================================

format .anim files in game [PC]Tales of Fantasy

dword[1] - nAnimation
nAnimation x {
dword[1] - nBones
dword[1] - nFrames
nBones x {
nFrames x {
float[4] - quat
float[3] - pos
} - end frames
} - end bones
} - end Animation






Re: Tales of Fantasy

Posted: Sat Jul 09, 2011 7:27 pm
by Rimbros
Skara rocks.... :P

Re: Tales of Fantasy

Posted: Mon Jul 11, 2011 2:45 am
by Rimbros
Something advace in load .sm (models) and .qtx Texture files?

Re: Tales of Fantasy

Posted: Mon Jul 11, 2011 3:37 am
by goder2910
Anyway to convert .qtx to png or tga , everyone ? :D

Re: Tales of Fantasy

Posted: Mon Jul 11, 2011 3:47 am
by finale00
viewtopic.php?f=18&t=6936

Chrrox says to just add the header, but I don't know if there's a way to do it automatically.

Also, SM format is very similar to SKEM format except it doesn't have the two structs with 4 floats each, so you can just take out the code that iterates over those two structs. Don't know if he parsed anything else though.

Re: Tales of Fantasy

Posted: Mon Jul 11, 2011 6:22 am
by goder2910
@finale00 Thank for your link. I will try to modify .qtx header :D

Re: Tales of Fantasy

Posted: Mon Jul 11, 2011 9:32 pm
by Rimbros
Something quick.bms to convert the whole textrues to .dds? and conert the models .sm to .skem? cause a lot are sm. Thanks. i read this answer of tosyk abouth fix textures, but how to know the size of the images? 256x256 or 128x128, something area in the texture file tell this?
i search this but i cant found. Also how to changue the header? cause the file its fully encripted and its not posible for me found where the header start and finish.

Image

Re: Tales of Fantasy

Posted: Fri Jul 15, 2011 3:10 am
by finale00
Basically it doesn't have a header. Chrrox gave an example of inserting a dxt1 header and attached it in the graphics thread.

All you really have to do is figure out which bytes represent the dimensions and then actually figure out what the dimensions might be. Use texturefinder to speed up the process and maybe a pattern can be found (load up a qtx file in texturefinder and then switch between dxt1, dxt3, and dxt5. One of them will probably show up fine; that's the type you want. It also gives you the width...seems like the only way to get the height is to export it and then look at it o.O

Though I haven't actually looked into it yet.

Comparing various dds files from various images, it seems like the only things that differ are the dimensions and the dxt type (dxt1, dxt3, dxt5 seem to be the most common so far, based on what kind of information they can store).

So once you get the dimensions, you just have to try each type until the texture looks right I guess.
There might be a pattern in the filename that you could take advantage of, or perhaps some patterns in how textures are assigned in one of the data files in order to automate it, but so far I have not seen any.

Also about SM files, this is the Sanae script that I use
I basically took my SKEM parser and took away a couple loops here and there. Modifying the blender importer would probably be the same.

Re: Tales of Fantasy

Posted: Sat Jul 23, 2011 2:27 am
by Rimbros
Thanks man but this its a very slow way, something idea abouth make bms converter one for each image size? its posible put all the textures in one folder then use bms to convert 128x128 all textures?, and use another bms to convert to redeable texture 256x256 all the textures in one folder?, with preview .dds its posible see in the fact how textures are really 128x128, 256X256 and 512x512, cause open and convert all textures its a crazy job. Bad for me i dont know make .bms files :cry:

Re: Tales of Fantasy

Posted: Sat Jul 23, 2011 3:17 am
by finale00
From what I've read, each pixel format uses a specific number of bits for each pixel. It may be possible to guess which pixel format is used by taking the size of the data and dividing that by the dimensions and then examining the size of each pixel.

But then you don't know what the dimensions are.

I haven't spent much time with graphics files yet.

Re: Tales of Fantasy

Posted: Sat Jul 23, 2011 3:31 am
by CriticalError
[quote="Szkaradek123"][/quote]error with script when execute.

Re: Tales of Fantasy

Posted: Tue Jul 26, 2011 12:40 am
by Rimbros
The textures can come with 3 or 4 variants it think, maybe its posible make the bms to make all the textures with all the variants, 1 of this size variants its right and the others are bad files, if its posible make the batch to convert all the textures to all the posible sizes or formats i think its very easy on this way only see with DDS preview and delete the bad files in windows and keep the right files.

Re: Tales of Fantasy

Posted: Tue Jul 26, 2011 12:50 am
by finale00
The next question would then be, how do we best guess the dimensions based on the filesize.
Use some probabilistic methods and then output 4-5 different variations on top of the pixel format variations?