Register for your free account! | Forgot your password?

You last visited: Today at 05:00

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



BSK2OZZ

Discussion on BSK2OZZ within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1

 
elite*gold: 260
Join Date: Aug 2008
Posts: 560
Received Thanks: 3,740
Post BSK2OZZ

WARNING: This is not a tool that has any practical use for most people. It's nothing new really, only building on what's already been released. It's a project I'm sharing for anyone who likes reading about this stuff (developer experiences) or possibly getting some new ideas for working with different things. It's a long ways away from being useful for the advancement of anything, so you can skip this thread if that's what you're after.

About

3d modeling and animation stuff has always been an extremely weak point for me. Perhaps it has to do with all the math, but I've just not really done much with this stuff over the years. As I continue to learn new things and my interest in game design and development grows, my motivation for finally learning this stuff and being able to work with it has started to pickup.

This project is my first attempt to make sense of these topics. Since I'm a programmer, I started out by wanting to find a library to programmatically work with skeletal animations. I know typically people go straight into writing importers/exporters for their 3d modeling program of choice (blender, max, maya, etc...), but I just don't have enough experience working with that stuff to start there. So instead, I wanted to find another way to visualize the 3d model data in a way that I could easily debug and understand code wise.

I stumbled upon the , and it seemed to be exactly what I was looking for to get my started.
Quote:
ozz-animation is an open source c++ 3d skeletal animation library. It provides runtime character animation functionalities (sampling, blending...), with the toolset to import major DCC formats (Collada, Fbx, glTF...). It proposes a low-level renderer and game-engine agnostic implementation, focusing on performance and memory constraints with a data-oriented design.
The best part is that they have howtos that do exactly what I wanted (these are linked in the source file), which was to build a skeleton and animation at runtime. Since there's also a simple program to visualize the data, most of the work required for the task is simply converting the data in Silkroad's formats to OZZ's formats.

While that sounds pretty simple, the task turned out to be a bit more tricky due to my inexperience working with this stuff. My biggest roadblock was understanding exactly what ozz wanted when it came to using their API, given that Silkroad's data doesn't use a format that works as-is in ozz. OZZ requires a 1:1 matching of skeleton joints to animation joint tracks, so my initial attempts to load a character and play an animation just failed because the number of 'tracks' in BAN files don't match the number of 'bones' in BSK files.

I decided it'd be much simpler to just figure out a way to generate the bind pose animation from the skeleton's bind pose (as I'd have my 1:1 bone/track mapping then). My first project used C# to quickly and effortlessly parse the BSK data, and then I code generated the C++ code that I'd run using the ozz sdk to generate the ozz files. This sort of worked, but my bind pose was wrong. After trying to work it out over a week, I realized I needed to re-generate the skeleton using the correct joint order ozz creates. I had this nasty circular dependency where I need to use the program to generate a skeleton's bind pose animation, then dump the joint indices from that skeleton, only to generate the animation again with re-ordered joints. It's as convoluted as it sounds.

I then decided to just rewrite the BSK parser in C++, so I can build the skeleton at runtime, and then build the correct bind pose animation without jumping through any extra hoops. That is what this project does, although the C++ is super ugly because I just wanted something simple that works to know I'm actually on the right track in working with this data.

I decided I wanted to share this dev project and my experiences because I myself struggle making sense of a lot of this stuff, so I'm sure others will as well. I have a lot of experience doing data format interop though, so the idea of finding a library like ozz and getting the bsk data working in it is something I'm used to. There's not much code or projects to work from though, so despite this being a terrible C++ project (I'm really unhappy with my code, but I just don't want to try and make it better when I won't be using this anymore) I hope perhaps it can be of use to someone else.

This project is only a small step in the direction of what needs to be done. Using my other project, I'm able to load BAN files and play them, but I have to jump through the hoops of getting the data compatible with ozz first. As a result, I'll have to extend this project to also load a BAN file, and then re-build the animation per-skeleton to be able to view it. I don't think you typically should have to do that though, so it'd probably be better just getting this stuff loading in a 3d modeling program instead.

I myself don't have any desire to rebuild a 3d modeling pipeline compatible for Silkroad. Even if someone made the tools and released them, there's the obvious problem that comes up with 3d artists having their work copy/pasted once the files are used in a server due to them being compatible with every other server since they're using Joymax's system. A lot of people have expressed demotivation from trying to do much in this area for this simple reason.

