Page 1 of 2

Exanima 3D models, unknown format

Posted: Wed Jul 28, 2021 9:19 am
by Corus
Hello everyone, this is my first post. I've lurked this website for a while but I think i hit a roadblock with my current project.
I want to make a full set of extraction tools for this game, a hard task since this is an engine made from the ground up with OpenGL.

First I used the existing bms to open the .rpk archives, and it still works perfectly after years of game updates.
You can find it here: http://aluigi.altervista.org/bms/exanima.bms
This left me with various files, the first issue being that there are no extensions to be found inside the archive, but its usually pretty clear.

Textures were confusing at first, but i realized that they are simple DDS, the header data was simply misplaced. I made a quick script to rebuild it to the correct codecs.

I also took a quick look at the other assets, but I'm not that interested right now as my current focus is on 3D models.

So after studying a bit the 3D model files, I started to work on a blender script to import them. For this thread i will use the model in the attachment called "hammer01", with no exension I'm aware of.

The file starts quite simple. You can see that there is a string that represents the name of the asset. The array of bytes that i selected is where the vertices start, while the hex number 29 is the 41 (42) vertices that make up the mesh.
Image
I already managed to import the vertices into blender with no issue, they are a simple list of floats that contain the XYZ coordinates.

After the lists of vertex i encountered another block, its possible that this is the UV maps, but how the floats are structured seems strange to me and couldn't make much sense of it. However you can still see the number that identifies how long the list is going to be.
Image

I skipped some of the data, as it seems like its just material references I'm not interested in.

What seems to be what identifies the triangles is what truly confuses me, as it starts quite normal, but the numbers go much higher than the max vertex index, and ends with repeated numbers. Even if i just select the data that could create some triangles I cant fill the whole mesh and some triangles look misplaced. I tried different configurations and nothing makes sense to me.
Image

Do you know how the triangles could be configured? Can anything be done? Thank you very much in advance.

Re: Exanima 3D models, unknown format

