Aarklash Legacy - Model research

Post questions about game models here, or help out others!
Post Reply
User avatar
TaylorMouse
ultra-veteran
ultra-veteran
Posts: 367
Joined: Mon Sep 26, 2011 12:51 pm
Has thanked: 13 times
Been thanked: 125 times

Aarklash Legacy - Model research

Post by TaylorMouse » Wed Dec 18, 2013 11:39 pm

Hi guys, been a while, so I got this new game from Steam and looked at the model files (.cef)

I used C# to render it using DirectX but I got this problem :(

Image

and here is the code:

Code: Select all

            CustomMesh cMesh = new CustomMesh();
            using (BinaryReader br = new BinaryReader(new FileStream(fileName, FileMode.Open, FileAccess.Read)))
            {
                char[] cef = br.ReadChars(3);
                br.Seek(99);

                string modelName = br.ReadStringZeroEnded();
                br.ReadBytes(133);

                string position = br.ReadStringZeroEnded();
                br.ReadBytes(35);

                long pos = br.BaseStream.Position;

                string blendWeight = br.ReadStringZeroEnded();

                if (blendWeight == "BLENDWEIGHT")
                    return null; // todo --> followed by BLENDINDICES
                else
                    br.Seek(pos);

                // pos 296 7944 bytes 1986 floats 662 vertices
                int vertSize = br.ReadUInt16();
                br.ReadBytes(16);
                List<Vector3> vertices = new List<Vector3>();
                for (int i = 0; i < vertSize / 12; i++)
                {
                    var x = br.ReadFloat();
                    var y = br.ReadFloat();
                    var z = br.ReadFloat();
                    vertices.Add(new Vector3(x, z, y));
                }
                cMesh.Vertices = vertices;
                
                // pos 8326 3768 bytes 1884 ints 628 faces
                br.ReadBytes(24);
                string indice = br.ReadStringZeroEnded();
                br.ReadBytes(37);
                int indexSize = br.ReadUInt16();
                br.ReadBytes(16);
                int[] indices = new int[indexSize / 2];
                for (int i = 0; i < indices.Length; i++)
                {
                    indices[i] = br.ReadUInt16();
                }
                cMesh.Indices = indices;
                br.Close();
            }
            return cMesh;
any help is more than welcome

T.
You do not have the required permissions to view the files attached to this post.

User avatar
TaylorMouse
ultra-veteran
ultra-veteran
Posts: 367
Joined: Mon Sep 26, 2011 12:51 pm
Has thanked: 13 times
Been thanked: 125 times

Re: Aarklash Legacy - Model research

Post by TaylorMouse » Wed Dec 18, 2013 11:41 pm

Here is the actual file
You do not have the required permissions to view the files attached to this post.

User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 2631
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 648 times
Been thanked: 1352 times

Re: Aarklash Legacy - Model research

Post by shakotay2 » Thu Dec 19, 2013 12:00 am

what is the problem? The shape? Or the texturing?

I loaded your sample in hex2obj:
Image

This is the H2O file:
0x2098 1884
VB0
0x0
0x13A 662
0200

