Page 4 of 5

Re: R2 Online models

Posted: Mon Feb 23, 2009 8:46 pm
by chrrox
I added the keys e, d , r, f to add more movement freedom.
I am going to work on mouse movement I feel I am close to getting it down.
I am also trying out some ideas for menu selection in another form to set the directory
then get lists of all the models and separate them into categories based on names ex head parts, npc, items.

Re: R2 Online models

Posted: Tue Mar 10, 2009 10:15 pm
by Theran
Made some progress with the r3m files loaded in the Objects.rfs (static objects) file.

Most share a common name, w1_monster_001.r3m, w1_monster_002.r3m, ..., w1_monster_006.r3m, which make up complete model. So far, having good luck with getting them to view properly. Each r3m file can contain a number of sub objects in them, usually 1 object per texture. So a complete model consists of multiple r3m files (meshes), each with a multiple number of sub objects (1 per texture?).

I haven't gotten the textures to work just yet, but I'll try to get that in the next day or so. So for now, here's a screen shot of what I got:

Model uses the following files:

Re: R2 Online models

Posted: Tue Mar 10, 2009 10:54 pm
by chrrox
Very nice work on the static meshes.
Do you know of any open source obj exporters out there i can try to add that export option if I can find an example.

Re: R2 Online models

Posted: Tue Mar 10, 2009 11:10 pm
by Theran
chrrox wrote:Do you know of any open source obj exporters out there i can try to add that export option if I can find an example.
No I do not, but this site has the basic structure for OBJ files:

Re: R2 Online models

Posted: Tue Mar 10, 2009 11:30 pm
by pixellegolas
this is getting really interesting! just hoping for animation and all that glory too :)

Re: R2 Online models

Posted: Wed Mar 11, 2009 8:35 am
by Theran
Got textures working, it's looking pretty good!

Re: R2 Online models

Posted: Wed Mar 11, 2009 1:00 pm
by pixellegolas
it sure does :) Is it also specular and such?

Re: R2 Online models

Posted: Wed Mar 11, 2009 5:16 pm
by Theran
pixellegolas wrote:it sure does :) Is it also specular and such?
Maybe? lol :lol:

I'm still learning the basics of doing lighting and such with OpenGL. Currently it does ambient and diffuse lighting, but that's about it. Though I believe you're referring to specular textures ya? If so, I believe for this particular model, all the textures are normal kind (sorry if that doesn't make sense, I'm still learning the lingo).

Re: R2 Online models

Posted: Wed Mar 11, 2009 5:38 pm
by pixellegolas
most models are like this:

Diffuse map: the normal map that you refer to. It is the models texture to give it color

Normal map: Is like a bump-map that makes certain parts stick out or in to add detail without actually adding polygons. Used in example gears of war alot

Specular map: Special map that tells the engine where to add specularity when a light hits the surface. Instead of using a engine specific specularity all over a model you decide how the specularity will look on a model.

If you have a model that has clothes on like jeans you don't want the jeans to reflect like it would be metal, but you want the belt to, then you add specularity to belt only

Glow map: Makes certain areas of model glow. If you have helmet and want to make visor glow, you add a map where you only add color where visor is, that area will glow

These are the most used ones

Re: R2 Online models

Posted: Wed Mar 11, 2009 6:00 pm
by Theran
Ah, then no, it only uses diffuse maps. Got a bit of work to do today but I'm adding in some options for changing the lighting of the model (giving it diffuse, ambient, specular, shininess properties) to make it look more real like. So I'll get that done by tonight. So by this weekend I'll release another app for just r3m files as well as the overall format of the file which is about 80% done.

Think I only need to check the rfs files for any kind of XML format so I can tell which files to load for a specific model, the one pictured is a combination of 5 r3m files. I know the rmb files had something similar so I'm hoping these do as well.

Re: R2 Online models

Posted: Tue Mar 17, 2009 7:16 pm
by Theran
So I totally forgot I had to go out of town this weekend so I wasn't able to upload any files but I'm back today and I bring files!

