Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Dark Souls FLV file

Post questions about game models here, or help out others!
Post Reply
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 »

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: 307 times

Re: Dark Souls FLV file

Post by finale00 »

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 »

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: 307 times

Re: Dark Souls FLV file

Post by finale00 »

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: 307 times

Re: Dark Souls FLV file

Post by finale00 »

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: 307 times

Re: Dark Souls FLV file

Post by finale00 »

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
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: Dark Souls FLV file

Post by howfie »

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: 307 times

Re: Dark Souls FLV file

Post by finale00 »

Hmph, but this is fun :[
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: Dark Souls FLV file

Post by howfie »

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: 307 times

Re: Dark Souls FLV file

Post by finale00 »

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 »

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: 307 times

Re: Dark Souls FLV file

Post by finale00 »

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?
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 »

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: 307 times

Re: Dark Souls FLV file

Post by finale00 »

Are there filenames?
Some textures would be nice.

I didn't parse the material names or anything though.
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 »

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