Europa Universalis IV

Europa Universalis IV

Not enough ratings
How to create 3D units models for EU4[OUTDATED]
By MrAdrianPl and 1 collaborators
This tutorial wont show you how to model 3d models if you want to know how find other tutorial. main goal of this tutorial is to help new unit moders with existing blender converter and problem which may cause using it.
to have any use of this tutorial you need to know some basics of blender.
   
Award
Favorite
Favorited
Unfavorite
JoroDox Tool
From this point im starting the proper tutorial

First of all The JoroDox, this tool will allow:
-converting models from dae to pdxmesh and viceversa
-creating anims
-assigning textures and shaders to model
-checking do model, animation will work properly

JoroDox its quite intuitive tool however have some drawbacks, especialy in compare to his alternative pdxconverter however this converter is supported only by maya. Using this tool its easy its also have other tools which are useful in moding.
Blender
Blender its 3d modeling and animation tool which is free to use
What you need to know after you learn how to create unit model:
-First of all you need to know its that you should use armatures exported from game however creating own armature its possible you can find info about it in next chapter of the guide.
So export model form game files, best one will be one of western models. this model will help with addjusting the proportions.
Locking pose
-Now we will set very important things assign armature to model and select armature press ctrl + a, press lock location then look on side window and check also rotation and scale. if youll not check it, unit will: lay on ground or have really small size however size may be changed after in text files
UVS
-Build exact model from multiple Parts it will be really helpfull when you will split the object into uvs
-Next thing which can make problems is UV try to make UV splited as object are.Do not leave loosen poligons it may cause that model will have gap in places where this poligon should be conected to rest of UV. This only referes to animated objects static ones can be splited as you want.
-Model should be mearged into one object, there is one exception its situation when you want to use multiple shaders however use it on static object. its possible to use this on animated object however it may be complicated to keep animation work without breaks in model.
-So if you want to assign the flag you need to separate it as object and also create new separate UV in vertex groups tab in properties their names should be diffrent
Animations
-Most annoying part when you are using blender you need to make new anims its caused by that your armature its set to play by default 30 fps anim most ingame anims use format 15.26 fps so all your units cant use anims from game. Maya converter converts both armatures and anims by default to pdx anims format
-Select all bones in pose mode and bake each anim but before doing so make copy of raw anim which you made.Beaking anim will make anim smother and also you not need to put anim speed modifier to each line in txt files.
misc
-models should have set materiall with diffuse on 100% level
-export model as .dae also btw one file can contain only one anim so you need to assign anim and export each as separate file
its all you should know about Blender and why something not work as you wished
Creating New Armature
This section will describe how to make wroking armature as well it tell you how to setup working human ik on existing armature from game