Sample was built using Microsoft Visual C# 2008 Express Edition and CsGL ( You'll need to download the CsGL package and run the batch file to install the necessary files.

As for the format, here's the basic structure:

Code: Select all

dword unk1;
dword nTextureCount; // number of textures used by this model
dword unk2; 
floatx3 max; // bounding box max pos
floatx3 min; // bounding box min pos
// note the source file I updated has these switched for some reason...correct order is max, then min.

string textureNames[nTextureCount]; // array of texture names used by this file, string names are variable length, null terminated.
// some data is contained after the string name but I never found any solid info from it, so I just skipped it, about 50/50 it's either random data or empty data
dword nFlag; // describes the type of model layout, values (271, 1295, 1311)
dword nObjCount; // number of objects in this model, generally nTextureCount = nObjCount
dword nVertexCount; // number of total vertices
dword nIndexCount; number of indices

// meshInfo describes the way how many vertices and indices are used by the current object/texture as well as their offsets
struct meshInfo {
    dword nVertextCount; // number of vertices used
    dword nIndexCount; // number of indices used
    dword nVertexStart; // starting offset for vertices
    dword nIndexStart; // starting offset for indices
} info[nObjCount];

floatx3 pos[nVertexCount];
floatx3 normal[nVertexCount];
dword color[nVertexCount]; // color perhaps? only used when nFlag = 1311
floatx2 uv[nVertexCount];
flaotx2 uv2[nVertexCount]; // second set of uv coords? used when nFlag = 1295 & 1311
floatx3 unk1[nVertexCount];
floatx3 unk2[nVertexCount]; // both unk1 and unk2 are in all layouts, like rmb files, no idea what it represents

short indices[nIndexCount]; // index layout

Re: R2 Online models

Posted: Tue Mar 17, 2009 9:25 pm
by Theran
Realized I forgot to mention how the app works.

Keys: 1-8, 0 (changes lighting)
Uses the movement keys defined by chrrox with some minor modifications.

Since I've been unable to find any kind of file that lists which files create an entire model, I was simply just coping the ones that had similar names into a directory (defined by 'path' in the application). Likewise, I had all the textures from the Objects.rfs (in the texture/Object folder, defined in 'tpath' in the application).

I choose this since I could easily copy/paste tested files over to a sample directory and the application would just load them all.

Every now and then there will be a file that cannot be loaded, generally has an "_L" or "_light" in the file name, this refers to what I believe is a lighting file (still with r3m extension) and is structured like so:

Code: Select all

dword count; // number of lights
struct light {
    floatx3 pos; // light position
    floatx3 color; // color? diffuse maybe?
    float f1; // float value: ranges from 1-5, power? 
    float f2; // float value: range? attenuation?
    float f3; // float value: range? attenuation? (I think always greater then f2) 
} lights[count];
If anyone can help with this let us know.

I think that explains the application as far as I can tell. I think I got everything now.

Re: R2 Online models

Posted: Mon Oct 02, 2017 2:39 pm
by jarrro
guys, how do you export the model from .rmb?

Re: R2 Online models

Posted: Mon Oct 02, 2017 6:23 pm
by Karpati
jarrro wrote:guys, how do you export the model from .rmb?
One solution is the 3D Object Converter for Windows

Second ones is the i3DConverter (macOS)

I am using the XNALara Binary .mesh export format as a 'gateway' to transfer the fully textured objects (with Bone information) to the 3D Studio Max.

You can download the Importer/Exporter script from this web page:

1. First time you must copy the "XnaLara" file into your installed 3D Studio Max Scripts folder.
2. Run your 3D Studio MAX

3. Open your .mgm file with 3D O.C.
4. Export the loaded object as XNALara Binary .mesh format.

5. Run your "XnaLara" script using the MAXScript/Run Script... menuitem.
6. Press the Import button on the XNALara Converter window.
7. Browse the converted .mesh file.

Re: R2 Online models

Posted: Mon Oct 02, 2017 6:25 pm
by Karpati
To avoid the forum message: Cannot add another attachment, 1 is the maximum