XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Fri Oct 20, 2017 7:53 am

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 61 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: R2 Online models
PostPosted: Thu Feb 05, 2009 5:16 pm 
Offline
ultra-veteran
ultra-veteran

Joined: Mon Aug 11, 2008 11:30 pm
Posts: 421
Has thanked: 23 times
Have thanks: 13 times
Hi!

In another thread we found tools to open the protected archives for this game. Now I want to know if someone could take a look at the file structure for models to see if we can convert to something useful. Thanks in advance

Here is the thread:

http://forum.xentax.com/viewtopic.php?f=10&t=3255


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Fri Feb 06, 2009 5:21 pm 
Offline
beginner

Joined: Wed Jun 11, 2008 6:49 pm
Posts: 37
Has thanked: 0 time
Have thanks: 4 times
Only had a small time to look at it but this is what I got so far using the same file from the thread posted above:

Code:
file name: c00001.rmb (assuming rmb = model and rab = animation)
DWORD unknown1[6]; // sample file had the first 24 bytes set to 0
DWORD textureCount; // (?) value was 1 - total count for all model/objects in file?
DWORD modelCount; // (?) value was 1 - total count for all model/objects in file?
DWORD boneCount; // value was 9 and matches the number of "Bone##" entries in the .rab file. also position 0x1C had the value of 9 in the .rab file so I'm assuming this is correct.
DWORD dataOffset; // this should be correct as well.
char textureFilename[260]; // file name is 0 terminated and then padded to fit at least 260 bytes (which is the maximum length for a path in Windows)
DWORD unknown2[2]; // no idea what this means, could be file padding, file had the following values: 0x00000000 and 0xFFFFFFFF

// file position: 0x130, contains the word "Box03", will get back to this later since I'm currently at work
char objName[64]; // name/reference or something, 64 bytes long, mainly filled with 0's
char name[64]; // same as above, has the name 'root' but that appears multiple times up to the dataOffset value
DWORD unknown3[2]; // (?) could be the modelCount/textureCount like above for this model/object?
DWORD vertexCount; // should be correct as well
DWORD indexCount; // should be correct

// position 0x1C0 to 0x670 is filled with zeros (no idea why or what this means)
DWORD indexCouint; // again the value is here...

// next 396 bytes are all 0 as well...
DWORD vertexCount; // again the value is here...

// 400 bytes later we get to a value of 0xFFFFFFFF
// now at position 0x998
DWORD count; // no idea. file had the value of 4
DWORD values[count]; // assuming the previous 'count' value means the number of values in some kind of DWORD array. file contained the following values: 1, 2, 5, 8

// 64 bytes later...
// file position 0x9EC
// Bone information!
struct Bone[boneCount] {
    char name[64]; // name of bone
    char parent[64]; // name of parent
    float4x4 matrixInfo[3]; // 3 4x4 matrix structures (pos, scale, rot?)
    DWORD childCount; // ?, possible... or index
    DWORD childrenIndex[]; // something like this
} // this structure is still a bit confusing to me, but I do see some patterns




As mentioned, I'm at work and will get back to this later. I will skip this part though, for now, and start at the data offset position.


Last edited by Theran on Wed Feb 11, 2009 8:17 am, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Fri Feb 06, 2009 5:57 pm 
Offline
beginner

Joined: Wed Jun 11, 2008 6:49 pm
Posts: 37
Has thanked: 0 time
Have thanks: 4 times
Opps..think I got the vertex/index count switched...have a meeting will fix later


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Fri Feb 06, 2009 8:51 pm 
Offline
beginner

Joined: Wed Jun 11, 2008 6:49 pm
Posts: 37
Has thanked: 0 time
Have thanks: 4 times
Ok, fixed the order for the vertex/index count. I've been looking over the data for the vertex data and, although they are floats, the values don't make much sense to me. I haven't found an order for position, uv coords or anything like that yet. The size is 56 bytes in length which consists of 14 float values; based on the data I saw.

Code:
struct vertex {
    float data[14]; // I don't know the exact structure. yet...
}

vertex vertices[vertexCount];


Immediately following the vertex data is what I believe is the bone weight list. Seems to be a group of 4 floats for each vertex. In the sample file, there were 140 vertex. 140 * 4 * 4 = 2240 bytes, which works out well for this file.

Code:
struct boneWeights {
    float weights[4]; // bone weights? only saw 3 values: 0, 1, 0.5
}

boneWeights weights[vertexCount];


After this seems to be another list of data for each vertex. It's either a list of 2 DWORD values or 4 WORD values. I do not know what this represents.