Own Armature creation
Its not very complicated if you need to create own armature you should remember about only few things.
First of all armature need root bone, its very important since without root attaching model to anything will be imposible, also its good to add "attach_free" since this bone is very often used in armatures as corection to root postion.
Exported armature cant have unparented bones it just wont work if any of bones dont have proper parent.
you can add to model any number of attach_xxx which will allow later to pin some objects to unit in txt files by adding few lines.
Human IK
Its little more complicated but its very helpfull if you want to make realistic looking animation of move theres no chance to achive this without setting proper IK.
First of all you need to add to armature control and pole bones:
Go to edit mode and then select point in place where the model knee is. extrude it then press y to detach this bone.
Now select both feets press shift + d to duplicate then detach. its convenient to rename all thoes bones after creating them to control_side and pole_side or whatever you want to.
After creating this bones you should go to bone tab of every of control/pole bones and deactivate deformation.
Now we set ik for model:
go to pose mode select r_knee bone and then go to bone constraints tab add inverse kinematics constraint as a target you need to select armature ctrl bone, as a pole target you need to set your pole bone.
now you model may be clusterf***** its dosent matter, set chain lenght to 2 and pole angle to 180 degrees or addjust it to your need. Remember to move pole bones little away from ik bone
and pose it stright when you set pole angle.
on the very end select feet and add Copy Transforms constraint your control bone should be target.
end effect:
Animations
if you want to learn how to create anims you should watch some tutorials about it i cant help you much this tutorial would be very long if i focus on describing how to animate also its hard to show it by text.
however this tutorials may be usefull for very basics:
Rigging
Tutorial about move cycle
GIMP
Im not an expert when it comes to texturing so you should look on other tutorials
how to assing country colores to model texture https://forum.paradoxplaza.com/foru...rial-asian-unique-unit-model-coloring.795377/
I can say something about normal maps so when you have your diffuse to achive smooth looking bump like in pdx maded units you need to duble the size of diffuse blur/smoth it a little then use normal map plugin
Text Editing
Now convert your own made 3d model into pdxmesh and yours anims into .anim files
create folder interface inside folder assets then create file yourunitpackname.gfx and there you will define the model itselff (not a proper unit)
for e.g.
pdxmesh = {
name = "TAG_infantry_01_mesh"
file = "gfx/models/Units/TAG_infantry_01.mesh"

animation = { id = "attack" type = "myanimname" }
animation = { id = "death" type = "myanimname" }
animation = { id = "idle" type = "myanimname" }
animation = { id = "walk" type = "myanimname" }
animation = { id = "retreat" type = "myanimname" }

scale = 0.5
}
then we need to create gfx folder inside main mod folder also then create inside it models/Units/animation directory and entities folder
inside Units folder you need to put yours models and textures inside animation folder you want to put anims and create file name.asset
inside you need to define anims as:
animation = {
name = "anim name"
file = "file name"
}
so we defined model and animations now we will create unit so in enitites folder create yourunitpackname.asset file and in this file define the unit
e.g.
there are some properties you can set:
animation_speed = 1.0 will speed up or slow anim as you wish
version = x will overwirite models with lower num so higer value overwrite more units, lowest value its 2 to overwrite western base unit
attach = { } will allow to attach to bones some objects armature bone name = "object name"
entity = {
name = "TAG_INFANTRY_1"
pdxmesh = "nameofmodel"
version = 10

state = { name = "idle" animation = "idle" animation_speed = 1.0 }
state = { name = "walk" animation = "walk" animation_speed = 2.0 }
state = { name = "attack" animation = "attack" animation_speed = 2.0 }

attach = {
Right_hand_node = "the_knights_shield"
attack_L_hand = "crusader_sword"
}

}
Attachments are defined by name of bone you can assign any object to existing bones
the standard armature have few bones designed only to be a atachment:
Right_hand_node or in some cases attack_R_hand
Left_hand_node or in some cases attack_L_hand
attach_back
attach_free
if you will make own armature you need to properly name the bones
Tutorial is still WIP if there is something unclear comment it
The Outcome Presentation
In this part you can see some screens of my and xangelo work. also if you want share your work in comments.

Credits to Xangelo
Credits to Xangelo
13 Comments
humbleacadie Mar 9, 2023 @ 11:29am 
Hello, sorry to unearth the subject but does anyone know how to adapt this tutorial to building models ?

I know how to create new Static models (ie. map decoration like monuments)

I would like to create my own type of forts, manufactories etc though, and spawn them on map once built by the AI/player.
MrAdrianPl  [author] Jan 11, 2020 @ 5:30am 
If anyone is waiting for update of the guide i posted new one that is suplement to this one
MrAdrianPl  [author] Dec 10, 2019 @ 5:29am 
This guide is quiet outdated i have planed to make new one though i didnt have time for it. I think i can add some small video about it when ill find a while.
The-Grazzil Dec 9, 2019 @ 10:40am 
could you make like 2-4min long video how to add bones and make animation? the animation is the only thing that doesn t work for me
MrAdrianPl  [author] Jul 26, 2019 @ 7:44am 
Yes we would be able although we are working on a big project and we wont be interested in making such models.
Grjóni Grjónason Jul 21, 2019 @ 3:12pm 
Do you think that you could make GoT units for the GoT mod like Lannister soldiers stark soldiers and ect? that are like in the TV show??
MrAdrianPl  [author] Nov 24, 2018 @ 11:56am 
I can explain you more about it in pm just join the EU4 Unit Modding discord you can find links in every pack from xangelo.
Volcore Nov 24, 2018 @ 9:39am 
How exactly would I go about creating a new animation, similar to the old one for the mesh?
MrAdrianPl  [author] Nov 24, 2018 @ 2:28am 
if you have modified models in blender that will happen since its interpreting somehow difrently armatures than maya, you need to create anims compatible with the new mesh. if you want you can download this osp bellow tutorial or else i can share some other of my animations with you.
Volcore Nov 23, 2018 @ 8:56pm 
So, I'm new to the modding scene, and I'vew tried adding in a new animation, to a default model, howevre the unit in game is malformed, there doesn't seem to be any errors, in the error log.

Here's an example:
https://imgur.com/a/u23pVkq

Sorry for the necro