(Didn't look for uv data.)
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

User avatar
TaylorMouse
ultra-veteran
ultra-veteran
Posts: 367
Joined: Mon Sep 26, 2011 12:51 pm
Has thanked: 13 times
Been thanked: 125 times

Re: Aarklash Legacy - Model research

Post by TaylorMouse » Thu Dec 19, 2013 12:01 am

Found the problem when I was doing some refactoring..

DirectX doesn't like the indices of the format int[], so it needs to be short[], then it works :)

so in the code you need to change this line:

Code: Select all

int[] indices = new int[indexSize / 2];
with

Code: Select all

short[] indices = new short[indexSize / 2];
and this one:

Code: Select all

indices[i] = br.ReadUInt16();
with:

Code: Select all

indices[i] = br.ReadInt16();
T.
You do not have the required permissions to view the files attached to this post.

User avatar
TaylorMouse
ultra-veteran
ultra-veteran
Posts: 367
Joined: Mon Sep 26, 2011 12:51 pm
Has thanked: 13 times
Been thanked: 125 times

Re: Aarklash Legacy - Model research

Post by TaylorMouse » Sat Dec 21, 2013 11:16 am

Darn, 2 days and I don't seem to be able to figure out these texture coordinates..

some more help plz ?

T.

User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 2631
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 648 times
Been thanked: 1352 times

Re: Aarklash Legacy - Model research

Post by shakotay2 » Sat Dec 21, 2013 5:57 pm

strange -
these were my nearest hits:
Image

How does the texture file look like?
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

User avatar
TaylorMouse
ultra-veteran
ultra-veteran
Posts: 367
Joined: Mon Sep 26, 2011 12:51 pm
Has thanked: 13 times
Been thanked: 125 times

Re: Aarklash Legacy - Model research

Post by TaylorMouse » Sun Dec 22, 2013 1:28 pm

I needed to reduce the size of the texture, normally it is a dds file of 2.7MB

I believe the weapon is unwrapped in the upper right corner, so I think your unwrapping is not correct, yet :p

Don't worry I'm still looking at it as well, no luck either, thanks for the help already

T.
You do not have the required permissions to view the files attached to this post.

Karpati
mega-veteran
mega-veteran
Posts: 303
Joined: Thu Dec 07, 2006 11:25 pm
Has thanked: 7 times
Been thanked: 58 times

Re: Aarklash Legacy - Model research

Post by Karpati » Fri Jan 17, 2014 8:51 am

TaylorMouse,

I did find the UV datas in the .cef file. See the attached .obj file.
You do not have the required permissions to view the files attached to this post.

Karpati
mega-veteran
mega-veteran
Posts: 303
Joined: Thu Dec 07, 2006 11:25 pm
Has thanked: 7 times
Been thanked: 58 times

Re: Aarklash Legacy - Model research

Post by Karpati » Fri Jan 17, 2014 8:59 am

How to get the UV datas?

File offset: $2FEC
Data block: TEXCOORD

- read the 'TEXCOORD'
- skip the next 36 bytes
- UV Vertex Size = Read Long / Vertices
- skip the next 14 bytes

UV vertex size of the your sample file: $28

UV data block:
- 20 bytes unknown
- U: 4 bytes Float
- V: 4 bytes Float

Karpati
mega-veteran
mega-veteran
Posts: 303
Joined: Thu Dec 07, 2006 11:25 pm
Has thanked: 7 times
Been thanked: 58 times

Re: Aarklash Legacy - Model research

Post by Karpati » Fri Jan 17, 2014 9:11 am

I added the .cef loader module to the 3D Object Converter and I will upload it to my web page from my home.

I don't understand why has the .cef file invalid texture file name.
bad: Golem_DFF.tga
valid: golem_dff_3d403ec7.dds

Karpati
mega-veteran
mega-veteran
Posts: 303
Joined: Thu Dec 07, 2006 11:25 pm
Has thanked: 7 times
Been thanked: 58 times

Re: Aarklash Legacy - Model research

Post by Karpati » Tue Jan 21, 2014 9:15 am

I uploaded this (Aarklash Legacy support) version to my web page:
http://3doc.i3dconverter.com/downloads/ ... rtable.zip

User avatar
shekofte
mega-veteran
mega-veteran
Posts: 218
Joined: Sun Jan 18, 2009 1:45 pm
Location: Sagittarius
Has thanked: 236 times
Been thanked: 12 times
Contact:

Re: Aarklash Legacy - Model research

Post by shekofte » Tue Jan 21, 2014 11:16 am

Karpati
it would be nice to see your activity a part of us out here
ILLUSORY VIDEO GAMES ARE MORE IMPORTANT THAN PRECIOUS INTERNATIONAL FOOTBALLs

User avatar
TaylorMouse
ultra-veteran
ultra-veteran
Posts: 367
Joined: Mon Sep 26, 2011 12:51 pm
Has thanked: 13 times
Been thanked: 125 times

Re: Aarklash Legacy - Model research

Post by TaylorMouse » Tue Jan 21, 2014 8:17 pm

interesting, need to check this at home!!

Thnx
T.

Post Reply