-
Notifications
You must be signed in to change notification settings - Fork 31
Art ‐ 3D Getting Assets Into the Mod
EVERYTHING IS WIP
All models and their respective textures and animations can be found in /Crusader Kings III/gfx/models/
A typical model in ck3 will have the following files:
- .mesh - The 3d model itself.
- .asset - The script adding the model to the game.
- _diffuse.dds - The diffuse texture for the model.
- _normal.dds - A normal map texture.
- _properties.dds - A joint texture with specular, metalness and roughness.
More textures for other 3d models include:
- _unique.dds - Used with the standard_atlas shader. The B channel is the models’ ambient occlusion texture.
Triangles roof for 3d Models
For Map models the maximum roof should be around 10 000, but try to keep it way lower then that. I know other mods that have the maximum triangles for map models set to not go over 2500 triangles.
For cloths/armour models try to keep within
-
7500 triangles for clothes.
-
5000 triangles for headgears.
-
4000 triangles for capes.
- Autodesk Maya. A program used to create 3d models and animation. Needs the Clausewitz Maya Exporter installed.
- Clausewitz Maya Exporter. A Maya plugin from Paradox. Setup models based on installed games and exports model and asset. Installation instructions linked in the forum post and below.
- Blender. A free program used to create 3d models and animation.
- IO PDX Mesh addon. Addon that can be installed to Blender or Autodesk Maya. Setup models from compatible games. Installation instructions on their page.
There is a full setup guide for the Paradox wiki Exporters. The below guide is shortened.
To setup CK3 for the exporter, open the clausewitz.settings file using a code editor, edit the folder paths and then save. The folder paths for CK3 are as follows:
- "name": "CrusaderKingsIII"
- "path": "C:/SteamLibrary/steamaps/common/Crusader Kings III/game/tools"
- "export_path": "Your personal mod’s folder"
- "target_exe": "C:/SteamLibrary/steamaps/common/Crusader Kings III/binaries/ck3.exe"
Notes:
- Your mod’s gfx/models folder can be anywhere on your C drive. You can choose to edit the settings for every mod you edit, or use one folder and copy your models from there to your mod.
- The / slash (forward slash) is important, Windows Explorer uses \ (backwards slash). If you copy from Windows Explorer, you will need to edit the folder paths to use /.
- The name must be one word, no spaces.
UVs
Order of UV maps for the standard_atlas shader:
- map1 - uv mapped to AO "_unique"
- map2 - uv mapped material atlas
Issues with UV maps
This can catch you off guard when creating your model, map1 must be above map2, map1 must be the default uv set in Maya. If you’re importing the model from Blender as a .dae file, the uv maps must be in the correct order in Blender too. If your uvs are not in the correct order, then use this method to rearrange them. I do not know a method to delete the default uv set in Maya. The issue is that map1 is mapped to your material atlas.
- UV - UV Set Editor. Copy map1.
- Select map2 in the UV Set Editor.
- UV - UV Editor. Then in the UV Editor, UV Sets – Copy UVs to UV Set. Choose map1.
- In the UV Set Editor delete map2.
- Rename UVSet1 (originally copied from map1 in step 1) to “map2”.
- Select map1 and click Update.
Broken normals
Use Maya’s Mesh Cleanup tool (with default settings) to solve Error! Mesh contains broken normals, tangents and/or bitangents.
Introduction
So! you wanna get your Hair Model into the Mod, well First we'll need to make sure everything is set up in Blender before setting up the other files. So in this "Tutorial" I'm be using an Beard without an mustache that I worked on, I used the Base Game's Indian Beard 3 "Mesh" file, as you can see below.
Click to expand
I did a half-decent job in removing the mustache and and tweaking some other stuff.
Click to expand
- You Might have noticed that these weird dots have been saved on the photo, these are the rigs, that will tie the new beard Mesh file/model to the ck3 faces. But First we'll need to rename our Beard. In The Indian Beard asset bellow you'll see the base file, in the second picture I've renamed my copied assets into the name
male_beard_mountain_orc_01
which I'll be using a lot forward and made a separate folder for them, which in this case I've put intoLotRRealmsInExileDev\gfx\models\portraits\attachments\male_beards\Uruk\
.
Click to expand
Vanilla Base files for the Beard.
My copied files that I've renamed fittingly
- Here you see a file called
male_beard_mountain_orc_01.asset
we will return to this later! For now we'll make sure that we put the correct files that we've renamed into Blender! Start with going into the Material tab and make sure the Material have a decent name, starting withPDXmat_
and continues with your chosen file name, then go the the Surface put themale_beard_mountain_orc_01_diffuse.dds
into the Base Color segment and then male_beard_mountain_orc_01_properties.dds into the Roughness section.
Click to expand
Arrow point to where the Material tab, Surface, Base Color and Roughness sections are.
- Now we need to make sure the Rigging is alright! The rigging you can see in Blender at the top right corner area, it's usually called Io_pdx_rig, (Io_pdx_rig inside yellow circle on the picture) so we'll need to go to Modifier Properties tab and look there! In the Object section it should say Io_pdx_rig, if not, click on it at choice it!
Click to expand
Io_pdx_rig is inside the yellow circle on the picture, in the Blue box is the Object section & the Green arrow point to the Modifier Properties tab.
- Now we'll need to go to the Object Data Properties tab. Here you should if not already there you Mesh name file. Then in the Vertex Group section you should see a bunch of rigging bones.
Click to expand
3.1 "If" the rigging bones don't show in the Vertex Group section, you'll need to get them there by doing some wight stuff. You'll need to add a Beard Mesh, either the same or a similar one. Make sure that the one you add have the rigging bones don't show in the Vertex Group section. When you've confirmed that you'll need to Select both and go into Weight Paint. Then click on Weight and click on the tab called Transfer Weights. Then directly under Weights there will be a small window called Transfer Mesh Data, click on that and then go to the section called Sources Layers Selection and click and force it to source it By Name.
Click to expand
Select both .Mesh files and go into Weight Paint.
click on Weight and click on the tab called Transfer Weights.
Under Weights, down toward the bottom you'll see a small window called Transfer Mesh Data, clicking on opens a bigger window ui and here you'll find the section called Sources Layers Selection and where you can click to source it By Name.
- Now we're ready to go back to the Folder where we put our beard mesh! Open your equivalent asset file to this examples
male_beard_mountain_orc_01.asset
using program Notepad++ . Here you'll need to write or rename the current files so they fit with your file.
Click to expand
Ck3 base game names, there is longer because they've accounted for more body types, where this example have yet not done so.
The new file using the Beard Example.
- Now you'll need to go to the file
lotr_breads.txt
inside the folderLotRRealmsInExileDev\gfx\portraits\accessories
, open it with Notepad++ and write in entity codes similar like the already existing ones, using your file name, check example below.
Click to expand
- Now we'll need to set up a Beard/Hair gene. Go to the folder
LotRRealmsInExileDev\common\genes
and we'll open the file04_genes_special_accessories_beards.txt
using Notepad++ for this example, other files will need to be open for their respective focuses. You'll need to up your designated file name with a1 =
before it, and it'll look like something like this1 = male_beard_mountain_orc_01
then put it in line with the others. But you can also make your own gene pool, so you'd be able to assign culture and so on in the future to use beards from this pool. Scroll down, copy an already existing one and add the fitting code names for your file.
Click to expand
All Beards section.
Your own gene pool.
- Now you'd need to add some code for Portrait Modifers. Go to the folder
LotRRealmsInExileDev\gfx\portraits\portrait_modifiers
and open01_custom_beards.txt
using Notepad++ . Find a fitting similar section and copy it, or at least copy the beard parts. And put your code into a fitting area, check picture bellow.
Click to expand
- Now we'll need to set up our Localization. Go to the folder
LotRRealmsInExileDev\localization\english\portraits
and open the filelotr_portrait_modifiers_l_english.yml
using Notepad++ . Then go the the appropriate section like Hair or Beard and add your code line by either writing it yourself or copy an existing one, putting your file code name in and the appropriate name you want to be shown in-game, In this example it's coded asPORTRAIT_MODIFIER_custom_beards_male_beard_mountain_orc_01:0 "Mountain Orc Long Beard"
under the beard and male section, check the bellow example.
Click to expand
- Now we're ready to open up our game! Go to Character Creation, and check the area of content you've added an asset for, and with some luck from the goddess Victoria you'll will have been bestowed upon with Glorious Success and your asset are now in-game!
Click to expand
Still WIP/not worked on for now, but very similar to hair.
WIP
WIP
Still WIP/not worked on for now
You want to import an asset from an other game? Or more likely, an other game mod that we collaborate with! Well here is some common ones and how to import them
Well, total war files are bit hard to open up themselves. So we'll need some programs to get to the file!
- Well, if you'd like to open total war model file from say.. Attila total war, You'll need to get a Pack File Manager. This is the Pack File Manager with Attila supported starting from version 3.5.
Click to expand
Download page
Follow the instructions and install the program, once finished it should look like this:
Click to expand
the Pack File Manager program running
- Now we've need to open the asset we want to use! Go to
Program Files (x86)\steamapps\common\Total War Attila\data
or a simmilar site where you would have your game installed, here if you have any mods installed you will see them as .packs, if you would like to open a armour model, then you should open thesomething_models.pack
. (Look bellow for an example).
Click to expand
File location
- Now we've got access to the model files & textures! While the textures are
dds
files the model files arev2
files and are not supported for programs like Blender. So we'll need need a new program to converts these.
Click to expand
Red: stretches out the original names for not to showcase the examples being used. Blue: the model files Yellow: where you'll find the textures.
- Now we'll need to extract the model we want, right click on the specific or more model files you want, go to extract and extract the selected ones, then chose a folder path where you want to put these. Now these would be saved as folder named variantmodels and in this folder path you'll see the
v2
file model (under some more folders, check pictures bellow).
Click to expand
How to extract
How they will be saved.
The folder which contains the model v2 file.
- To unpack these files we'll need a converter, the RMV2 Converter, go to the link provided and download it. Once downloaded and installed it should look like the picture bellow.
Click to expand
- Now go to Menu and click on Open RMV2 then go to the folder where you've extracted your
v2
file and open that. Now Click on the Big button called EXPORT MODEL this will allow you to save the imported model in thev2
file format to the RMV2 Converter in a DAE file format in a folder of your choosing. This file format is supported by programs such as Blender, which is what we wanted.
Click to expand
Menu and click on Open RMV2
this is the EXPORT MODEL button you need to click after imported the v2 file
[This Wiki Page is still very WIP and it will likely se many revisions]