In that regards, as well as my own interests in what it takes to create a custom Silkroad client, it makes more sense to understand using this 3d modeling and animation stuff in a custom library like ozz. While it's a bit theoretical, if you had custom animations exported to ozz, and then integrated the ozz sdk into the client to build the bsk/ban objects in memory from rather than loading from a file (in a properly protected dll), you could certainly increase the amount of work it takes for other people to use your skeleton/animations.

If someone made an in-memory bsk/ban dumping tool though, it might all be for naught, so that's why it's probably a better idea to look into the custom client approach, despite it being a much larger task. Much like the problem with PK2 files, there's only so much you can do to protect assets when you're maintaining compatibility with the original game.

I'm only mentioning some of these topics to answer the question of "why not just make tools for Blender". A few people have already made such private tools, but those tools don't really solve the biggest problem with wanting to create a bunch of new content for Silkroad if everyone will be able to easily use it and the creators don't really get any period of exclusivity having it.

I myself don't think Silkroad has a content problem. I can understand how a lot of people would love to see new areas, monsters, changed skill animations, etc.. so it doesn't look the same, but if the underlying mechanics of the game are going to stay the same (as is the case with pure content updates), then it's all just the same to me. Going out and killing mangnyangs is the same experience as going out and killing whatever max cap level monster there is. I can get why people love having dance animations, but come on, it doesn't affect the game one bit. People are still going to want to bot up their SP and gear, and I think that's a bigger problem than how stale the content of the game is from being so old.

Anyways though, I'm more interested in understanding how all this stuff works and how to build a new content pipeline. No promises on if I keep going with this and create the tools to make new animations and stuff. As I mentioned before, it's a super weak topic for me, and I still have a lot to learn with 3d modeling and animation stuff. I would like to find new and interesting ways to work with this stuff though, so I'll be on the lookout for other libraries like ozz to play with.

Source Only

If you only want to look at the ugly C++ code that is used to convert from the BSK data to OZZ's data, here's the file.

BSK2OZZ.cpp

Screenshots

NOTE: The image on the right is taken from Google, and is only a reference to match the skeleton in the bind pose against. The image on the left is what you'll see with the viewer.

Roc

Isyutaru

BeakYung

VirusTotal

Source is included, but I've also bundled the ozz SDK's demo viewer program for convenience (which has 1 false positive) as well as a pre-compiled converter that requires the vs2019 runtime to be installed. Compiling from source should easily work as-is though with no problems (compile in x64 Release). If you want to recompile OZZ SDK stuff though, you'll have a bit more work to do (hence why I'm just using their official SDK package and not running from source)

BSK2OZZ_0_1.zip -
BSK2OZZ.exe (compiled by me) -
sample_playback.exe (OZZ SDK file) -

Thanks!

DaxterSoul - For creating/maintaining the SilkroadDoc repo, essentially giving everyone the basics of what they need to work with this stuff without having to reverse the client themselves
JellyBitz - Repo contributions and motivational posts showing off his progress doing all this stuff and more in Blender (I have to catch up!)
Cruor, theonly112, and anyone else I've missed who has contributed to the initial reversing of all this modeling stuff ages ago

I think the ideal community is just being able to build up from the works of others, then contributing things yourself, and having the cycle repeat when others then build up from what you do in the future
Attached Files
File Type: zip BSK2OZZ_0_1.zip (897.1 KB, 83 views)
pushedx is offline  
Thanks
23 Users
Old 10/17/2021, 03:26   #2
 
JellyBitz's Avatar
 
elite*gold: 0
Join Date: Sep 2018
Posts: 316
Received Thanks: 632
Quote:
Originally Posted by pushedx View Post
As I continue to learn new things and my interest in game design and development grows, my motivation for finally learning this stuff and being able to work with it has started to pickup.
Sounds amazing, I was also interested on 3D stuffs since long long ago. Happy with my PC upgrade a few months ago, I'm now able to explore these areas.

For me, the challenge was learning 3D stuffs without a true knowledge before passing to the action, more specifically learning Blender which I barely touched 10 years ago . It's a huge advantage having all this over there! The learning curve is expensive, but the result is the best a 3D artist can have.

I've been struggling recently learning about "Clothes simulation" on Blender. It is too much information and more on the way which makes me doubt if I'm going to success, just for adapting the simple cloth simulation which handles Silkroad.

Quote:
Originally Posted by pushedx View Post
... having their work copy/pasted once the files are used in a server due to them being compatible with every other server ...
Yeah, that's the problem most people I know creating 3D stuffs are worry about. I kind have a subdivided opinion into myself:
  • If you are constantly creating new stuffs, you should not be worry about it. (+Creativity)
  • A new avatar/pet/monster will not save your server from failure. (+Gameplay)