Posted: Wed Jul 28, 2021 2:09 pm
by shakotay2
Like vertices the uvs seem to make sense:
.
hammer01.png
(We'd need the texture to maybe tell more.)

Re: Exanima 3D models, unknown format

Posted: Wed Jul 28, 2021 2:28 pm
by Corus
Hi, this is the diffuse textures.
It seems like it's lazily mapped over generic textures, but this is one of the oldest models in the game. Maybe i can upload another model.
mtliron04
Image
wodod02
Image

Re: Exanima 3D models, unknown format

Posted: Thu Jul 29, 2021 11:33 am
by Corus
I upload another model. The texture here is much better.
Yes the UVs arent hard to read, but i have no idea how where they are related to the vertices, and i still dont understand how to read the faces.
It's almost like the vertices aren't indexed at all since the number goes much higher than the vertex count.
Help would be greatly appreciated.

Re: Exanima 3D models, unknown format

Posted: Thu Jul 29, 2021 12:22 pm
by shakotay2
well, doesn't look too bad:
.
2h_axe.png
Guess you need to use a lesser face index count (15?) for the first sub mesh, then find the start of the next face indices block for the mesh. (For the uvs it's different, max FI is 116 there. )

edit: nope, it's indexed vertices (or to say, there's an additional FIs' block (indices fInd) which is used to create "new" FIs such like FIs[fInd], where FIs is an array of face indices for the vertices for example). Yeah, noobish explanation, but worked for me. :D

Re: Exanima 3D models, unknown format

Posted: Thu Jul 29, 2021 1:00 pm
by shakotay2
Maybe for uvs are indexed are something like that?
Point cloud looks ok:
.
2h_axe_tex.png

Re: Exanima 3D models, unknown format

Posted: Thu Jul 29, 2021 1:07 pm
by Corus
Thank you, but how do i know which vertex the UV point is supposed to be?

Re: Exanima 3D models, unknown format

Posted: Thu Jul 29, 2021 2:02 pm
by Bigchillghost
Using AXE:
2haxe a.png

Re: Exanima 3D models, unknown format

Posted: Thu Jul 29, 2021 2:05 pm
by Corus
Wow, thank you very much dude. That looks perfect. I just need a moment to understand all of that data!

Re: Exanima 3D models, unknown format

Posted: Thu Jul 29, 2021 2:16 pm
by Bigchillghost
With texture applied:
tex_applied.png

Edit: darn! I've just realized that I was using AXE to actually extract an axe! What a coincidence! :D

Re: Exanima 3D models, unknown format

Posted: Thu Jul 29, 2021 10:01 pm
by shakotay2
shakotay2 wrote: Thu Jul 29, 2021 1:00 pmMaybe for uvs are indexed are something like that?
Yep, newbie, and the vertices, too. :roll:

Well, indexed indices. "Data Reorganizer" of AXE is a good idea but too complex for me (and hex2obj - guess I will create/hold all the data in its memory. But no idea how to keep this simple for pos AND uv indexing.)
.
2h_axe_indexed.png

Re: Exanima 3D models, unknown format

Posted: Thu Jul 29, 2021 10:21 pm
by Corus
Yeah, looked impossible at first but the indexing makes sense to me now. It assigns the uv maps to each actual 3d vertex, and the triangles are created on the uvs and geometry at the same time.
Im currently making my own blender importer. Later i will try more complicated models, but should be easy now that I've figured it out.

Re: Exanima 3D models, unknown format

Posted: Fri Jul 30, 2021 1:57 am
by Bigchillghost
shakotay2 wrote: Thu Jul 29, 2021 10:01 pmguess I will create/hold all the data in its memory. But no idea how to keep this simple for pos AND uv indexing.
The overall layout of the geo data is as following:

Code: Select all

long       maxPositionIdx
byte       positions[(maxPositionIdx+1)*12]
long       maxUvIdx
byte       uvs[(maxUvIdx+1)*8]
long       maxVertexIdx
word       posIndices[maxVertexIdx+1]
word       uvIndices[maxVertexIdx+1]
word       posIndices_instance2[maxVertexIdx+1]

long       maxFaceIdx
word       faceIndices[(maxFaceIdx+1)*3]
When you have position and texture coordinates optimized they definitely require individual channels of face indices so if you're writing the coordinate data directly to an obj file, you just need to create the direct position/uv indices respectively. The formula would be

Code: Select all

directPosIdx[i] = posIndices[ faceIndices[i] ]
directUvIdx[i] = uvIndices[ faceIndices[i] ]
Or you just recreate the position and uv buffer to use the face indices directly:

Code: Select all

directPosCoord[i] = positions[ posIndices[i] ]
directUvCoord[i] = uvs[ uvIndices[i] ]

Re: Exanima 3D models, unknown format

Posted: Fri Jul 30, 2021 8:29 am
by shakotay2
Bigchillghost wrote: Fri Jul 30, 2021 1:57 am The formula would be

Code: Select all

directPosIdx[i] = posIndices[ faceIndices[i] ]
...
yeah, that's what I used in my last posted picture.
Or you just recreate the position and uv buffer to use the face indices directly:

Code: Select all

directPosCoord[i] = positions[ posIndices[i] ]
directUvCoord[i] = uvs[ uvIndices[i] ]
That's what you do when creating xxx.out by the "Data Reorganizer", right?
(I'd prefer maintaining the original order of vertices to not lose my overview, ... if any.)

btw: very impressive, your AXE tool. :)

Re: Exanima 3D models, unknown format

Posted: Fri Jul 30, 2021 11:46 am
by Bigchillghost
shakotay2 wrote: Fri Jul 30, 2021 8:29 am yeah, that's what I used in my last posted picture.
So what's it about keeping things simple? :D
shakotay2 wrote: Fri Jul 30, 2021 8:29 am That's what you do when creating xxx.out by the "Data Reorganizer", right?
(I'd prefer maintaining the original order of vertices to not lose my overview, ... if any.)
Yes. It's just that it'd be a complete disaster to introduce
individual indices channels for all vertex attributes, not just for the GUI. Instead, an additional "data reorganizer" will serve well in maintaining the simple and old-fashioned workflow. Besides, it can also be be applied in scenarios like converting a paletted image to ordinary RGBA format.
shakotay2 wrote: Fri Jul 30, 2021 8:29 am btw: very impressive, your AXE tool. :)
Thanks. That's cool. :)