The .rsf meshes

Users who are viewing this thread

Taurandhir

Sergeant
I have almost decrypted the .rsf files. Here's what i found:

Here are the first lines in thirsty_lion.rsf

thirsty_lion2...
.....planks?...x
'O?дЫЇА Qz@

And their hex values:
74 68 69 72 73 74 79 5f 6c 69 6f 6e 32 00 00 00
00 06 00 00 00 70 6c 61 6e 6b 73 3f 00 00 00 78
27 4f 3f e4 db af c0 a0 51 7a 40

I still don't know what thirsty_lion2 shows, but i think that it might indicate the texture

Planks?- Planks is the texture and the hex value of "?", which is 3f, converted in decimal gives the number of vertices.

x'O? - The hex value of this, converted in decimal, gives the x position of the vertex
дЫЇ - This gives its y positon
Qz@ - And this its z position

After the vertices there are some lines that look like this:

›.......яяяя....
..Ђ?....8ї‘>.| А
............яяяя
......Ђ?....·A?
.| А............
яяяя......Ђ?....
€.І>]А–А

9b 00 00 00 00 00 00 00 ff ff ff ff 00 00 00 00
00 00 80 3f 00 00 00 00 38 bf 91 3e 09 7c a0 c0
00 00 00 00 00 00 00 00 01 00 00 00 ff ff ff ff
00 00 00 00 00 00 80 3f 00 00 00 00 b7 7f 41 3f
09 7c a0 c0 00 00 00 00 00 00 00 00 02 00 00 00
ff ff ff ff 00 00 00 00 00 00 80 3f 00 00 00 00
88 11 b2 3e 5d c0 96 c0

I think that these give the textures' scale rotation and coordinates, but i am not sure.

After this there are some lines that i have absolutely no idea what they do.

The problem is that if i change the texture the game crashes with an error. Maybe Armagan can tell me why?
 
I can probably tell you something about what causes the error, but I need to know the exact error text. To be honest, I don't think there's currently all that much point, since Armagan is, as he said, going to release an exporter eventually. Although, if we figured out the model format and wrote one up early, I suppose it wouldn't hurt.
 
It might be nice to be able to read the .rsf file from the editor. That way I could drop down lists of mesh names to choose from. The mesh name is the way it is matched isn't it?

Or is there a better way to go about that?
 
Yeah, it matches by mesh name. I'm working on a routine to read them in now, I've almost finished with it. I think it may be a good idea to start combining our editors after I get this part done, since most of the text files rely on the mesh names from the .rsf files. That is to say, it'd be nice to be able to go to one tab of the editor, add a new shield or armor in, then load up item_kinds1.txt and make a new item via the new mesh you just added. I'll work on the mesh loading, and after we get things the way we like we can merge? I personally don't care about comments or clean code all that much, I'm sure with the relative simplicity of using the .NET stuff we shouldn't have much trouble learning eachothers' code.
 
On merging. How are we going to do that? Without source control I don't relish the idea of merging.

If we keep the tools separate the end user can always just run both. Create mesh in one, click Load in the other, and away they go. I agree that it would more streamlined to have it all in one place, but not if it is going to be a pain merging.

I'm going to release source with version 0.05 (at least that is the plan now). But I may not release that until next week. I've been a bit tied up the last couple days and probably will be until Monday.
 
If i change the planks texture to wall3, the error i get is: "get_material failed for wall3?"
thirsty_lion is the mesh, used by most of the interiors. Maybe the number after that has something to do with the texture?
 
Get_material failed is usually caused by the material not being specified in materials.rsf. Wall3 isn't actually specified, however there is a material called "wall" which uses the wall3.dds file. :wink:
 
I changed it to wall and now it gives me the error "get_material failed for wall?".
Maybe the textures are stored somewhere else?
 
Yes, the question mark's hex value gives the number of vertices, but for some reason the game thinks that it is part of the texture's name.
 
Taurandhir said:
Yes, the question mark's hex value gives the number of vertices, but for some reason the game thinks that it is part of the texture's name.

Before the word "planks" there should be a value specifying how long the word for the texture is. "Wall" is 2 less than "planks" so it's grabbing the ? as well. It's a 1-based number in hex, and is always the 4th byte before a text value such as "wall" or "planks". The 3 bytes before the length byte are usually 0.
 
You are right i didn't notice it :oops: Now i only have to decrypt the texure coordinates and scale and the decrytping of the meshes will be complete.
Unfortunately i know very little about coding, so i won't be able to write an exporter/importer.
 
Tell you what Taurandhir. If you can figure out the mesh format, I'll try my hand at writing an importer/exporter. I'm not nearly as good at figuring out these formats. I know the general layout of the .rsf files though.

Before every text entry there is a byte with its length (4th byte before it, so 04 00 00 00 text). The first byte in the file is the length of the file "type" entry (material, mesh etc.) and the byte immediately following the "type" entry is the number of entries in the file (1 based).
 
Unfortunately even if you write an exporter/importer we won't be able to edit the buildings, towns etc. because they use the manifold files for the colisions, but the other meshes will be editable.
By mesh format do you mean the .rsf file's structure(vertex/texture coordinates)?
 
I mean the meshes within the .rsf files. I already know how the .rsf files work. The mesh files are just "packed" within the .rsf files. Even if we can't edit the buildings, we can edit the items and such in the game, which is pretty cool.
 
I'd like to say I officially support this effort. A lot. Finally I might actually be able to contribute!

Edit: Will character meshes be editable?
 
Back
Top Bottom