JellyBitz is offline  
Thanks
2 Users
Old 10/31/2021, 23:24   #3

 
Otakanikaru's Avatar
 
elite*gold: 133
Join Date: Nov 2013
Posts: 454
Received Thanks: 448
Quote:
Originally Posted by pushedx View Post
WARNING: This is not a tool that has any practical use for most people. It's nothing new really, only building on what's already been released. It's a project I'm sharing for anyone who likes reading about this stuff (developer experiences) or possibly getting some new ideas for working with different things. It's a long ways away from being useful for the advancement of anything, so you can skip this thread if that's what you're after.

About

3d modeling and animation stuff has always been an extremely weak point for me. Perhaps it has to do with all the math, but I've just not really done much with this stuff over the years. As I continue to learn new things and my interest in game design and development grows, my motivation for finally learning this stuff and being able to work with it has started to pickup.

This project is my first attempt to make sense of these topics. Since I'm a programmer, I started out by wanting to find a library to programmatically work with skeletal animations. I know typically people go straight into writing importers/exporters for their 3d modeling program of choice (blender, max, maya, etc...), but I just don't have enough experience working with that stuff to start there. So instead, I wanted to find another way to visualize the 3d model data in a way that I could easily debug and understand code wise.

I stumbled upon the , and it seemed to be exactly what I was looking for to get my started.


The best part is that they have howtos that do exactly what I wanted (these are linked in the source file), which was to build a skeleton and animation at runtime. Since there's also a simple program to visualize the data, most of the work required for the task is simply converting the data in Silkroad's formats to OZZ's formats.

While that sounds pretty simple, the task turned out to be a bit more tricky due to my inexperience working with this stuff. My biggest roadblock was understanding exactly what ozz wanted when it came to using their API, given that Silkroad's data doesn't use a format that works as-is in ozz. OZZ requires a 1:1 matching of skeleton joints to animation joint tracks, so my initial attempts to load a character and play an animation just failed because the number of 'tracks' in BAN files don't match the number of 'bones' in BSK files.

I decided it'd be much simpler to just figure out a way to generate the bind pose animation from the skeleton's bind pose (as I'd have my 1:1 bone/track mapping then). My first project used C# to quickly and effortlessly parse the BSK data, and then I code generated the C++ code that I'd run using the ozz sdk to generate the ozz files. This sort of worked, but my bind pose was wrong. After trying to work it out over a week, I realized I needed to re-generate the skeleton using the correct joint order ozz creates. I had this nasty circular dependency where I need to use the program to generate a skeleton's bind pose animation, then dump the joint indices from that skeleton, only to generate the animation again with re-ordered joints. It's as convoluted as it sounds.

I then decided to just rewrite the BSK parser in C++, so I can build the skeleton at runtime, and then build the correct bind pose animation without jumping through any extra hoops. That is what this project does, although the C++ is super ugly because I just wanted something simple that works to know I'm actually on the right track in working with this data.

I decided I wanted to share this dev project and my experiences because I myself struggle making sense of a lot of this stuff, so I'm sure others will as well. I have a lot of experience doing data format interop though, so the idea of finding a library like ozz and getting the bsk data working in it is something I'm used to. There's not much code or projects to work from though, so despite this being a terrible C++ project (I'm really unhappy with my code, but I just don't want to try and make it better when I won't be using this anymore) I hope perhaps it can be of use to someone else.

This project is only a small step in the direction of what needs to be done. Using my other project, I'm able to load BAN files and play them, but I have to jump through the hoops of getting the data compatible with ozz first. As a result, I'll have to extend this project to also load a BAN file, and then re-build the animation per-skeleton to be able to view it. I don't think you typically should have to do that though, so it'd probably be better just getting this stuff loading in a 3d modeling program instead.

I myself don't have any desire to rebuild a 3d modeling pipeline compatible for Silkroad. Even if someone made the tools and released them, there's the obvious problem that comes up with 3d artists having their work copy/pasted once the files are used in a server due to them being compatible with every other server since they're using Joymax's system. A lot of people have expressed demotivation from trying to do much in this area for this simple reason.

In that regards, as well as my own interests in what it takes to create a custom Silkroad client, it makes more sense to understand using this 3d modeling and animation stuff in a custom library like ozz. While it's a bit theoretical, if you had custom animations exported to ozz, and then integrated the ozz sdk into the client to build the bsk/ban objects in memory from rather than loading from a file (in a properly protected dll), you could certainly increase the amount of work it takes for other people to use your skeleton/animations.

