Offtopic: Into Commodore 64 (6502) coding, pixeling or music?
Xentax is looking for new members for the C64 activities!
Just drop us a message at forum@xentax.com and join the Scene Team!

Forum rules: Click here

Dark Souls FLV file

Post questions about game models here, or help out others!
Post Reply
User avatar
hatyn
advanced
Posts: 47
Joined: Fri Dec 16, 2011 8:30 pm
Has thanked: 2 times
Been thanked: 3 times

Dark Souls FLV file

Post by hatyn » Sat Dec 17, 2011 4:02 pm

Hi there my grossly incandescent cooperators. Of course I have no idea what is what but I would like your expert opinions about the file format used by Dark Souls for its 3D models.

It is of course hard for me to say if these are parts, whole models, archived animation and bones, etc, but here is one smallish file. http://xis9.com/000000ef.flv

finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 296 times

Re: Dark Souls FLV file

Post by finale00 » Mon Feb 13, 2012 10:18 pm

Script: http://db.tt/GwzbET08

Wasn't there another FLVER thread. Anyways, this format is big endian.
The offset to the indices section (followed by vert buffer) is given, but I don't really understand the indices.

You keep reading shorts until you see a -1. Then that is a face I guess.
Sometimes you read 3 indices.
Sometimes you read 4 indices.
Sometimes you read 5 or even 6 indices before you see a -1.

Are there any common schemes that do that?

The vertex buffer comes right after the index buffer, 36 bytes each.
I'll have to wait until I figure out how to bind buffers in big endian before I can verify that it is correct before proceeding.
Last edited by finale00 on Mon Feb 20, 2012 1:04 am, edited 1 time in total.

Phrexeus
n00b
Posts: 11
Joined: Wed Jan 04, 2012 3:43 am
Has thanked: 4 times
Been thanked: 1 time

Re: Dark Souls FLV file

Post by Phrexeus » Tue Feb 14, 2012 9:23 pm

Also interested in this. The flver files seem to be different for dark souls. Looking at the files in a hex editor, I can't make much sense of them, but then I'm pretty noob to this. The ascii looks nothing like numeric coordinates, but I'm probably just going about it in the wrong way.

finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 296 times

Re: Dark Souls FLV file

Post by finale00 » Wed Feb 15, 2012 1:12 am

Be careful with some of the strings because they use 2 bytes per character and most of it is just file paths and stuff rather than an index buffer.

At first if you sort of just skim through the format it looks like an index buffer but then if you look at what it represents you'll see it and move on quickly lol

finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 296 times

Re: Dark Souls FLV file

Post by finale00 » Sun Feb 19, 2012 9:48 pm

The files I'm working with are for Dark Soul 1 that hatyn uploaded in another thread
viewtopic.php?p=65301#p65301

It looks like the FLVER format is about the same for dark soul 2 and armored core. I might look at the FLVER import that was written. It might just be a different type.

Just some findings.

In general, you have something like

Code: Select all

Header, containing numMesh and other info
numMesh MeshInfo, providing info like numVerts, vertSize and stuff
numMesh MeshData, with the indices and vertices
Where MeshData appears to be face indices, followed by vertices, and repeat.

The header you can base it on the blender import for the other FLVER format. It is pretty much the same thing.

Code: Select all

struct Header {
   char[6] "FLVER\x00"
   int16[3] ??
   int32 offset to start of mesh data
   int32 size of the mesh data
   int32 numBones?
   int32 numMat
   int32 numParts?
   int32 numMesh
   int32 count
   float[6] bbox?
   
   ....
} 
I don't know when the header ends.

I've found sections of the mesh info that provide vert counts and vert sizes, as well as offsets to the vertex data. All offsets are relative to the start of the mesh data (the one you read in the header)

finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 296 times

Re: Dark Souls FLV file

Post by finale00 » Sun Feb 19, 2012 11:51 pm

Ok I've gotten the general structure of the format out using the blender import for reference.

I will need FLVER files for all of the games that were listed (some gundam games were there...)

There are several different types of FLVER formats, which is determined by one (or more) of the values at the very top.

DS1 and DS2 both use the same format, however Armored Core has a different format. Some of the structs are the same, but for example in armored core I haven't figured out the entries for the vertices (numVerts, vertSize, vertOfs, etc)

For now I will focus on the dark soul format.

Image

Script permalink: http://db.tt/GwzbET08

User avatar
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 9 times
Been thanked: 263 times

Re: Dark Souls FLV file

Post by howfie » Mon Feb 20, 2012 12:04 am

finale00, stop right now. go out and find yourself a nice woman and have some fun for a change lol.

finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 296 times

Re: Dark Souls FLV file

Post by finale00 » Mon Feb 20, 2012 12:08 am

Hmph, but this is fun :[

User avatar
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 9 times
Been thanked: 263 times

Re: Dark Souls FLV file

Post by howfie » Mon Feb 20, 2012 12:11 am

i'm just kidding with you :-P.

finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 296 times

Re: Dark Souls FLV file

Post by finale00 » Mon Feb 20, 2012 1:03 am

Wow noesis took that ugly face indexing scheme with all sorts of twists and turns and changing directions into a single call.

Image

Phrexeus
n00b
Posts: 11
Joined: Wed Jan 04, 2012 3:43 am
Has thanked: 4 times
Been thanked: 1 time

Re: Dark Souls FLV file

Post by Phrexeus » Wed Feb 22, 2012 1:13 am

Mother of God...... Finale, you're doing it... awesome!!!! You got Ornstein as well, one of the coolest bosses. I haven't got any of the armored core, gundam files, but hatyn might. I have half of the dark souls stuff extracted though, the rest is still in an archive that current script from chrrox doesn't open.

I will play with your script tomorrow when i get on my main PC. Assuming all the models can be imported fine, is it likely to be straight forward to link the texture files to the 3D files automatically? And will UVs be preserved? I might be able to work some of this stuff out myself, but you should keep going with your greater speed and experience.

finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 296 times

Re: Dark Souls FLV file

Post by finale00 » Wed Feb 22, 2012 1:31 am

I didn't assign the UV's cause I don't have textures to test with, but the vert buffer is there so you just need to add one line to add the UV's.

Well, there's 5 vertex types so you'll probably have to add one line for each.
There's one vertex struct that's only 28 bytes....don't know what the other 4 floats might be.

I'm not sure if the materials are assigned per mesh or per face-group or per face.
Right now it should load each mesh separately. I also don't remember seeing any texture names...are they referenced separately?

User avatar
hatyn
advanced
Posts: 47
Joined: Fri Dec 16, 2011 8:30 pm
Has thanked: 2 times
Been thanked: 3 times

Re: Dark Souls FLV file

Post by hatyn » Sat Feb 25, 2012 11:31 pm

OH SNAP... im off to use this..bbl!

finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 296 times

Re: Dark Souls FLV file

Post by finale00 » Sat Feb 25, 2012 11:51 pm

Are there filenames?
Some textures would be nice.

I didn't parse the material names or anything though.

User avatar
hatyn
advanced
Posts: 47
Joined: Fri Dec 16, 2011 8:30 pm
Has thanked: 2 times
Been thanked: 3 times

Re: Dark Souls FLV file

Post by hatyn » Sun Feb 26, 2012 12:04 am

The TPFs we got are named very simple like 000000ea.TPF or something, and I don't think they actually match up the names of the textures that the model is bound to in the FLV.

I seem to be getting some errors with the FLVER import..
Image
exported from noesis

Image
inside noesis

Post Reply