This brings us to the last 1032 bytes of the file, which represent the index values. Which fits nicely since this file had a value of 516 for indexCount, which gives us 516 WORD pair values totaling 1032 bytes.

Code:
WORD indices[indexCount];


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Sat Feb 07, 2009 2:01 am 
Offline
ultra-veteran
ultra-veteran

Joined: Mon Aug 11, 2008 11:30 pm
Posts: 421
Has thanked: 23 times
Have thanks: 13 times
hm, I am very glad that you started to look at these files. I can in no way help you out when it comes to hexing this so I just hold my thumbs. I looked at the archives and there is no other file format then the ones i provided.

I wish you good luck and hope to see some results

Thanks


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Sat Feb 07, 2009 5:22 am 
Offline
beginner

Joined: Wed Jun 11, 2008 6:49 pm
Posts: 37
Has thanked: 0 time
Have thanks: 4 times
Ya, I'll take a look at it this weekend now that I have more files to look at.


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Sat Feb 07, 2009 9:14 am 
Online
Site Admin
User avatar

Joined: Wed Jan 15, 2003 6:45 pm
Posts: 4012
Location: Dungeons of Doom
Has thanked: 411 times
Have thanks: 551 times
Nice going, Theran! :D

_________________
Please like our Facebook page!


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Mon Feb 09, 2009 3:25 am 
Offline
beginner

Joined: Wed Jun 11, 2008 6:49 pm
Posts: 37
Has thanked: 0 time
Have thanks: 4 times
So I had a thought earlier today while looking at a different file from R2. I'm thinking the vertex data section is in itself in sections. Meaning that the first section is all the position elements (vertexCount * 3 * 4), then follows normals (vertexCount * 3 * 4), uv coords, etc...

I'm still taking a look at them but having it in this way makes a bit more sense with the values. Now I could be wrong on the order since I haven't had a chance to put any of the values into a simple 3d application.

Will need to test this out a bit more, but this layout makes some sense.


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Mon Feb 09, 2009 7:29 pm 
Offline
beginner

Joined: Wed Jun 11, 2008 6:49 pm
Posts: 37
Has thanked: 0 time
Have thanks: 4 times
Ok, does seem to be in a format like I mentioned. Vertex positional data is first, but after that I don't know. It could be normals, followed by the uv's, but I need to get the texture for it so that'll be something I'll do tonight.

I'm attaching some images for what I got so far. The first image is using what I believe to be the normal values. The second image is using computed normals.
Images rendered with OpenGL

Edit: Seems I can only do one attached file at a time, so next post will have the second image.


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Mon Feb 09, 2009 7:30 pm 
Offline
beginner

Joined: Wed Jun 11, 2008 6:49 pm
Posts: 37
Has thanked: 0 time
Have thanks: 4 times
And here's the second:


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Mon Feb 09, 2009 7:47 pm 
Offline
Moderator
User avatar

Joined: Sun May 18, 2008 3:01 pm
Posts: 2433
Has thanked: 56 times
Have thanks: 1185 times
Wow that is great news you are so close to having a model viewer.
Thanks for all your hard work on this project.


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Mon Feb 09, 2009 8:44 pm 
Offline
beginner

Joined: Wed Jun 11, 2008 6:49 pm
Posts: 37
Has thanked: 0 time
Have thanks: 4 times
It's definitely a good start, but there's still a lot of info in there that we still don't know yet but we'll get there.


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Mon Feb 09, 2009 9:52 pm 
Offline
ultra-veteran
ultra-veteran

Joined: Mon Aug 11, 2008 11:30 pm
Posts: 421
Has thanked: 23 times
Have thanks: 13 times
Yeah definitly cool! I saw that objects in game have another format. .r3m

I wonder if a model + texture of a static object would make things easier?

I provide the easist i can see:

R_danger_Alpha.r3m 2kb
R_danger_Alpha.dds 1kb


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Mon Feb 09, 2009 11:08 pm 
Offline
beginner

Joined: Wed Jun 11, 2008 6:49 pm
Posts: 37
Has thanked: 0 time
Have thanks: 4 times
Ya, I saw some of those as well. I will check tomorrow since I'm getting attacked by my allergies today and heading home.


Top
 Profile  
 
 Post subject: Re: R2 Online models
PostPosted: Mon Feb 09, 2009 11:16 pm 
Online
Site Admin
User avatar

Joined: Wed Jan 15, 2003 6:45 pm
Posts: 4012
Location: Dungeons of Doom
Has thanked: 411 times
Have thanks: 551 times
Offtopic: Your allergies? What up? I've got all kinds, though, basically allergic to all kinds of stuff, what are yours?

_________________
Please like our Facebook page!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 61 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: liuxing and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group