Creating custom animation: SMDtoFCV Converter v1.0 +Tutorial
Sept 25, 2015 6:20:25 GMT 10
JTeghius Kittius, david flores, and 13 more like this
Post by LegalSoul on Sept 25, 2015 6:20:25 GMT 10
Hello, dear modding community!
Today I want to talk about one of the most mysterious RE4 file format, which is .FCV.
Some prehistory is needed.
I think that you will agree, that importing custom animations in any game is something very cool yet always very hard and problematic. The .FCV files are responsible for RE4 animations. I was always quite curious about this format, but all my attempts of understanding it were in vain.
Last months I was digging deep and with some help from infern4l ( special thanks to him! ), I made a converter that converts .SMD animation (which is a well known animations format) to a .FCV animation file. Well... sorta : D
And of course, lot of thanks to Son of Persia for the file extracting\repacking tools!
So, let's get started!
But before that, to avoid any kind of misunderstandings or high expectations, I want to talk about the limitations and some of the problems that may occure. And there's A LOT of them here
.FCV is a terrible format, really. It's very complex and contains a LOT of information. To be fair, I don't fully understand some parameters in it. I won't go deep, but I will just tell the main problems:
-1- Due to some unknown parameters in the .FCV format, my SMDtoFCV converter creates unoptimized big .FCV files. I mean they enormously surpass the original animations by their size. Why is this a problem? Well, the game has some hardcoded limitations, that are set to every archive (.udas, .dat or .evd). So, when the animation in an archive surpasses the limit - the game crashes. I really want to reduce the file sizes, but to do that I need to know some of the unknown parameters in .FCV format (If there is anyone, who knows of .fcv structure, specifically what are the additional 2 parameters of the animation keys apart from the main key value, you can PM me or post here and help improving the existent tool and take down this, first and the most critical limitation).
-2- Second limitation is the animations time. It must be the same as the original animation. Nothing I can do about it.
-3- Third limitation says, that you can't do gameplay animations that make gameplay-camera move. Means that you can't make gameplay walking, running animations :\
(Weapon aiming animations should be fine).
-4- 4-th limitation is that the animations may be buggy with 60 fps setting in the game options.
-5- Exporting original animations from RE4 is still impossible. They are stored in some twisted way, with some additional key parameters which I don't know. My tool works without those parameters, that's why it maked the file size so big.
Okay, to sum up all that limitations I will tell what you actually CAN do with this tool:
+1+ You can easily create the Inventory screen animations (when your character stays equipped with a weapon). (these .fcv are inside of BIO4\SS\cmn\ss_wep**.dat files)
+2+ You can create standing gameplay animations like knife animations, weapon animations like firing and aiming. But you should be careful with the archives file size. (these .fcv are inside of BIO4\Em\wep**.udas, BIO4\Em\pl**.udas ... etc).
+3+ You can create any animation for the cutscenes, but they also have size limitations, so usually you can change 2-3 .fcv files from a .evd cutscene. (these .fcv are inside of BIO4\Evd\r******.evd files)
OK. Enough with the talking, let's do things!
There are 2 parts in my tutorial.
In the first part we'll be creating an inventory screen animation.
In the second part we'll create a cutscene animation.
PART 1.
So, as was already said, in this part we will create an inventory screen animation. So here I have Jester. "Yoo hoo!"
BUT, he's looking too boring just standing there in an ordinary way.
So, let's take a reference pose like this
and make him repeat it in the inventory screen!
Knowledge you need for this tutorial:
-Son of Persia's File Archive Tools from here www.mediafire.com/download/c1bic6k2uqagxek/RE4+UHD+Model+Importer+Exporter+Toolset+2.rar
-3ds Max with SMD plugin (from wunderboy.org) (in theory you can use any 3d software, that supports SMD animation, but the tool was made for 3ds max, so you may face some problems if you use other software ).
-my "fromSMD" converter tool from HERE.
-a hex-editor, pick your favourite, or download HxD (there's no complex HEX stuff in this part, we will only need the value of the first byte of the .fcv file)
Also let's remeber these EXTREMELY important rules, they will be very useful through the whole tutuorial:
#1: The more bones are there in the scene before the SMD exporting, the bigger is the .fcv file size. This means that we should better delete unused bones before SMD export.
#2: We MOVE ONLY the main bone (bone_0). And we ROTATE ONLY all other children bones.
I have the video of PART1 for you, but this video it's not a tutorial, it's more like just routines, so I advice you to read this text tutorial as well, instead of just watching the video.
I will link some steps in this text tutorial to the video timeline.
STEP 1. Creating animation in 3ds max (roughly). \\ 0:00 - 5:50 in the video \\
Well, in our case it's just a 1-frame pose, but we'll add some kind of breathing animation later.
For now we just need to rotate all children bones and make a pose that we want. Don't touch bone_0 at this moment. Only chlidren bones rotations. Remember rule #2.
STEP 2. Converting rough animation to .FCV and testing it in the game. \\ begins around 6:00 in the video \\
First we need to know the length of the original animation.
Inventory screen animations are situated in BIO4\SS\cmn\ss_wep**.dat files.
Jester replaces Wesker in mercenaries, and Wesker's inventory Unarmed animation is situated in ss_wep37.dat.
So let's take it and unpack using Son of Persia 's DAT extractor downloaded earlier.
This archive has one single file and this is that very animation that we need.
Now we need to find out how long it is (how many frames does it have). \\ 7:25 in the video \\
Just drag&drop it in the hex editor and note the value of the very first byte.
The value is 5A. Let's assume this to be the frames count.
Now let's translate this to decimal system using windows calculator \\ 7:35 in the video \\
The decimal value is 90.
This means that our animation should have 90 frames. Counting the 0 frame, the last frame will be 89, which makes 90 in total. We should type 0 - 89 in the Export Range of the SMD exporter (I typed 90, but that doesn't really matter right now).
So now we need to export SMD animation. \\ see in the video \\
Now let's convert the .SMD to .FCV
To do that we should open fromSMD.bat in our text editor. These are tool's parameters. Smd file, .fcv file, frames count:
After editing the parameters just run this fromSMD.bat.
It will create the .fcv. Then replace the original .fcv with this one ( I recommend replacing files through the HEX editor, just load both files, copy everything from one and paste to another, this is far more faster than renaming the file and replacing through Windows Explorer. ) \\ see in the video 9:19 \\
Then we repack the .dat file. And replace the original wep_37.dat.
Running the game and testing \\ video - 12:28 \\
STEP3. Fixing rotation angles.
We have something already, but he stays with a wrong angle to the camera. So we just put the camera in 3ds max in a position to have this angle of view, and then rotate it as we need.
IMPORTANT: To rotate the full model we need to rotate bone_1 and bone_17 together, BUT DON'T rotate bone_0, remember the Rule #2. \\ see in the video as well 13:29 \\
You will need to play with it for some time until you will get the right angle.
STEP4. Moving the main bone ( bone_0 ).
Now we need to adjust global position, which can be achieved by moving the bone_0.
\\ 22:08 in the video \\
STEP5. Adding breathing animation.
Until now we had no animation, cause all 90 frames were only one same pose. Now let's add some simple breathing to this animation.
Nothing complicated, we will only rotate chest bone a little bit and the shoulders even a lesser bit somewhere at framу #45 and then return it back where it was. Don't forget to turn on the Auto Key. These are some basic animation principles, I won't be talking much about it. \\ see in the video beginning at 25:31 , resulting at 30:00 \\
This is basically the end of this tutorial.
After some more tweaking and playing with rotations we've got Jester performing his famous bow!
You can also see in the video at 30:00 that I place this animation in ss_wep45.dat, which is Jester holding a grenade.
I've ran into some crashes there. It happens sometimes. If that happens, you can just to type FRAMES_COUNT +1 in fromSMD.bat (which is 91 in our case).
PART2.
Creating animation for a cutscene.
I'll take r100s03 which is one of the very first cutscene: Leons' first meeting a ganado.
You will need an additional tool here. Bio4_FCV_Edit
It was created by some Japanese guy, and given to me by infern4l, thanks him a lot.
This video has better quality than the previous, so I hope you will easily understand it.
I won't be too detailed in this part because most of the stuff is repeating from the PART1.
STEP1. Preparing the animation. \\ from 0:00 in the video \\
You can see me doing a little trick here. I've extracted DMC4 animations using DMC4motion.exe created by Surveyor from xentax.com. And then I linked those bones, to the RE4 bones using rotation constraints. That's a bit of another tutorial, so if you're interested you can PM me about that.
Anyway, you should have a prepared animation in the end of this step.
BUT there's one very important thing that we need to know about the cutscene animations. They have global bone_0 position. And if you leave it at zero, the character won't be presented in the camera view.
So we need to get the position of the bone_0. \\ 2:00 in the video \\
Open the bio4fcv_edit.exe. You will see some japanese symbols here and there. Press first upper tab and chose the option that contains "(F)"
Choose your original .fcv file.
Now be very careful:
We need 3 values: X, Y, Z. Look at the picture:
Then we need to move bone_0 to those coordinates. That's all the differences. Everything else is the same as the PART1.
This was an example, you can see another example in the video where there are a lot more X Y and Z values, that doesn't matter, we need to pick first axe values, as the picture above says.
Don't forget to delete unused bones before SMD export to make the .fcv size smaller!! This can really help if you don't use many bones in your animation.
Result:
More examples of animations, created with this tool:
Hope that was useful.
Ask questions if you have them!
Today I want to talk about one of the most mysterious RE4 file format, which is .FCV.
Some prehistory is needed.
I think that you will agree, that importing custom animations in any game is something very cool yet always very hard and problematic. The .FCV files are responsible for RE4 animations. I was always quite curious about this format, but all my attempts of understanding it were in vain.
Last months I was digging deep and with some help from infern4l ( special thanks to him! ), I made a converter that converts .SMD animation (which is a well known animations format) to a .FCV animation file. Well... sorta : D
And of course, lot of thanks to Son of Persia for the file extracting\repacking tools!
So, let's get started!
But before that, to avoid any kind of misunderstandings or high expectations, I want to talk about the limitations and some of the problems that may occure. And there's A LOT of them here
.FCV is a terrible format, really. It's very complex and contains a LOT of information. To be fair, I don't fully understand some parameters in it. I won't go deep, but I will just tell the main problems:
-1- Due to some unknown parameters in the .FCV format, my SMDtoFCV converter creates unoptimized big .FCV files. I mean they enormously surpass the original animations by their size. Why is this a problem? Well, the game has some hardcoded limitations, that are set to every archive (.udas, .dat or .evd). So, when the animation in an archive surpasses the limit - the game crashes. I really want to reduce the file sizes, but to do that I need to know some of the unknown parameters in .FCV format (If there is anyone, who knows of .fcv structure, specifically what are the additional 2 parameters of the animation keys apart from the main key value, you can PM me or post here and help improving the existent tool and take down this, first and the most critical limitation).
-2- Second limitation is the animations time. It must be the same as the original animation. Nothing I can do about it.
-3- Third limitation says, that you can't do gameplay animations that make gameplay-camera move. Means that you can't make gameplay walking, running animations :\
(Weapon aiming animations should be fine).
-4- 4-th limitation is that the animations may be buggy with 60 fps setting in the game options.
-5- Exporting original animations from RE4 is still impossible. They are stored in some twisted way, with some additional key parameters which I don't know. My tool works without those parameters, that's why it maked the file size so big.
Okay, to sum up all that limitations I will tell what you actually CAN do with this tool:
+1+ You can easily create the Inventory screen animations (when your character stays equipped with a weapon). (these .fcv are inside of BIO4\SS\cmn\ss_wep**.dat files)
+2+ You can create standing gameplay animations like knife animations, weapon animations like firing and aiming. But you should be careful with the archives file size. (these .fcv are inside of BIO4\Em\wep**.udas, BIO4\Em\pl**.udas ... etc).
+3+ You can create any animation for the cutscenes, but they also have size limitations, so usually you can change 2-3 .fcv files from a .evd cutscene. (these .fcv are inside of BIO4\Evd\r******.evd files)
OK. Enough with the talking, let's do things!
There are 2 parts in my tutorial.
In the first part we'll be creating an inventory screen animation.
In the second part we'll create a cutscene animation.
PART 1.
So, as was already said, in this part we will create an inventory screen animation. So here I have Jester. "Yoo hoo!"
BUT, he's looking too boring just standing there in an ordinary way.
So, let's take a reference pose like this
and make him repeat it in the inventory screen!
Knowledge you need for this tutorial:
-Son of Persia's File Archive Tools from here www.mediafire.com/download/c1bic6k2uqagxek/RE4+UHD+Model+Importer+Exporter+Toolset+2.rar
-3ds Max with SMD plugin (from wunderboy.org) (in theory you can use any 3d software, that supports SMD animation, but the tool was made for 3ds max, so you may face some problems if you use other software ).
-my "fromSMD" converter tool from HERE.
-a hex-editor, pick your favourite, or download HxD (there's no complex HEX stuff in this part, we will only need the value of the first byte of the .fcv file)
Also let's remeber these EXTREMELY important rules, they will be very useful through the whole tutuorial:
#1: The more bones are there in the scene before the SMD exporting, the bigger is the .fcv file size. This means that we should better delete unused bones before SMD export.
#2: We MOVE ONLY the main bone (bone_0). And we ROTATE ONLY all other children bones.
I have the video of PART1 for you, but this video it's not a tutorial, it's more like just routines, so I advice you to read this text tutorial as well, instead of just watching the video.
I will link some steps in this text tutorial to the video timeline.
STEP 1. Creating animation in 3ds max (roughly). \\ 0:00 - 5:50 in the video \\
Well, in our case it's just a 1-frame pose, but we'll add some kind of breathing animation later.
For now we just need to rotate all children bones and make a pose that we want. Don't touch bone_0 at this moment. Only chlidren bones rotations. Remember rule #2.
STEP 2. Converting rough animation to .FCV and testing it in the game. \\ begins around 6:00 in the video \\
First we need to know the length of the original animation.
Inventory screen animations are situated in BIO4\SS\cmn\ss_wep**.dat files.
Jester replaces Wesker in mercenaries, and Wesker's inventory Unarmed animation is situated in ss_wep37.dat.
So let's take it and unpack using Son of Persia 's DAT extractor downloaded earlier.
This archive has one single file and this is that very animation that we need.
Now we need to find out how long it is (how many frames does it have). \\ 7:25 in the video \\
Just drag&drop it in the hex editor and note the value of the very first byte.
The value is 5A. Let's assume this to be the frames count.
Now let's translate this to decimal system using windows calculator \\ 7:35 in the video \\
The decimal value is 90.
This means that our animation should have 90 frames. Counting the 0 frame, the last frame will be 89, which makes 90 in total. We should type 0 - 89 in the Export Range of the SMD exporter (I typed 90, but that doesn't really matter right now).
So now we need to export SMD animation. \\ see in the video \\
Now let's convert the .SMD to .FCV
To do that we should open fromSMD.bat in our text editor. These are tool's parameters. Smd file, .fcv file, frames count:
After editing the parameters just run this fromSMD.bat.
It will create the .fcv. Then replace the original .fcv with this one ( I recommend replacing files through the HEX editor, just load both files, copy everything from one and paste to another, this is far more faster than renaming the file and replacing through Windows Explorer. ) \\ see in the video 9:19 \\
Then we repack the .dat file. And replace the original wep_37.dat.
Running the game and testing \\ video - 12:28 \\
STEP3. Fixing rotation angles.
We have something already, but he stays with a wrong angle to the camera. So we just put the camera in 3ds max in a position to have this angle of view, and then rotate it as we need.
IMPORTANT: To rotate the full model we need to rotate bone_1 and bone_17 together, BUT DON'T rotate bone_0, remember the Rule #2. \\ see in the video as well 13:29 \\
You will need to play with it for some time until you will get the right angle.
STEP4. Moving the main bone ( bone_0 ).
Now we need to adjust global position, which can be achieved by moving the bone_0.
\\ 22:08 in the video \\
STEP5. Adding breathing animation.
Until now we had no animation, cause all 90 frames were only one same pose. Now let's add some simple breathing to this animation.
Nothing complicated, we will only rotate chest bone a little bit and the shoulders even a lesser bit somewhere at framу #45 and then return it back where it was. Don't forget to turn on the Auto Key. These are some basic animation principles, I won't be talking much about it. \\ see in the video beginning at 25:31 , resulting at 30:00 \\
This is basically the end of this tutorial.
After some more tweaking and playing with rotations we've got Jester performing his famous bow!
You can also see in the video at 30:00 that I place this animation in ss_wep45.dat, which is Jester holding a grenade.
I've ran into some crashes there. It happens sometimes. If that happens, you can just to type FRAMES_COUNT +1 in fromSMD.bat (which is 91 in our case).
PART2.
Creating animation for a cutscene.
I'll take r100s03 which is one of the very first cutscene: Leons' first meeting a ganado.
You will need an additional tool here. Bio4_FCV_Edit
It was created by some Japanese guy, and given to me by infern4l, thanks him a lot.
This video has better quality than the previous, so I hope you will easily understand it.
I won't be too detailed in this part because most of the stuff is repeating from the PART1.
STEP1. Preparing the animation. \\ from 0:00 in the video \\
You can see me doing a little trick here. I've extracted DMC4 animations using DMC4motion.exe created by Surveyor from xentax.com. And then I linked those bones, to the RE4 bones using rotation constraints. That's a bit of another tutorial, so if you're interested you can PM me about that.
Anyway, you should have a prepared animation in the end of this step.
BUT there's one very important thing that we need to know about the cutscene animations. They have global bone_0 position. And if you leave it at zero, the character won't be presented in the camera view.
So we need to get the position of the bone_0. \\ 2:00 in the video \\
Open the bio4fcv_edit.exe. You will see some japanese symbols here and there. Press first upper tab and chose the option that contains "(F)"
Choose your original .fcv file.
Now be very careful:
We need 3 values: X, Y, Z. Look at the picture:
Then we need to move bone_0 to those coordinates. That's all the differences. Everything else is the same as the PART1.
This was an example, you can see another example in the video where there are a lot more X Y and Z values, that doesn't matter, we need to pick first axe values, as the picture above says.
Don't forget to delete unused bones before SMD export to make the .fcv size smaller!! This can really help if you don't use many bones in your animation.
Result:
More examples of animations, created with this tool:
Hope that was useful.
Ask questions if you have them!