Difference between revisions of "Documentation/Engine/Mover model group"

From SCS Modding Wiki
Jump to navigation Jump to search
m
(Created page with "__TOC__ Road events (RE) are dynamically generated situations on roads present in ETS2 and ATS.")
(34 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
__TOC__
 
__TOC__
  
Mover model group is a new mover definition unit. The idea of this new unit is to have a system which can easily combine compatible models and animations. The main use is for characters to remove the need of definition for every combination of models and animations. Moreover these mover groups can use props in separate models and you can easily "skin" them to specific bones.
+
Road events (RE) are dynamically generated situations on roads present in ETS2 and ATS.
 
 
The whole system consists of four units:
 
 
 
== Mover desc ==
 
 
 
Unit <code>mover_desc</code> represents model and its data. It is located in <code>/base/def/world/mover_desc.sii</code>.
 
<pre>
 
mover_desc : mover_desc.worker_3 {
 
    model_desc: "/model/mover/characters/new_generation/new/models/man/worker_vest/worker_vest_nemiro_lod0.pmd"
 
 
 
    lods[0]: "/model/mover/characters/new_generation/new/models/man/worker_vest/worker_vest_nemiro_lod1.pmd"
 
    lods[1]: "/model/mover/characters/new_generation/new/models/man/worker_vest/worker_vest_nemiro_lod2.pmd"
 
    lods[2]: "/model/mover/characters/new_generation/new/models/man/worker_vest/worker_vest_lod3.pmd"
 
 
    lod_distances[0]: 10
 
    lod_distances[1]: 30
 
    lod_distances[2]: 90
 
 
 
    group_tags[]: human
 
    group_tags[]: man
 
    group_tags[]: cauca
 
    group_tags[]: worker
 
}
 
</pre>
 
'''Properties:'''
 
* <code>model_desc</code> Model descriptor.
 
* <code>model_coll</code> Model collision.
 
* <code>lods</code> Model lod descriptors.
 
* <code>lod_distances</code> Lod distances.
 
* <code>group_tags</code> Group tags. More about it in '''mover_model_group''' section.
 
 
 
== Mover anim ==
 
 
 
Unit <code>mover_anim</code> represents animation and its data. It is located in <code>/base/def/world/mover_anim.sii</code>.
 
<pre>
 
mover_anim : mover_anim.sweeper {
 
    model_anim: "/model/mover/characters/new_generation/animations/universal/sweeping_anim.pma"
 
 
 
    group_tags[]: human
 
    group_tags[]: man
 
    group_tags[]: sweeper
 
 
 
    props[]: mover_props.sweeper.broom
 
}
 
</pre>
 
'''Properties:'''
 
* <code>model_anim</code> Animation descriptor.
 
* <code>group_tags</code> Group tags. More about it in '''mover_model_group''' section.
 
* <code>props</code> Array of link pointers to animation props.
 
 
 
== Mover anim props ==
 
 
 
Unit <code>mover_anim_props</code> represents animation props and its settings. It is located in <code>/base/def/world/mover_anim_props.sii</code>.
 
<pre>
 
mover_anim_props : mover_props.sweeper.broom {
 
    model: "/model/mover/characters/new_generation/models/props/independent/broom.pmd"
 
    bone_a: lefthand
 
    bone_b: righthand
 
    bone_offset_a: (0.03, 0.08, 0)
 
    bone_offset_b: (-0.2, 0.16, -0.15)
 
    model_offset: (0.0, 0.0, -0.67)
 
    model_rotation: (0.0, 0.0, 0.0)
 
}
 
</pre>
 
'''Properties:'''
 
* <code>bone_a</code> First bone to "skin" prefix.
 
* <code>bone_b</code> Second bone to "skin" prefix.
 
* <code>bone_offset_a</code> Skin offset for the first bone.
 
* <code>bone_offset_b</code> Skin offset for the second bone.
 
* <code>model</code> Props model descriptor.
 
* <code>model_animation</code> Props model animation.
 
* <code>sync_animation</code> Force time synchronization between props animation and mover animation.
 
* <code>model_offset</code> Props placement offset.
 
* <code>model_rotation</code> Props placement rotation.
 
'''How does it work?'''
 
 
 
Props is rendered and placed as separate model. Using bone A and bone B we can attach the props to the mover skeleton. There are three possible setups.
 
: '''1) No bones are set.'''
 
::Props is placed to the mover origin plus <code>model_offset</code> and with zero rotation plus <code>model_rotation</code>.
 
:: For example a bucket on the ground.
 
: '''2) Bone A is set only.'''
 
::Props is placed to the bone A placement plus <code>bone_offset_a</code> plus <code>model_offset</code> with bone A rotation plus <code>model_rotation</code>.
 
:: For example a sponge in one hand.
 
: '''3) Bone A and bone B are set.'''
 
::Props is placed to the bone A placement plus <code>bone_offset_a</code> plus <code>model_offset</code> with rotation given by direction vector ('''from''' bone B placement plus <code>bone_offset_b</code> '''to''' bone A placement plus <code>bone_offset_a</code>) plus <code>model_rotation</code>
 
:: For example a broom in both hands.
 
 
 
== Mover model group ==
 
 
 
Unit <code>mover_model_group</code> represents all valid combinations between specified mover desc and mover anim. It is located in <code>/base/def/world/mover.group.sii</code>. But it can placed in any mover def file.
 
<pre>
 
mover_model_group: mover.work_sw_all {
 
    mover_name: "worker sweeper all"
 
 
 
    desc_tags[]: man
 
    desc_tags[]: worker
 
    anim_tags[]: man
 
    anim_tags[]: sweeper
 
}
 
</pre>
 
'''Properties:'''
 
* <code>desc_tags</code> Mover desc tags.
 
* <code>anim_tags</code> Mover anim tags.
 
* <code>country_specific</code> If true then only mover desc containing country tag given by mover placement will be generated.
 
'''How does it work?'''
 
 
 
When the unit is loaded, it collects all mover desc containing all tags from the <code>desc_tags</code> property and all mover anim containing all tags from the <code>anim_tags</code> property. When the mover is generated, it randomly chooses one of the collected mover desc and then it tries to choose one of the collected mover anim which use the '''same skeleton''' as the choosen mover desc model.
 
 
 
This is important because sometimes you want to have group containing models with different skeletons and animations with different skeletons. But you want only valid model-anim combinations. '''For example''' group of walking men and women where men use different skeleton than women.
 
 
 
'''Optimization'''
 
 
 
Because engine ensures that only valid model-anim combinations will be created, it may seem that animation tags should contain only tags describing the animation activity. But because the model-anim combinations are choosen in the moment of mover generation, we want to limit the combination pool as much as possible. Because of that mover anim tags should contain (apart from the activity itself) tags describing compatible mover desc. In <code>mover_anim</code> the example above these tags are <code>human</code> and <code>man</code>. And in the related mover group use these tags in <code>anim_tags</code>. In the example it is the tag <code>man</code>.
 

Revision as of 10:18, 2 May 2019


Road events (RE) are dynamically generated situations on roads present in ETS2 and ATS.