Page 1 of 1

Viking Battle for Asgard models

Posted: Sat Nov 13, 2010 5:48 pm
by Alek Sander
Hi all! I'm new here and so on and etc... :)
I know the game isn't that popular, but I want to get the models from it + some understanding about 3d file format. It's more like a challenge for me (my first).

So, the models are packed in CHR_MDLS.PAK file, for which I've made a BSM script.

I've got 4 types of files:
BNS - bone structure?
COL - collision? the file has something in it only for the player model though.
DNH - have no idea, but it isn't present for all the models
SKIN - model itself, I guess...

Here is my understanding of SKIN files so far (please, don't laugh :))

Code: Select all

long	skmh
long	number of segm?
word	number of segm?
word	??? same for all
long	??? same for all

long	segm
long	number of connections between vertexes?
long	number of vertexes
long	??? not same for all

long	??? same for all
long	number of bytes per description block?
long	dummy?
long	(sometimes) 1/3 of the 8th byte in each point description block
So, a vertex is described by 18 bytes. And here I'm lost. There is no correct float value for a coordinate - it's either too big (like +38) or too small (-20). Maybe they are using half-precision here... Plus I don't know (understand) if there are normals and uv-coords, weights and other 3d data...
Here I need help!

Re: Viking Battle for Asgard models

Posted: Sun Nov 14, 2010 6:54 am
by Alek Sander
A little update:
A vertex is described by 24 bytes, not by 18. (it's 0x18=24)
At the end of file i think there are indices, but they are a bit strange.

Re: Viking Battle for Asgard models

Posted: Tue Nov 16, 2010 4:23 pm
by Karpati
What's about the converted files ?

Re: Viking Battle for Asgard models

Posted: Tue Nov 16, 2010 6:45 pm
by Alek Sander
Karpati wrote:What's about the converted files ?
What do you mean?
I see you've made nice progress! But I wanted somebody to help me by actually explaining those moment I don't understand. :)
Thanks for converted files! I've already understood the formation of faces. Trying to see the vertexes...

Re: Viking Battle for Asgard models

Posted: Tue Nov 16, 2010 7:47 pm
by Karpati
Do you have the texture files for your sample files ?

Can you send me some other sample files to [email protected] ?
(I don't have this game and I would like to test my loader module with other files.)

Re: Viking Battle for Asgard models

Posted: Tue Nov 16, 2010 7:50 pm
by Karpati
Alek Sander wrote:A little update:
A vertex is described by 24 bytes, not by 18. (it's 0x18=24)
The vertex coords are 2 byte integers.

Re: Viking Battle for Asgard models

Posted: Wed Nov 17, 2010 5:53 pm
by Alek Sander
Karpati wrote:Do you have the texture files for your sample files ?

Can you send me some other sample files to [email protected] ?
(I don't have this game and I would like to test my loader module with other files.)
Sending all the models I extracted from the game (9 Mb)... But I didn't find any textures, like at all! I'll get the image of the game tomorrow and will look harder.

The player model that you've converted doesn't look like the player, you know. It should look like a man. Maybe there is some clue on dimensions inside the model file?
And where did you take the .mtl description?
Image

Re: Viking Battle for Asgard models

Posted: Wed Nov 17, 2010 6:43 pm
by Alek Sander
Karpati wrote:The vertex coords are 2 byte integers.
In your converted models you add 1000 to the X coord for each vertex. Maybe that is the reason model of the player doesn't look right?
And what about vt (vertex textures)? How do you calculate them?

Re: Viking Battle for Asgard models

Posted: Wed Nov 17, 2010 7:08 pm
by Karpati
Sending all the models I extracted from the game (9 Mb)... But I didn't find any textures, like at all! I'll get the image of the game tomorrow and will look harder.

The player model that you've converted doesn't look like the player, you know. It should look like a man. Maybe there is some clue on dimensions inside the model file?
Thank you for your sample files I received it successfully.

The vertex size=24 works on the other models like swords, shields (geom is OK; UV is OK), but does not work on the player model (geom is not OK; UV is OK).

I don't understand why ?

Re: Viking Battle for Asgard models

Posted: Wed Nov 17, 2010 9:34 pm
by Karpati
In your converted models you add 1000 to the X coord for each vertex. Maybe that is the reason model of the player doesn't look right?
And what about vt (vertex textures)? How do you calculate them?
You have right, I used that temporally to separate the different submodels.

How to get the UV-s (vertex size=24):

X,Y,Z: 2 bytes Integer
skip the next 7*2 bytes
U=2 bytes Word/8192
V=2 bytes Word/8192
skip the remaining bytes

Re: Viking Battle for Asgard models

Posted: Wed Nov 17, 2010 11:42 pm
by Alek Sander
Look at the player model, the 3rd and 4th submodel (segm part). The vertex size here is not 24, but 44.
Why to divide UV by 8192? Where did you get that number? (Sorry for these lame questions :))

Re: Viking Battle for Asgard models

Posted: Thu Nov 18, 2010 6:58 am
by Karpati
Alek Sander wrote:Look at the player model, the 3rd and 4th submodel (segm part). The vertex size here is not 24, but 44.
I know that...
Alek Sander wrote:Why to divide UV by 8192? Where did you get that number?
It stores the 'float' UV on the non float type (word/word ---> float). I checked out the UV datas by my Unwrap UV function and I 'dreamed' this value.