If someone made an in-memory bsk/ban dumping tool though, it might all be for naught, so that's why it's probably a better idea to look into the custom client approach, despite it being a much larger task. Much like the problem with PK2 files, there's only so much you can do to protect assets when you're maintaining compatibility with the original game.

I'm only mentioning some of these topics to answer the question of "why not just make tools for Blender". A few people have already made such private tools, but those tools don't really solve the biggest problem with wanting to create a bunch of new content for Silkroad if everyone will be able to easily use it and the creators don't really get any period of exclusivity having it.

I myself don't think Silkroad has a content problem. I can understand how a lot of people would love to see new areas, monsters, changed skill animations, etc.. so it doesn't look the same, but if the underlying mechanics of the game are going to stay the same (as is the case with pure content updates), then it's all just the same to me. Going out and killing mangnyangs is the same experience as going out and killing whatever max cap level monster there is. I can get why people love having dance animations, but come on, it doesn't affect the game one bit. People are still going to want to bot up their SP and gear, and I think that's a bigger problem than how stale the content of the game is from being so old.

Anyways though, I'm more interested in understanding how all this stuff works and how to build a new content pipeline. No promises on if I keep going with this and create the tools to make new animations and stuff. As I mentioned before, it's a super weak topic for me, and I still have a lot to learn with 3d modeling and animation stuff. I would like to find new and interesting ways to work with this stuff though, so I'll be on the lookout for other libraries like ozz to play with.

Source Only

If you only want to look at the ugly C++ code that is used to convert from the BSK data to OZZ's data, here's the file.

BSK2OZZ.cpp

Screenshots

NOTE: The image on the right is taken from Google, and is only a reference to match the skeleton in the bind pose against. The image on the left is what you'll see with the viewer.

Roc

Isyutaru

BeakYung

VirusTotal

Source is included, but I've also bundled the ozz SDK's demo viewer program for convenience (which has 1 false positive) as well as a pre-compiled converter that requires the vs2019 runtime to be installed. Compiling from source should easily work as-is though with no problems (compile in x64 Release). If you want to recompile OZZ SDK stuff though, you'll have a bit more work to do (hence why I'm just using their official SDK package and not running from source)

BSK2OZZ_0_1.zip -
BSK2OZZ.exe (compiled by me) -
sample_playback.exe (OZZ SDK file) -

Thanks!

DaxterSoul - For creating/maintaining the SilkroadDoc repo, essentially giving everyone the basics of what they need to work with this stuff without having to reverse the client themselves
JellyBitz - Repo contributions and motivational posts showing off his progress doing all this stuff and more in Blender (I have to catch up!)
Cruor, theonly112, and anyone else I've missed who has contributed to the initial reversing of all this modeling stuff ages ago

I think the ideal community is just being able to build up from the works of others, then contributing things yourself, and having the cycle repeat when others then build up from what you do in the future
So.. in shorter words this one would allow to have all the animations / models exported out from actual game and let them be used with this animation engine or implemented in ur own game (theoretically)?

Niiiiice.
Otakanikaru is offline  
Thanks
1 User
Old 11/04/2021, 01:08   #4
 
elite*gold: 0
Join Date: Nov 2021
Posts: 10
Received Thanks: 8
Please don't spoil the spirit of silkroad online, the game has been badly affected so far, from the software you made and the things you shared, of course there are still some people who do things, but if someone really wants to do something good, and really want, they can do it themselves, please think about it, the game should not be badly affected for, don't spoil the spirit of silkroad
3dArt is offline  
Old 11/07/2021, 12:23   #5
 
#HB's Avatar
 
elite*gold: 0
Join Date: Sep 2017
Posts: 1,075
Received Thanks: 864
Quote:
Originally Posted by 3dArt View Post
Please don't spoil the spirit of silkroad online...
#HB is offline  
Old 11/07/2021, 21:09   #6

 
SubZero**'s Avatar
 
elite*gold: 0
Join Date: Apr 2017
Posts: 937
Received Thanks: 399
Quote:
Originally Posted by 3dArt View Post
Please don't spoil the spirit of silkroad online, the game has been badly affected so far, from the software you made and the things you shared, of course there are still some people who do things, but if someone really wants to do something good, and really want, they can do it themselves, please think about it, the game should not be badly affected for, don't spoil the spirit of silkroad
silkroad answer: I don't even have a spirit to spoil
SubZero** is offline  
Reply




All times are GMT +2. The time now is 05:00.


Powered by vBulletin®
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2023 elitepvpers All Rights Reserved.