|
You last visited: Today at 12:00
Advertisement
[WIP] Silkroad File Formats (.bsr .bms .bmt .bsk .ban )
Discussion on [WIP] Silkroad File Formats (.bsr .bms .bmt .bsk .ban ) within the SRO Coding Corner forum part of the Silkroad Online category.
07/10/2012, 16:05
|
#1
|
elite*gold: 0
Join Date: May 2009
Posts: 67
Received Thanks: 37
|
[WIP] Silkroad File Formats (.bsr .bms .bmt .bsk .ban )
I'm currently trying to work out some of the different structures of the files within the pk2's
.bsr Resource file. References meshes, materials, animations, skeletons etc.
.bms Meshes
.bmt Material file that references different .ddj textures
.ban Animation
.bsk Skeleton
.bsr Structure
Code:
12 byte Header
52 byte unknown. Havnt look into those
int bsrType; ranges from 0x20000 to 0x20006 (could be more)
string bsrTitle;
From here on out they seem to differ depending on their bsrType
28 byte unknown
string meshReference Not in every .bsr. References a .bms file. Although the .bms file referenfces come later.
float[2,6] boundingBox; outlines the mesh
int unknown;
int bmtFileCount;
int unknown;
string[btmFileCount] paths to the different materials used on the model
int bmsFileCount;
string[bmsFileCount] paths to the different meshes used
int unknown
int unknown
int banFileCount;
string[banFileCount] paths to the different animation files
int bskFileCount; should be 1 for most models
string[bskFileCount] path to the skeleton files.
this is how far im parsing these files right now
.bms Structure
Code:
12 Bytes header
int index; position in the stream where the vertex information start
48 bytes uknown
int lightmapResolution; as far as i can tell. didnt check yet
int uknown
string meshname;
string materialname;*
int unknown;
int vertexCount;
for(int i = 0; i < vertexCount;i++)
{
float[3] vertices
float[3] normals
float[2] textureUV
if(lightmapResolution != 0)
{
float[2] lightmapUV
}
12 bytes uknown //didnt look into this yet
}
if(lightmapResolution != 0)
{
string lightmapPath;
}
int boneCount;*
string[boneCount] bones
if(boneCount != 0)
{
//This is needed for animation.
for(i = 0; i < vertexCount;i++)
{
byte BoneIndex_1 //Index of bonename in array above
ushort BoneWeight_1 //used for animation to weigh the two transformation matricies
byte BoneIndex_2
ushort BoneWeight_2
}
}
int faceCount
for(int i = 0; i < faceCount;i++)
{
int16[i,3] faces;
}
.bmt structure
Code:
12 byte header
int textureCount
for(int i = 0; i < textureCount;i++)
{
string name; // will be used in the mesh to identify which texture to use
48 bytes of unknown data
string texturefilename;
7bytes of unkown data
}
.ban structure
Code:
12 byte header
int unk
int unk
string name; //name of the animation
int duration
int framesPerSecond
int unk
int keyframeCount;
int[keyframeCount] keyframes; //timings of the keyframes, so you can interpolate between two poses.
int boneCount //Amount of bones that have transformations that are diffrent from their bind poses.
for(int i = 0; i < boneCount;i++)
{
string boneName;
int count; same as keyframeCount
for(int p = 0; p < count;p++)
{
Quaternion rotation;
Vector3 translation;
//These two together give you the transformation Matrix relative to it's partent bone/joint.
}
}
//End of file
.bsk structure
So thanks to this
Code:
12 byte header
int boneCount;
for(int i = 0; i < boneCount;i++)
{
if(not first bone)
{
int count; // Number of bones with same parent bone. Bone itself included
for(int x = 0; x < count; x++)
{
string boneName;
}
}
byte unk;
string boneName;
string parentBoneName;
//This next part is taken from Cruor's post.
Vec4 rotationToParent;
Vec3 translationToParent;
Vec4 rotationToOrigin;
Vec3 translationToOrigin
Vec4 rotationUnkown;
Vec3 translationUnkown;
}
int unk;
int unk;
int unk;
//End of file
I will edit my post as i learn more about the structures.
Please excuse the poor structure of my post and also my bad english.
|
|
|
07/10/2012, 20:13
|
#2
|
Chat Killer In Duty
elite*gold: 5
Join Date: May 2008
Posts: 16,390
Received Thanks: 6,508
|
seems cool for me
|
|
|
07/10/2012, 21:14
|
#3
|
elite*gold: 11
Join Date: May 2009
Posts: 617
Received Thanks: 589
|
in bsr structure
Quote:
int bmsFileCount;
string[bmsFileCount] paths to the different meshes used
int unknown
int unknown
|
first unknow would be efp file count
|
|
|
07/10/2012, 21:45
|
#4
|
elite*gold: 0
Join Date: May 2009
Posts: 67
Received Thanks: 37
|
Quote:
Originally Posted by qoaway
in bsr structure
first unknow would be efp file count
|
for which bsrType? Cause it's not true for 0x20001.
EDIT: efp's seem to be alot further down.
|
|
|
07/11/2012, 00:28
|
#5
|
elite*gold: 0
Join Date: Jan 2008
Posts: 21
Received Thanks: 12
|
The header is followed by indexes to the different parts of the file in the bsr/bms
bsr:
Code:
[12 byte] header
[04 byte] bmtIndex
[04 byte] bmsIndex
[04 byte] unkIndex
[04 byte] unkIndex
[04 byte] unkIndex
[04 byte] unkIndex
[04 byte] unkIndex
[04 byte] bmsIndex // Only one i was interested in
....
|
|
|
07/11/2012, 19:16
|
#6
|
elite*gold: 0
Join Date: May 2009
Posts: 67
Received Thanks: 37
|
Thanks illstar. i noticed the bms index earlier but didnt really think about it.
Please note that the naming of the variables is purely based on assumptions.
Code:
.bsk structure
So thanks to this post
Code:
12 byte header
int boneCount;
for(int i = 0; i < boneCount;i++)
{
if(not first bone)
{
int count; // Number of bones with same parent bone. Bone itself included
for(int x = 0; x < count; x++)
{
string boneName;
}
}
byte unk;
string boneName;
string parentBoneName;
//This next part is taken from Cruor's post.
Vec4 rotationToParent;
Vec3 translationToParent;
Vec4 rotationToOrigin;
Vec3 translationToOrigin
Vec4 rotationUnkown;
Vec3 translationUnkown;
}
int unk;
int unk;
int unk;
//End of file
|
|
|
03/22/2013, 01:17
|
#7
|
elite*gold: 0
Join Date: Mar 2011
Posts: 83
Received Thanks: 28
|
Quote:
Originally Posted by illstar
The header is followed by indexes to the different parts of the file in the bsr/bms
bsr:
Code:
[12 byte] header
[04 byte] bmtIndex
[04 byte] bmsIndex
[04 byte] unkIndex
[04 byte] unkIndex
[04 byte] unkIndex
[04 byte] unkIndex
[04 byte] unkIndex
[04 byte] bmsIndex // Only one i was interested in
....
|
bsr:
Code:
[12 byte] header
[04 byte] bmtIndex
[04 byte] bmsIndex
[04 byte] sklIndex
[04 byte] banIndex
[04 byte] defaultIndex
[04 byte] defaultIndex
[04 byte] ambientIndex
[04 byte] bmsIndex
|
|
|
03/22/2013, 18:37
|
#8
|
elite*gold: 0
Join Date: Jan 2009
Posts: 314
Received Thanks: 686
|
Well, i'd like to add something too.
I ran the format through every bsr file without errors, same with cpd.
Code:
Don't judge me for using the Header to compare types but I was too lazy comparing all types and it worked for me.
Silkroad Format (.bsr) - JMXVRES 0108
Code:
[12 byte] header
[04 byte] bmtIndex
[04 byte] bmsIndex
[04 byte] bskIndex
[04 byte] banIndex
[04 byte] defaultIndex
[04 byte] defaultIndex
[04 byte] ambientIndex
[04 byte] bmsRootIndex
[04 byte] bmsExtraType
[04 byte] unkIndex4
[04 byte] unkIndex5
[04 byte] unkIndex6
[04 byte] unkIndex7
[04 byte] bsrType
[04 byte] bsrNameLenght
[STRING] bsrName
[04 byte] unk01
[04 byte] unk02
[04 byte] unk03
[04 byte] unk04
[04 byte] unk05
[04 byte] unk06
[04 byte] unk07
[04 byte] unk08
[04 byte] unk09
[04 byte] unk10
[04 byte] unk11
[04 byte] unk12
//bmsRootIndex
[04 byte] bmsRootLenght
[STRING] bmsRoot
//AABB (axis-aligned bounding boxes)
{
[04 byte] X1
[04 byte] Z1
[04 byte] Y1
[04 byte] X2 //width = X2 - X1
[04 byte] Z2 //height = Z2 - Z1
[04 byte] Y3 //length = Y2 - Y1
}
//bmtIndex
[04 byte] unk_bmtInt
[04 byte] bmtEntryLenght
[STRING ] bmtEntry
//bmsIndex
[04 byte] bmsFileCount
{
[04 byte] bmsEntryLenght
[STRING] bmsEntry
if(bmsExtra == 1)
[04 byte] bmsExtraValue
}
//banIndex
[04 byte] unkInt2
[04 byte] unkInt3
[04 byte] banFileCount
{
[04 byte] banEntryLenght
[STRING ] banEntry
}
//bskFile
[04 byte] bskFileCount
{
[04 byte] bskEntryLenght
[STIRNG] bskEntry
}
// -- Skipped from here, nothing of interest --
Silkroad Format (.bsr) - JMXVRES 0109
Code:
[12 byte] header
[04 byte] bmtIndex
[04 byte] bmsIndex
[04 byte] bskIndex
[04 byte] banIndex
[04 byte] defaultIndex
[04 byte] defaultIndex
[04 byte] ambientIndex
[04 byte] bmsRootIndex
[04 byte] bmsExtraType
[04 byte] unkIndex4
[04 byte] unkIndex5
[04 byte] unkIndex6
[04 byte] unkIndex7
[04 byte] bsrType
[04 byte] bsrNameLenght
[STRING] bsrName
[04 byte] unk01
[04 byte] unk02
[04 byte] unk03
[04 byte] unk04
[04 byte] unk05
[04 byte] unk06
[04 byte] unk07
[04 byte] unk08
[04 byte] unk09
[04 byte] unk10
[04 byte] unk11
[04 byte] unk12
//bmsRootIndex
[04 byte] bmsRootLenght
[STRING] bmsRoot
//AABB (axis-aligned bounding boxes)
{
//floats
[04 byte] X1
[04 byte] Z1
[04 byte] Y1
[04 byte] X2 //width = X2 - X1
[04 byte] Z2 //height = Z2 - Z1
[04 byte] Y3 //length = Y2 - Y1
//Unknown but it was equal to the first floats
//floats
[04 byte] X1
[04 byte] Z1
[04 byte] Y1
[04 byte] X2 //width = X2 - X1
[04 byte] Z2 //height = Z2 - Z1
[04 byte] Y3 //length = Y2 - Y1
}
[04 byte] unkInt1
if(unkInt1 == 1)
{
[04 byte] unkfloat1
[04 byte] unkfloat2
[04 byte] unkfloat3
[04 byte] unkfloat4
[04 byte] unkfloat5
[04 byte] unkfloat6
[04 byte] unkfloat7
[04 byte] unkfloat8
[04 byte] unkfloat9
[04 byte] unkfloat10
[04 byte] unkfloat11
[04 byte] unkfloat12
[04 byte] unkfloat13
[04 byte] unkfloat14
[04 byte] unkfloat15
[04 byte] unkfloat16
}
//bmtIndex
[04 byte] bmtFileCount
{
[04 byte] unk_bmtInt
[04 byte] bmtEntryLenght
[STRING] bmtEntry
}
//bmsIndex
[04 byte] bmsFileCount
{
[04 byte] bmsEntryLenght
[STRING] bmsEntry
if(bmsExtra == 1)
[04 byte] bmsExtraValue
}
//banIndex
[04 byte] unkInt2
[04 byte] unkInt3
[04 byte] banFileCount
{
[04 byte] banEntryLenght
[STRING] banEntry
}
//bskFile
[04 byte] bskFileCount
{
[04 byte] bskEntryLenght
[STIRNG] bskEntry
}
// -- Skipped from here, nothing of interest --
Silkroad Format (.cpd) - JMXVCPD 0101
Code:
[12 byte] Header
[04 byte] bsrRootIndex
[04 byte] bsrListIndex
[04 byte] unkIndex1
[04 byte] unkIndex2
[04 byte] unkIndex3
[04 byte] unkIndex4
[04 byte] unkIndex5
[02 byte] Type1
[02 byte] Type2
[04 byte] NameLength
[STRING] Name - wreck_sship_in_01
[04 byte] unkInt1
[04 byte] unkInt2
//bsrRootIndex
[04 byte] bsrRootLength
[STRING] bsrRoot - res\dun\property\wreck\ship\wreck_sship_in_01.bsr
//bsrListIndex
[04 byte] bsrFileCount
{
[04 byte] entryLenght
[STRING] entry - res\dun\property\wreck\ship\wreck_sship_in_01.bsr
}
|
|
|
02/22/2014, 18:34
|
#9
|
elite*gold: 0
Join Date: May 2009
Posts: 67
Received Thanks: 37
|
Was a little bored the last couple of days so i've been working on animations.
Had to read a couple of articles about skeleton animation, but it's been easier than i expected.
Right now i simply take a framerate of 30 FPS and assume that the duration between two keyframes is 1/30 of a second. Which is of course not correct for many animations. Which is why the animations look so choppy sometimes. But for demo purposes i thought it looked nice enough.
Here's the updated format of the .ban files:
Code:
12 byte header
int unk
int unk
string name; //name of the animation
int duration
int framesPerSecond
int unk
int keyframeCount;
int[keyframeCount] keyframes; //timings of the keyframes, so you can interpolate between two poses.
int boneCount //Amount of bones that have transformations that are diffrent from their bind poses.
for(int i = 0; i < boneCount;i++)
{
string boneName;
int count; same as keyframeCount
for(int p = 0; p < count;p++)
{
Quaternion rotation;
Vector3 translation;
//These two together give you the transformation Matrix relative to it's partent bone/joint.
}
}
//End of file
Also in case you're trying to do something similar in say OpenGL, you have to take into account that DirectX (which is being used in sro) uses a right-handed coordinate system, but OpenGL on the other hand uses a left-handed system by default. There are obviously workarounds but just something to keep in mind.
|
|
|
02/23/2014, 02:54
|
#10
|
elite*gold: 0
Join Date: Dec 2008
Posts: 1,600
Received Thanks: 1,154
|
I doubt we can expect to see Models imported in SRO with their own Animations soon and by that I mean Models which were made from the scratch.
Wouldn't 60 FPS work? It's more smoother then 30 FPS (Don't come with that "Your Eye handles only 30 FPS thingy").
|
|
|
02/23/2014, 10:24
|
#11
|
elite*gold: 0
Join Date: May 2009
Posts: 67
Received Thanks: 37
|
Quote:
Originally Posted by Lolill0
I doubt we can expect to see Models imported in SRO with their own Animations soon and by that I mean Models which were made from the scratch.
|
Importing your own Animations would be pretty easy. Someone probably already did it. The .ban file format is rather easy to figure out.
An entire new Model would be more difficult since there's a lot more files you would have get 100% correct.
Quote:
Originally Posted by Lolill0
Wouldn't 60 FPS work? It's more smoother then 30 FPS (Don't come with that "Your Eye handles only 30 FPS thingy").
|
I'm not sure, i haven't tried the changing the value in the file to 60. But that's something you could try pretty easily. It's just that every animation i've come across so far was either 24 FPS or 30 FPS.
Which doesn't mean they HAVE to run the game at 30 FPS. You can run it at 60 FPS you just have to interpolate between lets say the pose at keyframe 10 and keyframe 11 to create the pose at keyframe 10.5.
|
|
|
02/23/2014, 12:19
|
#12
|
elite*gold: 1
Join Date: Nov 2011
Posts: 2,532
Received Thanks: 1,439
|
Quote:
Originally Posted by theonly112
Importing your own Animations would be pretty easy. Someone probably already did it. The .ban file format is rather easy to figure out.
An entire new Model would be more difficult since there's a lot more files you would have get 100% correct.
|
Importing own animation is the hard part(ban, bsk), but adding the new model is the easy part of the progress(bsr, ddj, bms, efp). Also that "Someone" isn't into SRO anymore.
|
|
|
02/23/2014, 13:28
|
#13
|
elite*gold: 0
Join Date: May 2009
Posts: 67
Received Thanks: 37
|
Quote:
Originally Posted by SnowStorm1
Importing own animation is the hard part(ban, bsk), but adding the new model is the easy part of the progress(bsr, ddj, bms, efp). Also that "Someone" isn't into SRO anymore.
|
That's just completely not true. You can add a new Animation without having to do anything but add 1 new entry to the list of .ban Files in the .bsr file of the Model the animation is for.
To add an entirely new Model:
1. you would have to create new meshes ( .bms ), that's easy ( for the most part, but you already have to have a .bsk file if you want to be able to have any animation for this model. Otherwise it's just a boring mesh sitting around somewhere.)
2. you would have to correctly rig the meshes ( .bsk ), not so easy but doable. still no complete documentation of the file format.
3. you would have to texture the meshes ( .bmt ) more or less easy.
4. create a new .bsr file linking everything together correctly. ( actually pretty hard since there's still no complete documentation on .bsr files)
So it's just completely untrue that creating 1 file that's already nicely documented is harder than creating 4 that are not at all well documented.
Also about that part about that certain "someone"? I have no idea who you're talking about but that's just complete bullshit. Anyone with a decent understanding of a tool like 3ds Max can do it.
EDIT: I've updated the first post ( animation stuff in .bms files ) to show what information i currently have about the file formats.
|
|
|
02/23/2014, 20:56
|
#14
|
elite*gold: 0
Join Date: Dec 2008
Posts: 1,600
Received Thanks: 1,154
|
Quote:
Originally Posted by theonly112
That's just completely not true. You can add a new Animation without having to do anything but add 1 new entry to the list of .ban Files in the .bsr file of the Model the animation is for.
To add an entirely new Model:
1. you would have to create new meshes ( .bms ), that's easy ( for the most part, but you already have to have a .bsk file if you want to be able to have any animation for this model. Otherwise it's just a boring mesh sitting around somewhere.)
2. you would have to correctly rig the meshes ( .bsk ), not so easy but doable. still no complete documentation of the file format.
3. you would have to texture the meshes ( .bmt ) more or less easy.
4. create a new .bsr file linking everything together correctly. ( actually pretty hard since there's still no complete documentation on .bsr files)
So it's just completely untrue that creating 1 file that's already nicely documented is harder than creating 4 that are not at all well documented.
Also about that part about that certain "someone"? I have no idea who you're talking about but that's just complete bullshit. Anyone with a decent understanding of a tool like 3ds Max can do it.
EDIT: I've updated the first post ( animation stuff in .bms files ) to show what information i currently have about the file formats.
|
I guess he refered to perry who made the OBJ to BMS Converter
Implementing stuff (Static Models) ain't hard at all, the thing is, the Model itself is missing Animations, Skeleton.
Let's say I got a Model with a Animation already, Animation is called "ANI.AA", I will convert it to a different format and a SRO XXX to BAN Converter will convert the Animation to the .BAN Format.
Pretty much like that, since then we could have new Monsters, Items which are animated, new Characters and pretty much more.
The only thing we're able to do by now is to implement some Static Models, the rest like creating entire new Skill Effects, Maps, UI and more isn't possible now.
Replacing NPC's, Monsters or Objects isn't the way to add new things like this
I even haven't encountered someone who could implement some Cactus as a NPC in Taklamakan which sells some pretty nasty Stuff *lol*
|
|
|
03/07/2014, 16:20
|
#15
|
elite*gold: 0
Join Date: Mar 2014
Posts: 26
Received Thanks: 2
|
Where is Program Download Link
|
|
|
 |
|
Similar Threads
|
Mabinogi File Formats Documentation
05/26/2012 - Mabinogi - 5 Replies
I wasn't sure whether I should bother to post this here, because well, nothing of value ever really takes place here.
But what the hell, maybe you guys will surprise me.
So, I've been staring at Mabi's files in hex for a week now, and examining source/output of various converters, and this is what I have so far, on PMG files: (There's more, but I've literally only just finished typing the PMG section so far, which is by -FAR- the section I know most about)
I'll start with some...
|
Which file formats can be read?
12/30/2011 - SRO Coding Corner - 3 Replies
So far I only know of reading ddj-s.
Are there tools for bsr or dof files out there?
|
[HELP]silkroad client file
09/14/2011 - SRO Private Server - 4 Replies
somebody can give-me client file for silkroad v1.320 ?
i reinstall windows & i lost all files .
joymax update client version & i need last version for private server
|
[IDEA] WarRock Hacks posting formats
08/22/2010 - WarRock - 2 Replies
I was thinking of creating a certain format the hack has to be in.
A simple structure would be:
- Title
- Date released
- Detected?
- Download link + Virus scan.
- Description
- Functions
- (?)Screen shots
|
Edited itemtype.dat (Different formats than the other ones)
03/12/2008 - CO2 Exploits, Hacks & Tools - 16 Replies
Well I made these different itemtype.dats and then saw that other people have made it and i thought i would release it anyways since i already did it all.
I havent made a bracket one since the other people did. So here is a link to a bracket format itemtype.dat
http://www.elitepvpers.com/forum/co2-exploits-hack s-tools/106046-edited-itemtype-dat-patch-5016-a.ht ml
Who i say thanks to:
coder: for his encrypter/decrypter
a1: for letting us make these :)
First 2 formats use Phrases....
|
All times are GMT +1. The time now is 12:01.
|
|