Great job Vikus, congratulation
Great job Vikus, congratulation
Now the mod is in the Steam Workshop! : -> http://steamcommunity.com/sharedfile...13&searchtext=
(I thank all the people who supported me there, too! )
So, the tutorial how to import weapons + textures coming soon!
Regards,
Vikus
Tutorial: How to add own equipment models to Shogun 2
The structure:
In the data-folder (C:\Program Files (x86)\Steam\SteamApps\common\total war shogun 2\data) is a packfile named “models2.pack”. In this .pack are saved the meshes of the unit parts and the equipment. The equipment directory in the .pack contains “mesh1.variant_part_mesh” and “mesh2.variant_part_mesh”. In the same directory are the textures for the equipment models, too. They are named with “texture1_...” and “texture2_...”. The numbers describe for which mesh the textures are.
- mesh1.variant_part_mesh
→ texture1_diffuse (colour)
→ texture1_gloss (light ratio)
→ texture1_normal (bump)
- mesh2.variant_part_mesh
→ texture2_diffuse (colour)
→ texture2_gloss (light ratio)
→ texture2_normal (bump)
The game permits to add new meshes to the game so theoretically we can add “mesh3.”, “mesh4.”, “mesh5.” files. If you now want to add new equiment models you have to prepare a new equipment file named “mesh3.variant_part_mesh”.
Preparation:
For this I used the equipment-file from spartan_warrior as a base:
http://www.twcenter.net/forums/showt...1#post13111842
Now you have to open it in 3ds Max 2010. With right-click and then “Hide Unselected” you have to hide all things in the scene. A right-click again and choose “Unhide By Name” then. You have to select all “rigid_equip_...”-models and to unhide them. After this you must delete these models (if needed: keep one weapon to see its position later). Be careful that you don't delete any bone or a “properties...”-object! Go to “Tools → Manage Layers” and delete all Layers except “Weapon Bones”, “Skeleton” and “0 (default)”. Create a new Layer with the name you want to name your weapon later, too. When you have done this you have created the base of your new equipment-file.
Add and weight a new weapon:
Now you can add the model of your own weapon (in the “Modify”-Tab it should be “Editable Poly”). You can also add more than one weapon to this file. Simply merge it into the scene. Now you have to hide all except the “Weapon1”-bone (the Weapon1-bone is for swords I think, I don't know for what the Weapon2- and Weapon3-bones are). This “Weapon1”-bone has a thinner and bigger end. The bigger end is in the hand of a model later. So you have to lay down your weapon so it lays “in” the bone. To see where's the end of the hand I used the No-Dachi-Sword so I can ensure that the model won't hold only the sword with the handle later. When the weapon has a nice position, rename it to “rigid_equip_..._lod01”. For the “...” you can choose a name. Now clone the model with “Instance” so you have four models named from “...lod01” to “...lod04”. Go to “Manage Layers” again and put the four objects into your Layer you created.
After this you have to weight your models, so select your four models and go to “Modifiers → Animation → Skin”. Make a right-click on the scene and select “Select Vertices”, after this select “Envelope”. Go to the Parameters of the “Skin”-Modifier and add the “Weapon1”-bone. You have weighted your models now. Export the scene to “.CS2”.
You should save the 3dsMax-file and the CS2-file in the modding folder:
raw_data\art\battle\land\models\soldiers\VariantModels\UnitParts\Japan\equipment
In this folder should be the texture pictures and the “rules.BOB”-file, too. You have to convert the CS2-file with BOB. There are two ways to create the “mesh3.variant_part_mesh”.
1. Simply convert it with BOB and rename the “mesh1” with “mesh3” in the “working_data”-folder. (working_data\VariantModels\Equipment)
2. Edit the “rules.BOB”-file.
Structure:
[Texture]
TargetPath = VariantModels\Equipment
[NamedRigidVariant]
<Files> = equipment.cs2
AnimationType = man_shogun
TargetPath = VariantModels\Equipment
TargetFilename = mesh1 <-----------
Change “mesh1” to “mesh3”. BOB will automatically convert the CS2-file into “mesh3.variant_part_mesh”. There are also the paths of the textures and the mesh- file. So they have to be in this directory.
Your file is ready now so it can be used ingame when it is defined in the “db-tables” and the Unit Editor.
Textures:
To make textures for the weapons you have to unwrap the model and to texture it. So go into the 3dsMax-file again and select the four weapons. Go to “Modifiers → UV Coordinates → Unwrap UVW” and create your UV map. You have to create four textures in the “.TGA”-format:
- texture3_Diffuse → colour
- texture3_Gloss → see CA textures
- texture3_Level → see CA textures
- texture3_Normal → bump-map
Add this textures over the “Material-Editor” to the four models by replacing the textures from spartan_warrior. Now convert the file to the “mesh3” again and convert the textures with BOB to “.dds”-files, too.
Define the weapon in TWeak in the db-tables
Go to the “warscape_equipment_items”-table and write into “equipment_item” the name of your weapon. It must be the text between “rigid_equip_” and “lod0...”! Then choose a name for the “equipment_key”-line. After this got to the “warscape_equipment_themes”-table and write as a theme your “equipment_key”. Also define the other things you want.
Your weapon is defined now. Export the tables with BOB, now you can select the weapon in the Unit editor and you can create your unit.
Hi ,
Vikus,the Author of the "How to import self-made 3d models into Shogun2"- Tutorial,asked me that we could have both tutorials,so
1.how to integrate new Equipment like weapons ( Vikus )
2.how to integrate new unitparts like helmets ( me )
in one thread.so here is my tutorial again :
this tutorial will explain how to integrate a new model to the game.
You will need basic knowledge on how to use 3DS Max and how to use
the PackFileManager and the tool BOB.i will not explain how to build a Model.
In this example we will integrate a Hat-model as a helmet.
But first we have to clarify what software we need to doing this.
- Autodesk 3DS Max 2009 or 2010 . ( in this tutorial i use Max 2010 )
- Assembly Kit – this is the official Mod Tools-Pack from the developers.
- PackFileManager
Autodesk give the possibility to use a free student-version .
The Assembly Kit you can download at Steam.
Among others it contains the very useful tool „ BOB „, and the CS2 Converter-file :
" cs2_exporter.dle "
this dle file you have to put into the " plugins " folder of 3DS Max.
you will need the data inside of the " required Tutorial-Data " 7zip file too.
you can find it at the bottom of this post.
we will use the .max file " Suji_Bachi_Kabuto " as a base.
it is included in the " required Tutorial-Data " zip file.
Generally you can get the same max.file and others by yourself,this files are
included in the Assembly Kit.but the problem is,these files you can only open
with 3DS Max 2013.then you have to save it as a 2010 max.file .
So,download the version i have uploaded,and you can open it directly with Max2010.
PackFileManager you can download here at Total War Center .
and last but not least the Model we use for this Tutorial,you can download
the " required Tutorial-Data " - 7zip file here in this thread.the Model and other stuff we
will need is inside of this zip file.
when you have done this,we can start.
Start 3DSMax2010 and open the " Suji_Bachi_Kabuto " -max.file.
you will see the helmet.
There are 4 versions of the helmet.
Suji_Bachi_Kabuto_LOD01
Suji_Bachi_Kabuto_LOD02
Suji_Bachi_Kabuto_LOD03
Suji_Bachi_Kabuto_LOD04
LOD01 is the version the game will use when you look from close to,and have the
highest polygon-count.
The other versions the game will use when you look from more distance.
LOD04 will always have the lowest polygon-count,because this is used when you
look from the maximal distance in game.
You will see a green object on the helmet too ,it is called " AP_crests " .
this will tell the game where to place an external crest on the helmet.
External crest means,a single-objected Crest you can choose in Unit Editor.
But In this case here we can delete the AP_crests object,because
we dont want to add a external crest later.
When you unhide all,you will see the skeleton too.
A skeleton is necessary,it makes it possible that the Model move when the soldier
move.
The Shogun2-Skeleton contains the following Bones:
Hips
Spine
Spine1
Spine2
Neck
Head
Left_Mouth
Right_Mouth
Jaw
Right_Brow
Eyes
Left_Brow
LeftShoulder
LeftArm
LeftForeArm
LeftForearmRoll
LeftHand
LeftHandThumb1
LeftHandThumb2
LeftHandThumb3
LeftHandMiddle1
LeftHandMiddle2
LeftHandMiddle3
LeftHandIndex1
LeftHandIndex2
LeftHandIndex3
RightShoulder
RightArm
RightForeArm
RightForearmRoll
RightHand
RightHandThumb1
RightHandThumb2
RightHandThumb3
RightHandIndex1
RightHandIndex2
RightHandIndex3
RightHandMiddle1
RightHandMiddle2
RightHandMiddle3
Sashimono
LeftUpLeg
LeftLeg
LeftFoot
LeftToeBase
Tail
RightUpLeg
RightLeg
RightFoot
RightToeBase
Armor_Front
that is the complete skeleton.but enough to the skeleton for now.
We want to import a completely new model,so we can delete the 4 LOD´s of the
helmet now.so there is only the skeleton left.
Now we click on import,and import the Hat-Model as a obj.file . ( it is in the " required Tutorial-Data " zip file )
Use the standard-preferences , change only the Units/Scale field,and activate convert,and
and set Model Units to meters . ( Image 1 )
Now you can see the Hat – Model is there.
Yes,it is tooooo big,so we scale it to : ( yes,it is better to scale not.instead of this,it is better to model
the model in the right size,so you dont need to scale )
but in this tutorial,we scale :
X : 8,0
Y : 8,0
Z : 9,544
(you dont have to be 100 % exactly at this point,remember this is a tutorial )
and we rotate it :
X: -1,014
Y: -3,06
Z: -180,00
and we move it :
X: -0,074
Y: -0,058
Z: 0,745
the result you can see at Image 2
and here is our Hat-Model.
But we have to take care of the polygon-count.
For LOD01 about 1500 polygons should be ok.
The Hat-Model have 1.847 polygons.thats a bit more , but
this should be ok.
Actually you now have to add a Material and to create a UV-Map.
a UV-Map is necessary,it tells the game where to place the texture on the model right,
but i will not explain the UV-Mapping here,for this you should use a external tutorial.
Here is one :
http://avaxhome.ws/ebooks/eLearning/...7n76t87ro.html
lets say , this Hat - Model looks good enough,the polycount is ok,and it have a UV-Map,because
i made one before.
We give the Hat -Model the name " HAT_LOD01 "
now our Hat_LOD01 is completed.
Now we have to make Hat_LOD02.
So we want to copy the Hat.
So right-click and choose Clone .
In the popup-window choose Copy ,
and type in the name „ HAT_LOD02.
We now have to reduce the polycount only for the LOD_02 .
To doing this,there are several methods.but because this is a tutorial and we
only want to see our Model in game,we will use a fast but problematic method :
we add the ProOptimizer and click on calculate.
Here at vertex% we type in the 40,0 .
now it should be reduced to 658 polygons.
That should be ok.
We repeat this step from copy to polycount-reduction for LOD3 and 4.
for HAT_LOD3 we type in 10,0 .
now we have 131 polygons for LOD_3 .
For HAT_LOD4 we type in 4,5 .
now we have 60 polygons for LOD_4 .
Now the polygon-count is ok.
In 3DS Max the position of the Hat looks optimal.
(when you import a head from the game you have a good orientation)
But in game this will not looks that optimal.
I figured out that in most cases we have to move a Model a bit to the back-side.
Mostly about 0,015 .
So we change the y-axis value from -0,058 to -0,043 .
but in this case here at the end it will look better,when we change
it to -0,041. this could vary from the case arises.
The next step is to add a Skin-Modifier.
When we have add one,we have to add the bones from the skeleton.
Which bones you have to add vary from the unit part and the Model you want to integrate
into the game.
In this case,we want to integrate a Hat.
So the kind of unit part is a helmet.
For the most helmets you only have to add the " Head " bone.
luckily,In this case too.
So we add to every LOD- variant a Skin Modifier,and then add the Head – bone
to it.
Now we can export it.
We export it as CS2.file .
When you have put the cs2_exporter.dle file into the right folder,your 3DSMax should
be able to export it as CS2.
By the export we give it the name menpo_1.
Then we have to put this exported CS2 file into the folder
you have the Assembly Kit installed in,and then into a specific folder :
In my computer , it is :
C: / Official_Mod_Tools / ( the folder i have Assembly Kit installed )
and then :
/ raw_data / art / battle / land / models /soldiers /
VariantModels / UnitParts / Japan / masks / Menpo_1
when you have done this,we can start BOB .
Here at the left field, the Raw_data field,we have to choose the very same folder we have
put our CS2 file in.
So click click click on the + symbol until you have the Menpo_1 folder .
Here we activate the box of the Menpo_1.CS2
now go to the Working data field,and click click click always on the + symbol :
VariantModels / unitparts / japan / masks / and click on the box of masks.
in the upcoming window let the Provider actions field like it is,and in the Consumer actions field
activate the box of : Pack/Create pack file ( mod.pack ) .
now you can click on Start .
BOB convert now the CS2 file into the variant_part_mesh format , which is used
by the game.BOB create a pack.file too,and in this pack.file the converted file will
be in.
When BOB have done this,at the left side of the Window „ Cs2 „ should be
coloured in orange.then it was successfully.when it is coloured in red ,
then there is something wrong.but at Image 3 you see : the Color is Orange.
So it was successfully and we can exit BOB.
The mod.pack BOB have created you will find into
the folder you have Assembly Kit installed.
So in my case again :
C / Official_Mod_Tools / retail / data / and here is your mod.pack in.
This pack-file we open with Pack File Manager,and go to
variantmodels / unitparts / japan / masks / menpo_1
here is our variant_part_mesh file now.converted,and ready for use.
So extract it into your Assembly Kit-folder :
again,in my case :
C / Official_Mod_Tools / working_data / VariantModels / unitparts / japan / masks /
Menpo_1 /
when it ask you, choose overwrite.
Now we create a new folder here at working_data / VariantModels / unitparts / japan /
helmets / .
we copy a folder that already exist in this folder and give it the name „ AAAHat1 „
in this folder you put the variant_part_mesh file and choose overwrite .
Now we put the textures here into the „ tex „ folder .
The textures i have uploaded too,you can find them in the zip file in folder " tex " .
now we are ready to open Unit Editor and take a look on what we have made !
We choose the Default_Katana_Samurai .
Choose the ashigaru_head02 as head and our AAAHat1 as helmet .
At image 4 you can see that i forgot to move the Hat´s Y-axis from -0,058 to – 0,041 .
so the position of the Hat is not optimal.
But lets say : this is ok,because it is a tutorial .
Click on Save and exit the Unit Editor .
This will create a Unit-Variant-file . In this case :
" Samurai_Inf_Katana_Samurai.soldier.unit_variant "
This file and our „ AAAHat1 „ folder we have to import into a pack.file .
This you can do with PackFileManager again.you can use the mod.pack again.
but first delete in the pack-file you want to use the " samurai_inf_katana_samurai.soldier.unit_variant " file,
if it is in this pack file.the reason is we want that the game use our " Samurai_Inf_Katana_Samurai.soldier.unit_variant " ,and not
the standard-version.
put the mod.pack or the pack file you have imported the AAAHat1 folder and the " Samurai_Inf_Katana_Samurai.soldier.unit_variant " file into the
data folder of Shogun2.
And now,let us start the game,make a custom battle and choose the katana Samurai Unit.
Lets take a look at our Hat in the game.
Look at image 5 and 6.
good.the Samurai wear the Hat !
Here is only one problem,when you look at the Samurai from close to,
the Hat have the right texture,but when you look from more Distance,you will
see : oh no,the Hat is all grey , the texture is not on the Hat .
The reason for this problem is the way we used the ProOptimizer.
When you want to use the ProOptimizer to reduce the polygoncount,then make sure that you activate the following boxes:
-ProtectBorders
-Keep Material Boundaries
-Keep Textures
-Keep UV Boundaries
this is really important.otherwise the Pro Optimizer will destroy the UV-Map.
regarding the Hat,let us be positive : the Hat-Model is now in the Game !!!
here are two tutorials about other methods for Polygon-Reduction :
http://www.youtube.com/watch?v=rQiiEESRM7c
http://www.youtube.com/watch?v=X88u-Xti39E
this is wonderful. Thanks to everyone. If i'm successful with the weight edition soon i'll upload new units parts based on campaings agents models. By the moment I only get those deformed things
Edit: Lol this is crazy XD. I improve them but they are still ugly .. someone want to weight 3 torsos? .. they are from ishin shishi lvl3, british advisor lvl1 and shinsegumi lvl 3
Edit 2: Okay I tried it again and i did one well .. The key is to be patient and do it for each vertex .. also the rules for the game are not the same that for the 3dmax .. I realize that it dont care if it dont have efect in 3dmax, always choose the nearest bone to your vertex (example, spine 1 and spine 2 dont make change in 3dmax but they do it in the game) ... sorry for my english!
maybe i am not smart enough but somehow i managed to struggle myself with the texture files and no-one mentioned them clearly. basically i import a weapon from the internet, i managed to scale and put it in the nice spot, skin, add bone etc, everything was fine, then, about unmapping, i am not sure what i was doing, well, i created a UW map or whatever it is, and it look so weird, beside that i have to make 4 different .tga files which i dont know how to, do i need to use extra program like photoshop or something and how to colour it, i have no idea, please someone help me with detailed screen shots or video. Thanks. Here are some of my stupid screen shots
if you cannot see the picture here is the link :
https://docs.google.com/file/d/0B6TZ...JLbklhQkE/edit
https://docs.google.com/file/d/0B6TZ...NSOHZCRkk/edit
Edit : Finally i managed to figure things out. I can make new parts like torso, helmet, etc now, unfortunately i have no luck on the equipment, when i convert by BOB it crashed. Any idea? I am sure that i followed carefully instruction from Vikus, however, BOB crashed.
https://drive.google.com/file/d/0B6T...it?usp=sharing
here's my file, please help me to work out what went wrong : https://drive.google.com/file/d/0B6T...it?usp=sharing
Cheers
I can't delete layer
So for all importing model we just get mesh_variant file ? not including gloss_map, texture_diffuse, or ect
Does anyone know how to make your own new legs? When you open example legs in CA Tools, they are weirdly stretched. How can I do correctly the same with mine?