The Forum is up for sale: XeNTaX Forum looking for new owner

Aarklash Legacy - Model research

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

Aarklash Legacy - Model research

Post by TaylorMouse »

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: 348
Joined: Mon Sep 26, 2011 12:51 pm
Has thanked: 11 times
Been thanked: 89 times

Re: Aarklash Legacy - Model research

Post by TaylorMouse »

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: 4231
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1139 times
Been thanked: 2222 times

Re: Aarklash Legacy - Model research

Post by shakotay2 »

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.)
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
User avatar
TaylorMouse
ultra-veteran
ultra-veteran
Posts: 348
Joined: Mon Sep 26, 2011 12:51 pm
Has thanked: 11 times
Been thanked: 89 times

Re: Aarklash Legacy - Model research

Post by TaylorMouse »

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: 348
Joined: Mon Sep 26, 2011 12:51 pm
Has thanked: 11 times
Been thanked: 89 times

Re: Aarklash Legacy - Model research

Post by TaylorMouse »

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: 4231
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1139 times
Been thanked: 2222 times

Re: Aarklash Legacy - Model research

Post by shakotay2 »

strange -
these were my nearest hits:
Image

How does the texture file look like?
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
User avatar
TaylorMouse
ultra-veteran
ultra-veteran
Posts: 348
Joined: Mon Sep 26, 2011 12:51 pm
Has thanked: 11 times
Been thanked: 89 times

Re: Aarklash Legacy - Model research

Post by TaylorMouse »

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
ultra-veteran
ultra-veteran
Posts: 460
Joined: Thu Dec 07, 2006 11:25 pm
Has thanked: 9 times
Been thanked: 94 times

Re: Aarklash Legacy - Model research

Post by Karpati »

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
ultra-veteran
ultra-veteran
Posts: 460
Joined: Thu Dec 07, 2006 11:25 pm
Has thanked: 9 times
Been thanked: 94 times

Re: Aarklash Legacy - Model research

Post by Karpati »

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
ultra-veteran
ultra-veteran
Posts: 460
Joined: Thu Dec 07, 2006 11:25 pm
Has thanked: 9 times
Been thanked: 94 times

Re: Aarklash Legacy - Model research

Post by Karpati »

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
ultra-veteran
ultra-veteran
Posts: 460
Joined: Thu Dec 07, 2006 11:25 pm
Has thanked: 9 times
Been thanked: 94 times

Re: Aarklash Legacy - Model research

Post by Karpati »

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: 221
Joined: Sun Jan 18, 2009 1:45 pm
Location: Sagittarius
Has thanked: 299 times
Been thanked: 20 times
Contact:

Re: Aarklash Legacy - Model research

Post by shekofte »

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: 348
Joined: Mon Sep 26, 2011 12:51 pm
Has thanked: 11 times
Been thanked: 89 times

Re: Aarklash Legacy - Model research

Post by TaylorMouse »

interesting, need to check this at home!!

Thnx
T.
Post Reply