Руководство по созданию персонажей

Материал из CryWiki Russia

(Различия между версиями)
Перейти к: навигация, поиск
(Новая страница: «{{В процессе перевода|дата=18 мая 2011|автор=1}} = Character Creation Tutorial= [[Image:AssetCreation_CharacterCreationTutorial_image0...»)
 
Строка 1: Строка 1:
{{В процессе перевода|дата=18 мая 2011|автор=1}}
{{В процессе перевода|дата=18 мая 2011|автор=1}}
-
= Character Creation Tutorial=
+
= Character Creation Tutorial =
-
[[Image:AssetCreation_CharacterCreationTutorial_image001.gif]]
+
[[Файл:AssetCreation_CharacterCreationTutorial_image001.gif]]
== Overview ==
== Overview ==
-
This will be a quick overview of getting a character into the engine; I will use the freely available SDK rig as an example. To follow this example you will need 3D Studio max and CryEngine 2, including the CryEngine exporter for StudioMax. (supplied on the Crysis /Tools folder)  
+
This will be a quick overview of getting a character into the engine; I will use the freely available SDK rig as an example. To follow this example you will need 3D Studio max and CryEngine 2, including the CryEngine exporter for StudioMax. (supplied on the Crysis /Tools folder)
== Ориентирование ==
== Ориентирование ==
-
[[Image:AssetCreation_CharacterCreationTutorial_image002.gif]]
+
[[Файл:AssetCreation_CharacterCreationTutorial_image002.gif]]
Для того чтобы выполнить этот урок, у вас должны быть файлы показанные выше. Они свободно доступны в Интернете, а также находятся в папке '''Objects\characters\human_male''' Для того чтобы выполнить этот урок, у вас должны быть файлы показанные выше. Они свободно доступны в Интернете, а также находятся в папке.
Для того чтобы выполнить этот урок, у вас должны быть файлы показанные выше. Они свободно доступны в Интернете, а также находятся в папке '''Objects\characters\human_male''' Для того чтобы выполнить этот урок, у вас должны быть файлы показанные выше. Они свободно доступны в Интернете, а также находятся в папке.
Строка 22: Строка 22:
=== Установка экспортёра для 3ds Max ===
=== Установка экспортёра для 3ds Max ===
 +
=== Файлы плагина ===
=== Файлы плагина ===
Строка 39: Строка 40:
=== Плагин ===
=== Плагин ===
-
Существуют экспортёры на разные «вкусы», в зависимости от используемой Вами версии 3ds Max. Выше показаны версии, скомпилированные по состоянию на ноябрь 2007. Плагин CryExport должен быть помещен в папку '''plugins''' находящеюся в корневом каталоге 3ds Max.  
+
Существуют экспортёры на разные «вкусы», в зависимости от используемой Вами версии 3ds Max. Выше показаны версии, скомпилированные по состоянию на ноябрь 2007. Плагин CryExport должен быть помещен в папку '''plugins''' находящеюся в корневом каталоге 3ds Max.
==== INI-файл ====
==== INI-файл ====
Строка 51: Строка 52:
</source>
</source>
-
The characters marked in blue are parts of the path that you would change to reflect locations on your hard disk. <br /><br />
+
[[Файл:AssetCreation_CharacterCreationTutorial_image004.jpg]]
-
[[Image:AssetCreation_CharacterCreationTutorial_image004.jpg]]
+
-
[[Image:AssetCreation_CharacterCreationTutorial_image005.jpg]]
+
[[Файл:AssetCreation_CharacterCreationTutorial_image005.jpg]]
-
'''Adding the CryExport Utility''' <br /> Under the Utility panel, go to &lsquo; '''Configure Button Sets''' &rsquo;, scroll down to Crytek, and drag the &lsquo; '''CryEngine 2 Exporter''' &rsquo; over to a utility button.
+
==== Добавление утилиты CryExport ====
 +
В панели Utility, нажмите кнопку «'''Configure Button Sets'''», и из категории Crytek, выберите экспортёр «'''CryEngine 2 Exporter'''» и перетащите на кнопку справа.
-
'''Special Note:''' <br /> The '''Resource Compiler''' folder is derived from the Editor path, you should have a resource compiler in the /rc folder. If you do not have a Resource Compiler, make sure you have the SDK installed properly.
+
'''Особое примечание:''' <br /> Папка '''Resource Compiler''' (Компилятора ресурсов) определяется в зависимости от пути к редактору, в виду этого компилятор ресурсов должен находится в подпапке /rc. Если у вас нет компилятора ресурсов, убедитесь, что SDK установлен правильно.
-
=== File Layout: character.max (LOD0/2/3) ===
+
=== Макет файла: character.max (LOD0/2/3) ===
-
I will briefly explain the nodes you see in this max file. There are '''render meshes''' , '''thin/fat''' '''variation meshes''' , a '''live deforming skeleton''' , and a '''live phys skeleton''' .
+
Я хотел бы кратко объяснить узлы которые вы видите в этом .max-файле. Это: '''render meshes''' ('''сетка рендера'''), '''thin/fat variation meshes''' ('''сетка вариации тонкости/толщины'''), '''live deforming skeleton''' ('''живой скелет деформации'''), и '''live phys skeleton''' ('''живой скелет физики''').
-
'''Render Meshes:'''
+
'''Сетка рендера:'''
<div style="margin-left: 30px;">
<div style="margin-left: 30px;">
-
* These are the mapped character geometry that you see in the game.  
+
* Отображает геометрию персонажа, которую вы видите в игре.
-
* Vertex Colors on the LOD0 ($character) mesh denote masked areas that can be morphed between thin and fat once in the engine.  
+
* Цветные вершины на сетке LOD0 ($character) обозначают области-маски, которые могут быть морфированы между тонкостью и толщиной в движке.
-
* The levels of detail or LODs are meshes with lower polygonal resolution that automatically fade in based on your distance from the character. (in the game world)  
+
* Уровень детализации или LOD — являются сетками с низко-полигональным разрешение, которые автоматически исчезают в зависимости от расстоянии до персонажа (в игровом мире).
-
* The material on this mesh should correspond with an MTL file in the character&rsquo;s folder
+
* Материал на этой сетке должен соответствовать MTL-файлу в папке персонажа
-
''' '''sdk_character.mtl* in the example files
+
например: '''sdk_character.mtl'''.
-
* Render Mesh Nodes:  
+
* Узлы сетки рендера:
-
* $character  
+
* $character
-
* $character_LOD2  
+
* $character_LOD2
-
* $character_LOD3  
+
* $character_LOD3
</div>
</div>
-
'''Thin/Fat Variation Meshes:'''
+
'''Сетка вариации тонкости/толщины:'''
<div style="margin-left: 30px;">
<div style="margin-left: 30px;">
-
* These are two variations of the LOD0 mesh ($character)  
+
* Это две вариации сетки LOD0 ($character).
-
* Because they are morphs, they must retain the LOD0 point index
+
* Поскольку эта сетка является морфом, она должна сохранять индекс точек LOD0.
-
* Thin/Fat Variation Mesh Nodes:  
+
* Узлы сетки вариации тонкости/толщины:
-
* $character_thin  
+
* $character_thin
-
* $character_fat  
+
* $character_fat
</div>
</div>
-
'''Live Deforming Skeleton:'''
+
'''Скелет живой деформации:'''
<div style="margin-left: 30px;">
<div style="margin-left: 30px;">
-
* This is the skeleton that deforms the render meshes
+
* Это скелет, который деформирует сетку рендера.
-
* The bone geometry of this skeleton is used for hit detection and physics in the live character (non-ragdoll)  
+
* Кости геометрии этого скелета используется для обнаружения ударов и физики у живого персонажа (не
-
* The materials applied to this skeleton are used for hit detection, to tell the engine what part of the character you have hit.  
+
рэгдолл).
-
* There are &lsquo;attachment nodes&rsquo; in this hierarchy
+
* Материалы, применённые к этому скелету используются для обнаружения ударов.
-
* Example: $weapon_bone, this is where the weapon will be attached in the engine.  
+
* В его иерархии присутствуют «attachment nodes» (узлы прикрепления).
-
* This a basic &lsquo;Biped Skeleton&rsquo; but other than &lsquo;attachment nodes&rsquo; there are some additional nodes used for automatic foot plant and gait detection
+
* Например: $weapon_bone, сюда будет прикреплено оружие в движке.
-
* $&rsquo;Bip01 L Heel&rsquo; and $&lsquo;Bip01 L Toe0Nub&rsquo; on the left foot. (also present on the right foot)  
+
* Это основной «Biped Skeleton» (скелет двуногого). Также есть некоторые дополнительные узлы, используемые для автоматического прикрепления ног и обнаружения движений.
-
* Live Deforming Skeleton Nodes:  
+
* «$Bip01 L Heel» и «$Bip01 L Toe0Nub» для левой ноги. (R — для правой ноги).
-
* Hierarchy of nodes under and including $Bip01
+
* Узлы скелета живой деформации:
 +
* Иерархия узлов с основой «$Bip01».
</div>
</div>
-
'''Live Phys Skeleton:'''
+
'''Скелет живой физики:'''
<div style="margin-left: 30px;">
<div style="margin-left: 30px;">
-
Think of this skeleton as a set of switches, a node being present in this skeleton signifies that it&rsquo;s counterpart in the live deforming skeleton is physicalized in the engine '''while the character is alive''' .  
+
Представьте что скелет — это набор переключателей, узел, присутствующий в этом скелете означает, что его дубликат в скелете живой деформации физикализирован в движке, а сам '''персонаж жив''' .
-
* Each node in this skeleton also stores physical properties for it&rsquo;s corresponding bone in the deforming hierarchy, this is stored in the phys bone&rsquo;s IK properties.  
+
* Каждый узел в этом скелете также хранит физические свойства для соответствующей ему кости в иерархии деформации, и так же хранит IK-свойства физики.
-
* Live Phys Skeleton Nodes:  
+
* Узлы скелета живой физики:
-
* Hierarchy of nodes under and including $&rsquo;Bip01 Pelvis Phys&rsquo;
+
* Иерархия узлов с основой «$Bip01 Pelvis Phys».
</div>
</div>
-
=== File Layout: character_LOD1.max (LOD1) ===
+
=== Макет файла: character_LOD1.max (LOD1) ===
-
I will briefly explain the nodes you see in this max file. There are '''render meshes''' , '''thin/fat''' '''variation meshes''' , a *ragdoll''' '''deforming skeleton* , and a '''ragdoll phys skeleton''' .
+
Я хотел бы кратко объяснить узлы которые вы видите в этом .max-файле. Это: '''render meshes''' ('''сетка рендера'''), '''thin/fat variation meshes''' ('''сетка вариации тонкости/толщины'''), a '''ragdoll deforming skeleton''' ('''скелет рэгдолл-деформации'''), и '''ragdoll phys skeleton''' ('''скелет рэгдолл-физики''').
-
'''Render Meshes:'''
+
'''Сетка рендера:'''
<div style="margin-left: 30px;">
<div style="margin-left: 30px;">
-
* This is the mapped character geometry that you see in the game.  
+
* Отображает геометрию персонажа, которую вы видите в игре.
-
* Render Mesh Nodes:  
+
* Узлы сетки рендера:
-
* $character_LOD1  
+
* $character_LOD1
</div>
</div>
-
'''Thin/Fat Variation Meshes:'''
+
'''Сетка вариации тонкости/толщины:'''
<div style="margin-left: 30px;">
<div style="margin-left: 30px;">
-
* These are two variations of the LOD1 mesh ($character_LOD1)  
+
* Это две вариации сетки LOD1 ($character_LOD1).
-
* Because they are morphs, they must retain the LOD1 point index
+
* Поскольку эта сетка является морфом, она должна сохранять индекс точек LOD1.
-
* Thin/Fat Variation Mesh Nodes:  
+
* Узлы сетки вариации тонкости/толщины:
-
* $character_thin_LOD1  
+
* $character_thin_LOD1
-
* $character_fat_LOD1  
+
* $character_fat_LOD1
</div>
</div>
-
'''Ragdoll Deforming Skeleton:'''
+
'''Скелет рэгдолл-деформация:'''
<div style="margin-left: 30px;">
<div style="margin-left: 30px;">
-
* This skeleton hierarchy must match the hierarchy of the LOD0 skeleton exactly (character.max deforming skeleton)  
+
* Иерархия этого скелета должна в точности соответствовать скелету иерархии LOD0 (скелет деформации в character.max).
-
* The bone geometry of this skeleton is used for the ragdoll physics
+
* Кости геометрии этого скелета используется для рэгдолл-физики.
-
* This geometry should consist of spheres, boxes and capsules
+
* Геометрия должна состоять из сфер, прямоугольников и капсул.
-
* Arbitrary geometry is supported, but could slow perfromance
+
* Поддерживается произвольная геометрия, но она может снизить производительность.
-
* The materials applied to this skeleton are used for hit detection, to tell the engine what part of the character you have hit.  
+
* Материалы, применённые к этому скелету используются для обнаружения ударов.
-
* Ragdoll Deforming Skeleton Nodes:  
+
* Узлы скелета рэгдолл-деформации:
-
* Hierarchy of nodes under and including $Bip01
+
* Иерархия узлов с основой «$Bip01».
</div>
</div>
-
'''Ragdoll Phys Skeleton:'''
+
'''Скелет рэгдолл-физики:'''
<div style="margin-left: 30px;">
<div style="margin-left: 30px;">
-
As with the LOD0, think of this skeleton as a set of switches, a node being present in this skeleton signifies that it&rsquo;s counterpart in the ragdoll deforming skeleton is physicalized in the engine, '''while the character is in a ragdoll state.'''  
+
Подобно LOD0, представьте что скелете — это набор переключателей, узел, присутствующий в этом скелете означает, что его дубликат в скелете рэгдолл-деформации физикализирован в движке, в то время как '''персонаж находится в состоянии куклы'''.
-
* Each node in this skeleton also stores physical properties for it&rsquo;s corresponding bone in the deforming hierarchy, this is stored in the phys bone&rsquo;s IK properties.  
+
* Каждый узел в этом скелете также хранит физические свойства для соответствующей ему кости в иерархии деформации, и так же хранит IK-свойства физики.
-
* Ragdoll Phys Skeleton Nodes:  
+
* Узлы скелета рэгдолл-физики:
-
* Hierarchy of nodes under and including $&rsquo;Bip01 Pelvis Phys&rsquo;
+
* Иерархия узлов с основой «$Bip01 Pelvis Phys».
</div>
</div>
-
=== File Layout: head.max ===
+
=== Макет файла: head.max ===
-
I will briefly explain the nodes you see in this max file. There are '''render meshes''' , '''morph targets''' , '''thin/fat''' '''variation meshes''' , a '''deforming skeleton''' .
+
Я хотел бы кратко объяснить узлы которые вы видите в этом .max-файле. Это: '''render meshes''' ('''сетка рендера'''), '''morph targets''' ('''цели морфинга'''), '''thin/fat variation meshes''' ('''сетка вариации тонкости/толщины'''), и '''deforming skeleton''' ('''скелет деформации''').
-
'''Render Meshes:'''
+
'''Сетка рендрера:'''
<div style="margin-left: 30px;">
<div style="margin-left: 30px;">
-
* This is the mapped character geometry that you see in the game.  
+
* Отображает геометрию персонажа, которую вы видите в игре.
-
* Render Mesh Nodes:  
+
* Узлы сетки рендера:
-
* $head  
+
* $head
</div>
</div>
-
'''Morph Targets:'''
+
'''Цели морфинга:'''
<div style="margin-left: 30px;">
<div style="margin-left: 30px;">
-
* These are the &lsquo;morph targets&rsquo; or &lsquo;blend shapes&rsquo; that drive the facial deformation of the render mesh
+
* «Цели морфинга» или «сочетания фигур», создают лицевую деформацию сетки рендера.
-
* Morph Target Nodes:  
+
* Узлы целей морфинга:
-
* $ Brow_lowerer  
+
* $Brow_lowerer
-
* $ Jaw_dropper_01  
+
* $Jaw_dropper_01
-
* $ Jaw_pusher  
+
* $Jaw_pusher
</div>
</div>
-
'''Thin/Fat Variation Meshes:'''
+
'''Сетка вариации тонкости/толщины:'''
<div style="margin-left: 30px;">
<div style="margin-left: 30px;">
-
* These are two variations of the LOD0 mesh ($head)  
+
* Это две вариации сетки LOD0 ($head).
-
* Because they are morphs, they must retain the LOD0 point index
+
* Поскольку эта сетка является морфом, она должна сохранять индекс точек LOD0.
-
* Thin/Fat Variation Mesh Nodes:  
+
* Узлы сетки вариации тонкости/толщины:
-
* $head_thin  
+
* $head_thin
-
* $head_fat  
+
* $head_fat
</div>
</div>
-
'''Deforming Skeleton:'''
+
'''Скелет деформации:'''
<div style="margin-left: 30px;">
<div style="margin-left: 30px;">
-
* This skeleton hierarchy must not have more members than the deforming skeleton of the character you will attach the head onto (character.max)  
+
* Иерархия этого скелета не должна иметь больше элементов, чем у скелета деформации персонажа к которому Вы присоедините голову (character.max).
-
* The skeletons do not have to match, but this SLAVE skeleton, must have less bones than the MASTER skeleton, more on this later.  
+
* Скелеты не должны совпадать! Скелет SLAVE, должен иметь меньше костей, чем скелет MASTER, подробнее об этом чуть позже.
-
* Arbitrary geometry is supported, but could slow performance
+
* Поддерживается произвольная геометрия, но она может снизить производительность.
-
* Deforming Skeleton Nodes:  
+
* Узлы скелета деформации:
-
* Hierarchy of nodes under and including $Bip01
+
* Иерархия узлов с основой «$Bip01».
</div>
</div>
-
== The Render Mesh ==
+
== Сетка рендера ==
-
Enough with all the explanations, let&rsquo;s dig in. It&rsquo;s also time for some pictures.
+
Закончим с разъяснениями, начнём окапываться. И кстати пришло время для фотографий.
-
[[Image:AssetCreation_CharacterCreationTutorial_image006.jpg]]  
+
[[Файл:AssetCreation_CharacterCreationTutorial_image006.jpg]]
-
Load '''character.max''' , this is what it should look like when loaded. These are the '''render meshes''' , you are currently viewing all three (LOD0/2/3)
+
Откройте файл '''character.max''' , Откройте файл '''сетки рендера''', вы просматриваете все три сетки (LOD0/2/3).
-
Things to keep in mind when creating the render mesh of a character:
+
Имейте в виду при создании сеток персонажа:
<div style="margin-left: 30px;">
<div style="margin-left: 30px;">
-
* It&rsquo;s pivot should be at 0,0,0
+
* Их точка опоры (pivot) должна быть равна нулю во всех трёх плоскостях.
-
* The character must be facing down the positive Y axis
+
* Персонаж должен быть обращены вниз по положительной оси Y.
-
* It should have no transformations applied to it (pos, rot, scale)  
+
* К нему не должны быть применены преобразования (позиция, поворот, масштабирование).
-
* If so, apply a reset xform before you start
+
* Если преобразования есть, примените Reset X-Form, перед тем, как начнёте.
-
* Make sure the model matches the joints in the skeleton
+
* Убедитесь, что модель соответствует сочленяем скелета.
-
* The live deforming skeleton should be in it&rsquo;s &lsquo;bind pose&rsquo; when you apply the Skin modifier
+
* Скелет живой деформации должен «привязать форму», если вы примените модификатор Skin.
</div>
</div>
-
'''Special Note:''' <br /> When creating your own character, you do not need to match your render mesh to our SDK skeleton. But keep in mind that this means your character cannot use the existing Crysis animation set. If you do want to use a custom character/skel, please look into how difficult it is to create all the animations needed to get a custom skeleton moving around with decent motion fidelity in a next-gen game, it can be hundreds or thousands of animation assets.
+
'''Особое примечание:''' <br /> При создании своего собственного персонажа, вам не нужно подгонять свою сетку рендера под наш скелет из SDK. Но имейте в виду, при этом ваш персонаж не сможет использовать существующие наборы анимации Crysis. Если вы хотите использовать пользовательский персонаж/скелет, примите к сведению трудность создания всех анимаций, необходимых для получения движущегося пользовательского скелета с достойной верность движений нового поколения игр, это может быть сотни и тысячи ассетов анимации.
-
Model your character to fit this skeleton, then use Skin (or Physique if you&rsquo;re a masochist) to weight your '''render meshes''' to the '''deforming skeleton''' .
+
Если модель вашего персонажа подходит под этот скелет, используйте Skin (или Physique если вы мазохист), чтобы добавить вес к '''сетки рендера''' в '''сетке деформации''' .
-
== &lsquo;Deforming&rsquo; and &lsquo;Phys&rsquo; Skeletons ==
+
== Скелеты «деформации» и «физики» ==
-
Character assets are broken up into a main character file (character.max) and an LOD1 file (character_LOD1.max), each file has a deforming and phys skeleton. It is critical to understand the role of each skeleton in each file.
+
Ассеты персонажей разделены на основной файл (character.max) и файл LOD1 (character_LOD1.max), у каждого файла есть скелет деформации и физики. Очень важно понимать роль каждого скелета в каждом файле.
-
The live deforming and live phys skeleton in the main file (LOD0/2/3) store the hit detection and physics properties for the '''live skeleton''' , while the ones in the LOD1 max file store the hit detection and phys properties for the '''ragdoll''' .
+
Живой скелет деформации и живой скелет физики в основном файле (LOD0/2/3) хранят обнаружение ударов и физические свойства '''живого скелета''', а те, что в LOD1 хранят обнаружение ударов и физические свойства '''рэгдолла'''.
-
'''Not to beat you over the head, but this is important:'''
+
'''Не бейте себя по голове, это важно:'''
-
'''Main Character File''' (character.max) <br /> '''Character Render Mesh''' weighted to '''Live Deforming Skeleton''' whose physical properties are stored in the '''Live Phys Skeleton'''
+
'''Основной файл персонажа''' (character.max).
 +
: '''Сетка рендера персонажа''' взвешена на '''скелет живой деформация''', физические свойства которого хранятся в '''скелете живой физики'''.
-
'''LOD1 Character File''' (character_LOD1.max)<br /> '''Character Render Mesh''' weighted to '''Ragdoll Deforming Skeleton''' whose physical properties are stored in the '''Ragdoll Phys Skeleton'''
+
'''Файл LOD1 персонажа''' (character_LOD1.max).
 +
: '''Сетка рендера персонажа''' взвешена на '''скелет рэгдолл-деформации''', физические свойства которого хранятся в '''скелете рэгдолл-физики'''.
-
[[Image:AssetCreation_CharacterCreationTutorial_image007.jpg]]
+
[[Файл:AssetCreation_CharacterCreationTutorial_image007.jpg]]
-
Open the Layer Manager, and you will see that there is a layer called &lsquo; '''bip''' &rsquo; that is hidden, hide &lsquo; '''default''' &rsquo; and unhide &lsquo; '''bip''' &rsquo;, you will then see this:
+
Откройте Layer Manager (Управление слоями), там вы увидите скрытый слой «'''bip'''», если вы скроете «'''default'''» и отобразите «'''bip'''», вы увидите это:
-
[[Image:AssetCreation_CharacterCreationTutorial_image008.jpg]]  
+
[[Файл:AssetCreation_CharacterCreationTutorial_image008.jpg]]
-
These are the '''live deforming''' and '''live phys skeleton''' of the LOD0/2/3 file (character.max)
+
Это '''скелеты живой деформации''' и '''физики''' файла LOD0/2/3 (character.max).
-
=== The &lsquo;Deforming&rsquo; Skeletons ===
+
=== Скелеты «деформации» ===
-
In case you skipped the file layout section, here is what the '''deforming skeleton''' is responsible for:  
+
В случае если вы пропустили раздел «Макет файла», вот за что ответственен '''скелет деформации''':
-
* This is the skeleton that deforms the render meshes  
+
* This is the skeleton that deforms the render meshes
-
* The bone geometry of this skeleton is used for hit detection and physics in the live character (non-ragdoll)  
+
* The bone geometry of this skeleton is used for hit detection and physics in the live character (non-ragdoll)
-
* The materials applied to this skeleton are used for hit detection, to tell the engine what part of the character you have hit.  
+
* The materials applied to this skeleton are used for hit detection, to tell the engine what part of the character you have hit.
-
* There are &lsquo;attachment nodes&rsquo; in this hierarchy  
+
* There are &lsquo;attachment nodes&rsquo; in this hierarchy
-
* Example: $weapon_bone, this is where the weapon will be attached in the engine.  
+
* Example: $weapon_bone, this is where the weapon will be attached in the engine.
-
* This a basic &lsquo;Biped Skeleton&rsquo; but other than &lsquo;attachment nodes&rsquo; there are some additional nodes used for automatic foot plant and gait detection  
+
* This a basic &lsquo;Biped Skeleton&rsquo; but other than &lsquo;attachment nodes&rsquo; there are some additional nodes used for automatic foot plant and gait detection
-
* $&rsquo;Bip01 L Heel&rsquo; and $&lsquo;Bip01 L Toe0Nub&rsquo; on the left foot. (also present on the right foot)  
+
* $&rsquo;Bip01 L Heel&rsquo; and $&lsquo;Bip01 L Toe0Nub&rsquo; on the left foot. (also present on the right foot)
-
* Deforming Skeleton Nodes:  
+
* Deforming Skeleton Nodes:
-
* Hierarchy of nodes under and including $Bip01  
+
* Hierarchy of nodes under and including $Bip01
-
* The '''Ragdoll Deforming Skeleton''' , located in the LOD1 asset file, is used for collision and hit detection in the ragdoll.  
+
* The '''Ragdoll Deforming Skeleton''' , located in the LOD1 asset file, is used for collision and hit detection in the ragdoll.
'''Special Note:''' The recommended number of physicalized bones in a humanoid biped ragdoll is 10-14
'''Special Note:''' The recommended number of physicalized bones in a humanoid biped ragdoll is 10-14
-
[[Image:AssetCreation_CharacterCreationTutorial_image009.jpg]]  
+
[[Файл:AssetCreation_CharacterCreationTutorial_image009.jpg]]
The '''deforming skeleton''' 3dsMax material setup for a Crysis humanoid character.
The '''deforming skeleton''' 3dsMax material setup for a Crysis humanoid character.
Строка 242: Строка 246:
'''Material Setup''' As you can see, the '''deforming skeleton''' has different submaterials assigned to it, these are used for hit detection in the engine. On Crysis, the first 10 submaterials were devoted to hit locations, and any after that were used for textures. This can vary by project.
'''Material Setup''' As you can see, the '''deforming skeleton''' has different submaterials assigned to it, these are used for hit detection in the engine. On Crysis, the first 10 submaterials were devoted to hit locations, and any after that were used for textures. This can vary by project.
-
[[Image:AssetCreation_CharacterCreationTutorial_image010.gif]]  
+
[[Файл:AssetCreation_CharacterCreationTutorial_image010.gif]]
The submaterials in the engine correspond to surface types defined by code
The submaterials in the engine correspond to surface types defined by code
Строка 250: Строка 254:
'''Special Note:''' Here are some things to keep in mind when altering or replacing the deforming skeleton with something of your own:
'''Special Note:''' Here are some things to keep in mind when altering or replacing the deforming skeleton with something of your own:
<div style="margin-left: 30px;">
<div style="margin-left: 30px;">
-
* Keep your bones and rig elements in the &lsquo;bip&rsquo; layer  
+
* Keep your bones and rig elements in the &lsquo;bip&rsquo; layer
-
* Allows animators to easily hide the rig  
+
* Allows animators to easily hide the rig
-
* Allows cryTools to manage rig visibility automatically  
+
* Allows cryTools to manage rig visibility automatically
-
* If you are using a new or custom skeleton, you should be prepared to recreate the full locomotion animation set to support it&rsquo;s moving in the game.  
+
* If you are using a new or custom skeleton, you should be prepared to recreate the full locomotion animation set to support it&rsquo;s moving in the game.
-
''' The skeleton must face down the '''+Y axis*  
+
''' The skeleton must face down the '''+Y axis*
-
* Nodes in the hierarchy should have no scale applied to them  
+
* Nodes in the hierarchy should have no scale applied to them
-
''' All bones/nodes should have '''100% XYZ scale*  
+
''' All bones/nodes should have '''100 % XYZ scale*
-
* There is a bug in Max where mirroring bones causes them to have a -100% scale: be on the lookout for this. Use the mirror function in &lsquo;Bone Tools&rsquo; before converting them to ePoly.  
+
* There is a bug in Max where mirroring bones causes them to have a −100 % scale: be on the lookout for this. Use the mirror function in &lsquo;Bone Tools&rsquo; before converting them to ePoly.
-
''' The root bone pivot should be placed at '''0,0,Z* in world coordinate space.  
+
''' The root bone pivot should be placed at '''0,0,Z* in world coordinate space.
-
* The pivot of the root bone must have its positive X looking forward, positive Y looking left (of the facing direction of the character) and positive Z looking up vertically.  
+
* The pivot of the root bone must have its positive X looking forward, positive Y looking left (of the facing direction of the character) and positive Z looking up vertically.
-
* No bones can be outside of the skeletal hierarchy, the exporter starts at one root bone and steps through all its children.  
+
* No bones can be outside of the skeletal hierarchy, the exporter starts at one root bone and steps through all its children.
-
* This also means no external bones can be constrained into the skeleton  
+
* This also means no external bones can be constrained into the skeleton
-
''' If you want bones to act like they are outside of the skeleton, you can change their transform inheritance in '''Command Panel->Hierarchy->Link Info->Inherit*  
+
''' If you want bones to act like they are outside of the skeleton, you can change their transform inheritance in '''Command Panel->Hierarchy->Link Info->Inherit*
-
* Once they are not inheriting transforms from their parents, you can drive them with constraints as if they were outside the hierarchy  
+
* Once they are not inheriting transforms from their parents, you can drive them with constraints as if they were outside the hierarchy
-
* The bones of the spine and head need to match the orientations and names of the biped skeleton for lookIK to work  
+
* The bones of the spine and head need to match the orientations and names of the biped skeleton for lookIK to work
-
''' The names are ''''Bip01 Head' 'Bip01 Neck' 'Bip01 Spine3' 'Bip01 Spine2'*  
+
''' The names are ''''Bip01 Head' 'Bip01 Neck' 'Bip01 Spine3' 'Bip01 Spine2'*
-
* If you want to have rig elements inside the hierarchy, keep them to the periphery and use the prefix '_' to comment them out of export  
+
* If you want to have rig elements inside the hierarchy, keep them to the periphery and use the prefix '_' to comment them out of export
-
* The '_' prefix effectively comments an object, and all of it's children out on export  
+
* The '_' prefix effectively comments an object, and all of it’s children out on export
-
* If you must have them in the hierarchy, and they are exported into the engine, try not to have them be splines or shapes, convert them to polygons  
+
* If you must have them in the hierarchy, and they are exported into the engine, try not to have them be splines or shapes, convert them to polygons
-
* Keep in mind that any rig elements inside the hierarchy that are exported will be null bones in the engine, and take up memory/cpu time, so do this sparingly  
+
* Keep in mind that any rig elements inside the hierarchy that are exported will be null bones in the engine, and take up memory/cpu time, so do this sparingly
* It&rsquo;s a good idea to put your hit material submats first for humanoid skeletons that you will re-use, this way the numbers will not change based on how many different texture submats you use.
* It&rsquo;s a good idea to put your hit material submats first for humanoid skeletons that you will re-use, this way the numbers will not change based on how many different texture submats you use.
-
* Make sure that all the models are NOT linked to anything. Having, for instance, the pants of your character linked to it's hands will cause an error in the exporter causing it to create multiple skeletons.  
+
* Make sure that all the models are NOT linked to anything. Having, for instance, the pants of your character linked to it’s hands will cause an error in the exporter causing it to create multiple skeletons.
</div>
</div>
'''Ragdoll Deforming Skeleton (LOD1)'''
'''Ragdoll Deforming Skeleton (LOD1)'''
-
[[Image:AssetCreation_CharacterCreationTutorial_image011.gif]]  
+
[[Файл:AssetCreation_CharacterCreationTutorial_image011.gif]]
Above you see the '''ragdoll deforming skeleton''' and '''ragdoll phys skeleton''' from the LOD1 file.
Above you see the '''ragdoll deforming skeleton''' and '''ragdoll phys skeleton''' from the LOD1 file.
Строка 286: Строка 290:
=== The &lsquo;Phys&rsquo; Skeletons ===
=== The &lsquo;Phys&rsquo; Skeletons ===
-
There are two '''phys skeletons''' that a character has, one in the main character file, and one in the LOD1. In case you skipped the file layout section, here is what the '''phys skeleton''' is responsible for:  
+
There are two '''phys skeletons''' that a character has, one in the main character file, and one in the LOD1. In case you skipped the file layout section, here is what the '''phys skeleton''' is responsible for:
-
* Think of this skeleton as a set of switches, a node being present in this skeleton signifies that it&rsquo;s counterpart in the deforming skeleton is physicalized in the engine.  
+
* Think of this skeleton as a set of switches, a node being present in this skeleton signifies that it&rsquo;s counterpart in the deforming skeleton is physicalized in the engine.
-
* Each node in this skeleton also stores physical properties for it&rsquo;s corresponding bone in the deforming hierarchy, this is stored in the phys bone&rsquo;s IK properties.  
+
* Each node in this skeleton also stores physical properties for it&rsquo;s corresponding bone in the deforming hierarchy, this is stored in the phys bone&rsquo;s IK properties.
-
* Phys Skeleton Nodes:  
+
* Phys Skeleton Nodes:
-
* Hierarchy of nodes under and including $&rsquo;Bip01 Pelvis Phys&rsquo;  
+
* Hierarchy of nodes under and including $&rsquo;Bip01 Pelvis Phys&rsquo;
-
The '''ragdoll phys skeleton''' is stored in the LOD1 file ( '''character_LOD1.max''' ). It stores the ragdoll physical properties of the character in the same way that the '''live phys skeleton''' stores them for the '''live deforming skeleton''' .
+
The '''ragdoll phys skeleton''' is stored in the LOD1 file ('''character_LOD1.max'''). It stores the ragdoll physical properties of the character in the same way that the '''live phys skeleton''' stores them for the '''live deforming skeleton''' .
-
[[Image:AssetCreation_CharacterCreationTutorial_image012.jpg]]  
+
[[Файл:AssetCreation_CharacterCreationTutorial_image012.jpg]]
-
Here we are looking at the '''phys skeleton''' in the main character file ( '''character.max''' ), this is also known as the '''live phys skeleton''' , because it is used for the live character physics.
+
Here we are looking at the '''phys skeleton''' in the main character file ('''character.max'''), this is also known as the '''live phys skeleton''' , because it is used for the live character physics.
Each part of the '''phys skeleton''' references a node in the '''deforming skeleton''' , it has the same name as that node, but the suffix &lsquo; '''phys''' &rsquo;. In the example above you see &lsquo; '''Bip01 Spine1 Phys''' &rsquo;, which is the phys node referring to &lsquo; '''Bip01 Spine1''' &rsquo; in the '''deforming skeleton''' .
Each part of the '''phys skeleton''' references a node in the '''deforming skeleton''' , it has the same name as that node, but the suffix &lsquo; '''phys''' &rsquo;. In the example above you see &lsquo; '''Bip01 Spine1 Phys''' &rsquo;, which is the phys node referring to &lsquo; '''Bip01 Spine1''' &rsquo; in the '''deforming skeleton''' .
Строка 302: Строка 306:
'''Limits''' The phys skeleton nodes match the orientations of their counterparts in the deforming mesh exactly, and their IK limits are the offset rotations that that physics will be able to deviate from any playing animation. Be sure to check &lsquo; '''Active''' &rsquo; and &lsquo; '''Limit''' &rsquo;, then enter in your values. If your limits exceed +/- 90 degrees read on about &lsquo; '''ParentFrames''' &rsquo;.
'''Limits''' The phys skeleton nodes match the orientations of their counterparts in the deforming mesh exactly, and their IK limits are the offset rotations that that physics will be able to deviate from any playing animation. Be sure to check &lsquo; '''Active''' &rsquo; and &lsquo; '''Limit''' &rsquo;, then enter in your values. If your limits exceed +/- 90 degrees read on about &lsquo; '''ParentFrames''' &rsquo;.
-
[[Image:AssetCreation_CharacterCreationTutorial_image013.gif]]
+
[[Файл:AssetCreation_CharacterCreationTutorial_image013.gif]]
'''ParentFrames''' When the needed rotational limits of a node in the '''phys skeleton''' exceed +/- 90 degrees, you will often need to use a &lsquo; '''ParentFrame''' &rsquo;. A ParentFrame is a node that sits above the phys node and zero&rsquo;s out it&rsquo;s rotations. It is basically an identical copy of the node, which sits above it in the hierarchy, and has the suffix &lsquo; '''parentFrame''' &rsquo;. Here is an example of a phys hierarchy with parentframes on all limbs:
'''ParentFrames''' When the needed rotational limits of a node in the '''phys skeleton''' exceed +/- 90 degrees, you will often need to use a &lsquo; '''ParentFrame''' &rsquo;. A ParentFrame is a node that sits above the phys node and zero&rsquo;s out it&rsquo;s rotations. It is basically an identical copy of the node, which sits above it in the hierarchy, and has the suffix &lsquo; '''parentFrame''' &rsquo;. Here is an example of a phys hierarchy with parentframes on all limbs:
-
[[Image:AssetCreation_CharacterCreationTutorial_image014.jpg]]
+
[[Файл:AssetCreation_CharacterCreationTutorial_image014.jpg]]
-
'''Dampening and Spring Tension''' Stiffness of an angular spring at a joint can be adjusted via "Spring Tension" parameter. A value of '''1''' means acceleration of '''1 radian/second2''' (1 radian = 57�). Damping should also be set to some reasonable value (1.0 corresponds to fully dumped oscillations for an isolated joint, '''1.0 is the recommended value''' ).
+
'''Dampening and Spring Tension''' Stiffness of an angular spring at a joint can be adjusted via «Spring Tension» parameter. A value of '''1''' means acceleration of '''1 radian/second2''' (1 radian = 57�). Damping should also be set to some reasonable value (1.0 corresponds to fully dumped oscillations for an isolated joint, '''1.0 is the recommended value''').
-
As shown above, each piece of the '''phys skeleton''' has properties under the '''Hierarchy''' tab( '''IK''' ).
+
As shown above, each piece of the '''phys skeleton''' has properties under the '''Hierarchy''' tab('''IK''').
'''Special Notes:'''
'''Special Notes:'''
-
* If you have a node present in the phys skeleton, it must have physical properties  
+
* If you have a node present in the phys skeleton, it must have physical properties
-
* If all it&rsquo;s limits are defaulted to &lsquo;0&rsquo; it will not be export into the game engine  
+
* If all it&rsquo;s limits are defaulted to &lsquo;0&rsquo; it will not be export into the game engine
-
* This is important with the root, which should have no real limits, but needs garbage numbers in the limit fields to export properly (check SDK char)  
+
* This is important with the root, which should have no real limits, but needs garbage numbers in the limit fields to export properly (check SDK char)
-
* The recommended number of physicalized bones in a humanoid biped ragdoll is 10-14  
+
* The recommended number of physicalized bones in a humanoid biped ragdoll is 10-14
-
* The deforming skeletons will have their shapes and mass taken into account, so the mesh must be physically valid in order to behave convincingly  
+
* The deforming skeletons will have their shapes and mass taken into account, so the mesh must be physically valid in order to behave convincingly
-
* Heavy-light-heavy patterns in bone structure should be avoided in the 'Phys Skeleton&rsquo;.  
+
* Heavy-light-heavy patterns in bone structure should be avoided in the 'Phys Skeleton&rsquo;.
-
* A typical example from biped is spine-neck-clavicle-upper arm connection with heavy spine, light neck and clavicle, and relatively heavy upper arm.  
+
* A typical example from biped is spine-neck-clavicle-upper arm connection with heavy spine, light neck and clavicle, and relatively heavy upper arm.
-
* For ragdoll phys skeletons it's recommended to exclude neck (not necessarily neck1,2, though) and the clavicles from the Phys Skeleton.  
+
* For ragdoll phys skeletons it’s recommended to exclude neck (not necessarily neck1,2, though) and the clavicles from the Phys Skeleton.
-
* Try to have your ragdoll deforming skeleton consist of primitives wherever possible.  
+
* Try to have your ragdoll deforming skeleton consist of primitives wherever possible.
-
* Try to avoid sharp corners near joints  
+
* Try to avoid sharp corners near joints
-
* Avoid using joints with all 3 axis locked whenever possible, because they slow down the simulation w/o doing anything useful  
+
* Avoid using joints with all 3 axis locked whenever possible, because they slow down the simulation w/o doing anything useful
-
* Remember: Keep the phys mesh pivot points alligned in orientation to the bones they are suppose to be physicalising. When the phys IK values are set, they are translated onto the bones of the character in the game. But those IK values work with the pivot alignment. If the bone pivot orientation is different from that on the phys mesh, when in the game, the bone will be rotated to align to the phys mesh, thus creating the undesirebale effect.  
+
* Remember: Keep the phys mesh pivot points alligned in orientation to the bones they are suppose to be physicalising. When the phys IK values are set, they are translated onto the bones of the character in the game. But those IK values work with the pivot alignment. If the bone pivot orientation is different from that on the phys mesh, when in the game, the bone will be rotated to align to the phys mesh, thus creating the undesirebale effect.
-
* When creating your own phys skeleton, because it needs to have the same orientations as the deforming skeleton, just snapshot your existing skeleton. Then, remove parts you do not want, reparent the children, and rename them. When you have removed one of these, it will remain locked in default orientation, and will not be physicalized. Check the spine setup on the SDK character for an example.  
+
* When creating your own phys skeleton, because it needs to have the same orientations as the deforming skeleton, just snapshot your existing skeleton. Then, remove parts you do not want, reparent the children, and rename them. When you have removed one of these, it will remain locked in default orientation, and will not be physicalized. Check the spine setup on the SDK character for an example.
-
* You can also place certain words in an object&rsquo;s &lsquo;user defined properties&rsquo; to force it into a primitive in the engine, this will generate a bounding primitive around the mesh. Here are some you can try  
+
* You can also place certain words in an object&rsquo;s &lsquo;user defined properties&rsquo; to force it into a primitive in the engine, this will generate a bounding primitive around the mesh. Here are some you can try
-
* nonphysical  
+
* nonphysical
-
* sphere  
+
* sphere
-
* box  
+
* box
-
* capsule  
+
* capsule
-
* cylinder  
+
* cylinder
-
* If your limits and deforming skeleton meshes match for ragdoll and live skeletons, you can store all the rendermeshes in one file, this makes things a lot simpler  
+
* If your limits and deforming skeleton meshes match for ragdoll and live skeletons, you can store all the rendermeshes in one file, this makes things a lot simpler
-
* You no longer have two files to manage and two hierarchies to sync  
+
* You no longer have two files to manage and two hierarchies to sync
== Advanced Setup ==
== Advanced Setup ==
-
These are some techniques/features that are not present in the SDK character example.  
+
These are some techniques/features that are not present in the SDK character example.
 +
 
=== Character Ropes ===
=== Character Ropes ===
-
Characters with ropes and hinges are not included in the SDK, but I will touch on them quickly.  
+
Characters with ropes and hinges are not included in the SDK, but I will touch on them quickly.
-
[[Image:AssetCreation_CharacterCreationTutorial_image015.jpg]]  
+
[[Файл:AssetCreation_CharacterCreationTutorial_image015.jpg]]
Here is a piece of the &lsquo;Trooper&rsquo; hierarchy, Rope3 is a physicalized rope
Here is a piece of the &lsquo;Trooper&rsquo; hierarchy, Rope3 is a physicalized rope
'''Character Ropes'''
'''Character Ropes'''
-
* In order to have some character bones simulated using rope physics one has to name the corresponding bones 'rope[rope number] Seg[segment number]' i.e &ldquo;Rope1 Seg01&rdquo;. The bones in the same rope strand need to have identical Rope numbers and continuous numbering for the segments, i.e. Seg01, Seg02, Seg03. The &lsquo;rope number&rsquo; can go from 1-9, and then needs to be 01, 02, 03, etc. The roots of each strand (Seg01) should be linked to a point helper named &ldquo;null_[rope name]_connect&rdquo;, which in turn should be linked to the bone to which the ropes are required to be attached to.  
+
* In order to have some character bones simulated using rope physics one has to name the corresponding bones 'rope[rope number] Seg[segment number]' i.e "Rope1 Seg01&rdquo;. The bones in the same rope strand need to have identical Rope numbers and continuous numbering for the segments, i.e. Seg01, Seg02, Seg03. The &lsquo;rope number&rsquo; can go from 1-9, and then needs to be 01, 02, 03, etc. The roots of each strand (Seg01) should be linked to a point helper named "null_[rope name]_connect&rdquo;, which in turn should be linked to the bone to which the ropes are required to be attached to.
-
* All segments in one rope should have approximately equal length. Note that a rope bone should never be the leaf bone (w/o children), since the bone after the last rope bone is used to provide terminal rope vertex. Also note that currently ropes cannot connect 2 physicalized parts of a skeleton; they can be either "roots" (ex: hanging light cord), or leaves (ex: character's ponytail or braid).  
+
* All segments in one rope should have approximately equal length. Note that a rope bone should never be the leaf bone (w/o children), since the bone after the last rope bone is used to provide terminal rope vertex. Also note that currently ropes cannot connect 2 physicalized parts of a skeleton; they can be either «roots» (ex: hanging light cord), or leaves (ex: character’s ponytail or braid).
-
* In game script one should first create some physical entity, then load and physicalize the character model. By default all bones are physicalized (unless " Phys" counterpart skeleton is present, which will most likely be the case only for characters). Note, however, that rope bones normally should not be a part of main character physics (which for hanging lamp will most likely be a rigid body), thus they should have 'nonphysical' keyword in their user-defined properties (as well as other bones that do not represent physical geometry).  
+
* In game script one should first create some physical entity, then load and physicalize the character model. By default all bones are physicalized (unless « Phys» counterpart skeleton is present, which will most likely be the case only for characters). Note, however, that rope bones normally should not be a part of main character physics (which for hanging lamp will most likely be a rigid body), thus they should have 'nonphysical' keyword in their user-defined properties (as well as other bones that do not represent physical geometry).
-
* During the physicalization ropes are created and stored internally in the character system. The 1st end of the rope is the one that is closer to the root bone. Both the 1st and the 2nd ends are automatically tied to character physical entity if they are connected to its physicalized parts (not necessarily directly).  
+
* During the physicalization ropes are created and stored internally in the character system. The 1st end of the rope is the one that is closer to the root bone. Both the 1st and the 2nd ends are automatically tied to character physical entity if they are connected to its physicalized parts (not necessarily directly).
-
* In order to alter parameters of rope physics one should call:  
+
* In order to alter parameters of rope physics one should call:
-
* SetCharacterPhysics(slot_number,"ropename", PHYSICSPARAM_ROPE,param_table).  
+
* SetCharacterPhysics(slot_number, «ropename», PHYSICSPARAM_ROPE,param_table).
-
''' '''param_table* can contain the following fields:  
+
''' '''param_table* can contain the following fields:
-
''' '''length* - full length of the rope;  
+
''' '''length* — full length of the rope;
-
''' '''entity_id_1* - entity id the 1st rope end is tied to (-1 if statically tied world, -2 if not tied at all);  
+
''' '''entity_id_1* — entity id the 1st rope end is tied to (-1 if statically tied world, −2 if not tied at all);
-
''' '''entity_part_id_1* - entity part id the 1st rope end is tied to  
+
''' '''entity_part_id_1* — entity part id the 1st rope end is tied to
-
''' '''end1 (vector)* - the 1st end attachment point (if unspecified, it is assumed to be current end point position);  
+
''' '''end1 (vector)* — the 1st end attachment point (if unspecified, it is assumed to be current end point position);
-
''' '''end2 (vector)* - the 2nd end attachment point;  
+
''' '''end2 (vector)* — the 2nd end attachment point;
-
''' '''check_collisions* - 1 if the rope should collide with the environment (0 otherwise);  
+
''' '''check_collisions* — 1 if the rope should collide with the environment (0 otherwise);
-
''' '''coll_dist* - rope thickness for collision detection.  
+
''' '''coll_dist* — rope thickness for collision detection.
-
* Currently ropes cannot apply forces or otherwise alter the behavior of the objects they are colliding with, save the objects they are directly tied to (and tied objects receive impulses only when the rope is fully strained along a straight line).  
+
* Currently ropes cannot apply forces or otherwise alter the behavior of the objects they are colliding with, save the objects they are directly tied to (and tied objects receive impulses only when the rope is fully strained along a straight line).
-
* 'Stiff' ropes can be mimicked by having few rope segments (bones) and setting up mesh skinning so that visually the rope bends smoothly rather than abruptly at joint points.  
+
* 'Stiff' ropes can be mimicked by having few rope segments (bones) and setting up mesh skinning so that visually the rope bends smoothly rather than abruptly at joint points.
'''Adjusting Rope Properties'''
'''Adjusting Rope Properties'''
-
''' To physicalize the ropes and make them active you also need to create phys bones for the first segment of each bone strand. These phys bones should be linked to the phys mesh of the character body. To activate collision of the ropes with the body and environment and/or activate the gravity you need to put &lsquo; '''&ldquo;active_phys gravity&rdquo;* &rsquo; in the UDP (User Defined Properties). These are the settings to activate certain properties of the rope&rsquo;s behavior and properties (set in the Hierarchy/IK/Rotational Joints panel):  
+
''' To physicalize the ropes and make them active you also need to create phys bones for the first segment of each bone strand. These phys bones should be linked to the phys mesh of the character body. To activate collision of the ropes with the body and environment and/or activate the gravity you need to put &lsquo; '''"active_phys gravity&rdquo;* &rsquo; in the UDP (User Defined Properties). These are the settings to activate certain properties of the rope&rsquo;s behavior and properties (set in the Hierarchy/IK/Rotational Joints panel):
-
''' '''character collision* &ndash; y axis active, will collide with the local character  
+
''' '''character collision* — y axis active, will collide with the local character
-
''' '''environment collision* &ndash; x axis active, will collide with the environment  
+
''' '''environment collision* — x axis active, will collide with the environment
-
''' '''joint limit* &ndash; spring tension x, this will be the per-bone rotational limit for the chain  
+
''' '''joint limit* — spring tension x, this will be the per-bone rotational limit for the chain
-
''' '''stiffness* &ndash; maximum x limit  
+
''' '''stiffness* — maximum x limit
-
''' '''stiffness decay* &ndash; maximum y limit  
+
''' '''stiffness decay* — maximum y limit
-
''' '''damping* &ndash; maximum z limit  
+
''' '''damping* — maximum z limit
-
''' '''max time step (default 0.02)* &ndash; spring tension y  
+
''' '''max time step (default 0.02)* — spring tension y
-
''' '''friction* &ndash; spring tension z
+
''' '''friction* — spring tension z
=== Character Hinge Attachments ===
=== Character Hinge Attachments ===
-
[[Image:AssetCreation_CharacterCreationTutorial_image016.jpg]]
+
[[Файл:AssetCreation_CharacterCreationTutorial_image016.jpg]]
When adding CGF bone attachments in character editor, you can create hinge joints to give the rigid attachments realistic secondary motion. Just select the bone attachment, then check &lsquo; '''Physicalized''' &rsquo;, select a hinge rotational axis, and specify some values. It takes some trial and error to get right, but the results are great.
When adding CGF bone attachments in character editor, you can create hinge joints to give the rigid attachments realistic secondary motion. Just select the bone attachment, then check &lsquo; '''Physicalized''' &rsquo;, select a hinge rotational axis, and specify some values. It takes some trial and error to get right, but the results are great.
Строка 383: Строка 388:
=== CGA Files ===
=== CGA Files ===
-
[[Image:AssetCreation_CharacterCreationTutorial_image017.jpg]]
+
[[Файл:AssetCreation_CharacterCreationTutorial_image017.jpg]]
A CGA file is a conglomerate of CGF objects and animation data. They are used for rigid, non-deforming animations, like the baked physics above. CGA files are like character files with some major differences:
A CGA file is a conglomerate of CGF objects and animation data. They are used for rigid, non-deforming animations, like the baked physics above. CGA files are like character files with some major differences:
-
* They store a hierarchy but no skinning data  
+
* They store a hierarchy but no skinning data
-
* There are CGF files attached to this skeleton, which are also stored in this file  
+
* There are CGF files attached to this skeleton, which are also stored in this file
-
* There is a default animation also stored in the mail file  
+
* There is a default animation also stored in the mail file
-
* It is referenced as &lsquo;Default&rsquo;  
+
* It is referenced as &lsquo;Default&rsquo;
-
* A CGA can also play ANM files, and reference them in a CAL file.  
+
* A CGA can also play ANM files, and reference them in a CAL file.
-
* CGA animated objects must use TCB controllers in 3dsMax; to reduce size, reduce keys  
+
* CGA animated objects must use TCB controllers in 3dsMax; to reduce size, reduce keys
'''Special Notes:''' To convert many objects to TCB you can use this snippet of maxscript (or cryAnimationTools)
'''Special Notes:''' To convert many objects to TCB you can use this snippet of maxscript (or cryAnimationTools)
-
=forobjinselectiondo= =(= = obj.rotation.controller = tcb_rotation ()= = obj.position.controller = tcb_position ()= =)= <br /> [[Image:AssetCreation_CharacterCreationTutorial_image018.jpg]]
+
=forobjinselectiondo= =(= = obj.rotation.controller = tcb_rotation ()= = obj.position.controller = tcb_position ()= =)= <br /> [[Файл:AssetCreation_CharacterCreationTutorial_image018.jpg]]
== Exporting Your Character into CryEngine2 ==
== Exporting Your Character into CryEngine2 ==
-
Add your render meshes into the &lsquo; '''Object Export''' &rsquo; listbox, make sure that &lsquo; '''Export To''' &rsquo; is set to &lsquo; '''Character (.chr)''' &rsquo; and then click &lsquo; '''Export Nodes''' &rsquo;. Your CHR should be saved to disk in the location of the max file, you can click &lsquo; '''Exlore&hellip;''' &rsquo; to go there immediately.
+
Add your render meshes into the &lsquo; '''Object Export''' &rsquo; listbox, make sure that &lsquo; '''Export To''' &rsquo; is set to &lsquo; '''Character (.chr)''' &rsquo; and then click &lsquo; '''Export Nodes''' &rsquo;. Your CHR should be saved to disk in the location of the max file, you can click &lsquo; '''Exlore…''' &rsquo; to go there immediately.
'''Special Notes:''' You can export multiple meshes at once; just add them in the Object Export list box.
'''Special Notes:''' You can export multiple meshes at once; just add them in the Object Export list box.
Строка 419: Строка 424:
On the '''Rollup Bar''' , select '''Entity''' , then drag a '''Grunt''' into an empty level. Under the &lsquo; '''Entity Properties''' &rsquo; for the Grunt, find the &lsquo; '''Model''' &rsquo; property.
On the '''Rollup Bar''' , select '''Entity''' , then drag a '''Grunt''' into an empty level. Under the &lsquo; '''Entity Properties''' &rsquo; for the Grunt, find the &lsquo; '''Model''' &rsquo; property.
-
[[Image:AssetCreation_CharacterCreationTutorial_image019.jpg|image019.jpg Extracted from ReadOnly-0-Rev-2-character_creation_tutorial.doc_files.zip]]
+
[[Файл:AssetCreation_CharacterCreationTutorial_image019.jpg|image019.jpg Extracted from ReadOnly-0-Rev-2-character_creation_tutorial.doc_files.zip]]
-
[[Image:AssetCreation_CharacterCreationTutorial_image020.gif]]
+
[[Файл:AssetCreation_CharacterCreationTutorial_image020.gif]]
When you reload the entity, you should now see something like this:
When you reload the entity, you should now see something like this:
-
[[Image:AssetCreation_CharacterCreationTutorial_image021.jpg]]
+
[[Файл:AssetCreation_CharacterCreationTutorial_image021.jpg]]
&lsquo;Grunt&rsquo; Entity in engine with character.chr from the SDK loaded as &lsquo;Model&rsquo; under Entity Properties
&lsquo;Grunt&rsquo; Entity in engine with character.chr from the SDK loaded as &lsquo;Model&rsquo; under Entity Properties
Строка 434: Строка 439:
So now that you have the character in the engine, let&rsquo;s check out the skeleton, to do this, go to the console (&lsquo; '''~''' &rsquo; key) and type in &lsquo; '''p_draw_helpers 1''' &rsquo;, without the &lsquo;&rsquo; of course, and press enter. You should see something like this:
So now that you have the character in the engine, let&rsquo;s check out the skeleton, to do this, go to the console (&lsquo; '''~''' &rsquo; key) and type in &lsquo; '''p_draw_helpers 1''' &rsquo;, without the &lsquo;&rsquo; of course, and press enter. You should see something like this:
-
[[Image:AssetCreation_CharacterCreationTutorial_image022.jpg]] Character.chr with &lsquo; '''p_draw_helpers''' &rsquo; enabled, this shows the physical hit mesh.
+
[[Файл:AssetCreation_CharacterCreationTutorial_image022.jpg]] Character.chr with &lsquo; '''p_draw_helpers''' &rsquo; enabled, this shows the physical hit mesh.
If the skeleton is in the default pose, you might need to toggle &lsquo; '''AI/Physics''' &rsquo; in the lower right.
If the skeleton is in the default pose, you might need to toggle &lsquo; '''AI/Physics''' &rsquo; in the lower right.
Строка 440: Строка 445:
So now you can see the deforming skeleton, and you can jump into game and shoot/test it. But how do you know if the hit materials are set up properly? If you jump into game mode and press &lsquo; '''7''' &rsquo;, you will see that you have a weapon that tells you the material of any object you point at, and it will tell you even more info about that item if you &lsquo;shoot&rsquo; it. Here is what it looks like when pointing at the hit skel:
So now you can see the deforming skeleton, and you can jump into game and shoot/test it. But how do you know if the hit materials are set up properly? If you jump into game mode and press &lsquo; '''7''' &rsquo;, you will see that you have a weapon that tells you the material of any object you point at, and it will tell you even more info about that item if you &lsquo;shoot&rsquo; it. Here is what it looks like when pointing at the hit skel:
-
[[Image:AssetCreation_CharacterCreationTutorial_image023.jpg]]
+
[[Файл:AssetCreation_CharacterCreationTutorial_image023.jpg]]
Using this tool you can debug all the parts of your skeleton, checking them to see that they are set up with the proper materials.
Using this tool you can debug all the parts of your skeleton, checking them to see that they are set up with the proper materials.
Строка 447: Строка 452:
Testing ragdolls in the engine can be a lot of fun, especially for non humanoids.
Testing ragdolls in the engine can be a lot of fun, especially for non humanoids.
-
[[Image:AssetCreation_CharacterCreationTutorial_image024.jpg]]
+
[[Файл:AssetCreation_CharacterCreationTutorial_image024.jpg]]
-
There are three ways to test the ragdoll physics of a character, the two best being shown above: Either gun them down, or right click them and select &ldquo; '''Events>Kill''' &rdquo;
+
There are three ways to test the ragdoll physics of a character, the two best being shown above: Either gun them down, or right click them and select " '''Events>Kill''' &rdquo;
-
[[Image:AssetCreation_CharacterCreationTutorial_image025.jpg]]
+
[[Файл:AssetCreation_CharacterCreationTutorial_image025.jpg]]
You can also add the character as a '''DeadBody''' entity. Be sure to uncheck &lsquo;resting&rsquo;, when you enter the game, or enable ai/physics, the ragdoll should simulate.
You can also add the character as a '''DeadBody''' entity. Be sure to uncheck &lsquo;resting&rsquo;, when you enter the game, or enable ai/physics, the ragdoll should simulate.
Строка 457: Строка 462:
'''Special Note:''' I should say that ragdoll functionality has been been &lsquo;nerfed&rsquo; in Crysis, and once a ragdoll rests it will cease to be simulated. (if your SDK is augmenting the commercial Crysis game) That said, licensees receive code drops with all CryEngine2 features intact.
'''Special Note:''' I should say that ragdoll functionality has been been &lsquo;nerfed&rsquo; in Crysis, and once a ragdoll rests it will cease to be simulated. (if your SDK is augmenting the commercial Crysis game) That said, licensees receive code drops with all CryEngine2 features intact.
-
[[Category:Official:Asset Creation:Tutorials]]
+
[[Категория:Official:Asset Creation:Tutorials]]

Текущая версия на 17:43, 18 мая 2011

Эта страница страница помечена как находящиеся в процессе перевода с: 18 мая 2011.
Статью пометил сам автор статьи.


Содержание

Character Creation Tutorial

AssetCreation CharacterCreationTutorial image001.gif

Overview

This will be a quick overview of getting a character into the engine; I will use the freely available SDK rig as an example. To follow this example you will need 3D Studio max and CryEngine 2, including the CryEngine exporter for StudioMax. (supplied on the Crysis /Tools folder)

Ориентирование

AssetCreation CharacterCreationTutorial image002.gif

Для того чтобы выполнить этот урок, у вас должны быть файлы показанные выше. Они свободно доступны в Интернете, а также находятся в папке Objects\characters\human_male Для того чтобы выполнить этот урок, у вас должны быть файлы показанные выше. Они свободно доступны в Интернете, а также находятся в папке.

Ассеты персонажей для CryENGINE® 2 хранятся в трёх .max-файлах; в файле с названием персонажа, в файле с названием персонажа и суффиксом _LOD1, и голова с произвольным названием. Вы можете видеть файлы character.max и character_LOD1.max на снимке выше.

Главным образом используется формат CHR, это файл персонажа CryENGINE® 2, также есть формат CGA, который мы опишем чуть позже..

Особое примечание: Во всём этом уроке я буду рассказывать не только об использовании примеров из SDK, но и обширный список заметок, для тех из вас, кто хочет создать свой собственный персонаж с нуля.

Установка экспортёра для 3ds Max

Файлы плагина

3dsMax 8 32 Bit CryExport8.dlu
3dsMax 9 32 Bit CryExport9.dlu
3dsMax 9 64 Bit CryExport9_64.dlu
3dsMax 2008 32 Bit CryExport10.dlu
3dsMax 2008 64 Bit CryExport10_64.dlu

Плагин

Существуют экспортёры на разные «вкусы», в зависимости от используемой Вами версии 3ds Max. Выше показаны версии, скомпилированные по состоянию на ноябрь 2007. Плагин CryExport должен быть помещен в папку plugins находящеюся в корневом каталоге 3ds Max.

INI-файл

Кроме плагина, необходимо разместить текстовый файл с названием CryExport.ini в ту же папку (/plugins), текстовый файл должен иметь путь к CBA-файлу и к редактору.

[Sandbox]
path=J:\Game02\bin32\Editor.exe
animlistpath=J:\Game02\Game\Animations\Animations.cba
buildPath=J:\depot\SDK\CryENGINE2\Main\

AssetCreation CharacterCreationTutorial image004.jpg

AssetCreation CharacterCreationTutorial image005.jpg

Добавление утилиты CryExport

В панели Utility, нажмите кнопку «Configure Button Sets», и из категории Crytek, выберите экспортёр «CryEngine 2 Exporter» и перетащите на кнопку справа.

Особое примечание:
Папка Resource Compiler (Компилятора ресурсов) определяется в зависимости от пути к редактору, в виду этого компилятор ресурсов должен находится в подпапке /rc. Если у вас нет компилятора ресурсов, убедитесь, что SDK установлен правильно.

Макет файла: character.max (LOD0/2/3)

Я хотел бы кратко объяснить узлы которые вы видите в этом .max-файле. Это: render meshes (сетка рендера), thin/fat variation meshes (сетка вариации тонкости/толщины), live deforming skeleton (живой скелет деформации), и live phys skeleton (живой скелет физики).

Сетка рендера:

  • Отображает геометрию персонажа, которую вы видите в игре.
  • Цветные вершины на сетке LOD0 ($character) обозначают области-маски, которые могут быть морфированы между тонкостью и толщиной в движке.
  • Уровень детализации или LOD — являются сетками с низко-полигональным разрешение, которые автоматически исчезают в зависимости от расстоянии до персонажа (в игровом мире).
  • Материал на этой сетке должен соответствовать MTL-файлу в папке персонажа

например: sdk_character.mtl.

  • Узлы сетки рендера:
  • $character
  • $character_LOD2
  • $character_LOD3

Сетка вариации тонкости/толщины:

  • Это две вариации сетки LOD0 ($character).
  • Поскольку эта сетка является морфом, она должна сохранять индекс точек LOD0.
  • Узлы сетки вариации тонкости/толщины:
  • $character_thin
  • $character_fat

Скелет живой деформации:

  • Это скелет, который деформирует сетку рендера.
  • Кости геометрии этого скелета используется для обнаружения ударов и физики у живого персонажа (не

рэгдолл).

  • Материалы, применённые к этому скелету используются для обнаружения ударов.
  • В его иерархии присутствуют «attachment nodes» (узлы прикрепления).
  • Например: $weapon_bone, сюда будет прикреплено оружие в движке.
  • Это основной «Biped Skeleton» (скелет двуногого). Также есть некоторые дополнительные узлы, используемые для автоматического прикрепления ног и обнаружения движений.
  • «$Bip01 L Heel» и «$Bip01 L Toe0Nub» для левой ноги. (R — для правой ноги).
  • Узлы скелета живой деформации:
  • Иерархия узлов с основой «$Bip01».

Скелет живой физики:

Представьте что скелет — это набор переключателей, узел, присутствующий в этом скелете означает, что его дубликат в скелете живой деформации физикализирован в движке, а сам персонаж жив .

  • Каждый узел в этом скелете также хранит физические свойства для соответствующей ему кости в иерархии деформации, и так же хранит IK-свойства физики.
  • Узлы скелета живой физики:
  • Иерархия узлов с основой «$Bip01 Pelvis Phys».

Макет файла: character_LOD1.max (LOD1)

Я хотел бы кратко объяснить узлы которые вы видите в этом .max-файле. Это: render meshes (сетка рендера), thin/fat variation meshes (сетка вариации тонкости/толщины), a ragdoll deforming skeleton (скелет рэгдолл-деформации), и ragdoll phys skeleton (скелет рэгдолл-физики).

Сетка рендера:

  • Отображает геометрию персонажа, которую вы видите в игре.
  • Узлы сетки рендера:
  • $character_LOD1

Сетка вариации тонкости/толщины:

  • Это две вариации сетки LOD1 ($character_LOD1).
  • Поскольку эта сетка является морфом, она должна сохранять индекс точек LOD1.
  • Узлы сетки вариации тонкости/толщины:
  • $character_thin_LOD1
  • $character_fat_LOD1

Скелет рэгдолл-деформация:

  • Иерархия этого скелета должна в точности соответствовать скелету иерархии LOD0 (скелет деформации в character.max).
  • Кости геометрии этого скелета используется для рэгдолл-физики.
  • Геометрия должна состоять из сфер, прямоугольников и капсул.
  • Поддерживается произвольная геометрия, но она может снизить производительность.
  • Материалы, применённые к этому скелету используются для обнаружения ударов.
  • Узлы скелета рэгдолл-деформации:
  • Иерархия узлов с основой «$Bip01».

Скелет рэгдолл-физики:

Подобно LOD0, представьте что скелете — это набор переключателей, узел, присутствующий в этом скелете означает, что его дубликат в скелете рэгдолл-деформации физикализирован в движке, в то время как персонаж находится в состоянии куклы.

  • Каждый узел в этом скелете также хранит физические свойства для соответствующей ему кости в иерархии деформации, и так же хранит IK-свойства физики.
  • Узлы скелета рэгдолл-физики:
  • Иерархия узлов с основой «$Bip01 Pelvis Phys».

Макет файла: head.max

Я хотел бы кратко объяснить узлы которые вы видите в этом .max-файле. Это: render meshes (сетка рендера), morph targets (цели морфинга), thin/fat variation meshes (сетка вариации тонкости/толщины), и deforming skeleton (скелет деформации).

Сетка рендрера:

  • Отображает геометрию персонажа, которую вы видите в игре.
  • Узлы сетки рендера:
  • $head

Цели морфинга:

  • «Цели морфинга» или «сочетания фигур», создают лицевую деформацию сетки рендера.
  • Узлы целей морфинга:
  • $Brow_lowerer
  • $Jaw_dropper_01
  • $Jaw_pusher

Сетка вариации тонкости/толщины:

  • Это две вариации сетки LOD0 ($head).
  • Поскольку эта сетка является морфом, она должна сохранять индекс точек LOD0.
  • Узлы сетки вариации тонкости/толщины:
  • $head_thin
  • $head_fat

Скелет деформации:

  • Иерархия этого скелета не должна иметь больше элементов, чем у скелета деформации персонажа к которому Вы присоедините голову (character.max).
  • Скелеты не должны совпадать! Скелет SLAVE, должен иметь меньше костей, чем скелет MASTER, подробнее об этом чуть позже.
  • Поддерживается произвольная геометрия, но она может снизить производительность.
  • Узлы скелета деформации:
  • Иерархия узлов с основой «$Bip01».

Сетка рендера

Закончим с разъяснениями, начнём окапываться. И кстати пришло время для фотографий.

AssetCreation CharacterCreationTutorial image006.jpg

Откройте файл character.max , Откройте файл сетки рендера, вы просматриваете все три сетки (LOD0/2/3).

Имейте в виду при создании сеток персонажа:

  • Их точка опоры (pivot) должна быть равна нулю во всех трёх плоскостях.
  • Персонаж должен быть обращены вниз по положительной оси Y.
  • К нему не должны быть применены преобразования (позиция, поворот, масштабирование).
  • Если преобразования есть, примените Reset X-Form, перед тем, как начнёте.
  • Убедитесь, что модель соответствует сочленяем скелета.
  • Скелет живой деформации должен «привязать форму», если вы примените модификатор Skin.

Особое примечание:
При создании своего собственного персонажа, вам не нужно подгонять свою сетку рендера под наш скелет из SDK. Но имейте в виду, при этом ваш персонаж не сможет использовать существующие наборы анимации Crysis. Если вы хотите использовать пользовательский персонаж/скелет, примите к сведению трудность создания всех анимаций, необходимых для получения движущегося пользовательского скелета с достойной верность движений нового поколения игр, это может быть сотни и тысячи ассетов анимации.

Если модель вашего персонажа подходит под этот скелет, используйте Skin (или Physique если вы мазохист), чтобы добавить вес к сетки рендера в сетке деформации .

Скелеты «деформации» и «физики»

Ассеты персонажей разделены на основной файл (character.max) и файл LOD1 (character_LOD1.max), у каждого файла есть скелет деформации и физики. Очень важно понимать роль каждого скелета в каждом файле.

Живой скелет деформации и живой скелет физики в основном файле (LOD0/2/3) хранят обнаружение ударов и физические свойства живого скелета, а те, что в LOD1 хранят обнаружение ударов и физические свойства рэгдолла.

Не бейте себя по голове, это важно:

Основной файл персонажа (character.max).

Сетка рендера персонажа взвешена на скелет живой деформация, физические свойства которого хранятся в скелете живой физики.

Файл LOD1 персонажа (character_LOD1.max).

Сетка рендера персонажа взвешена на скелет рэгдолл-деформации, физические свойства которого хранятся в скелете рэгдолл-физики.

AssetCreation CharacterCreationTutorial image007.jpg

Откройте Layer Manager (Управление слоями), там вы увидите скрытый слой «bip», если вы скроете «default» и отобразите «bip», вы увидите это:

AssetCreation CharacterCreationTutorial image008.jpg

Это скелеты живой деформации и физики файла LOD0/2/3 (character.max).

Скелеты «деформации»

В случае если вы пропустили раздел «Макет файла», вот за что ответственен скелет деформации:

  • This is the skeleton that deforms the render meshes
  • The bone geometry of this skeleton is used for hit detection and physics in the live character (non-ragdoll)
  • The materials applied to this skeleton are used for hit detection, to tell the engine what part of the character you have hit.
  • There are ‘attachment nodes’ in this hierarchy
  • Example: $weapon_bone, this is where the weapon will be attached in the engine.
  • This a basic ‘Biped Skeleton’ but other than ‘attachment nodes’ there are some additional nodes used for automatic foot plant and gait detection
  • $’Bip01 L Heel’ and $‘Bip01 L Toe0Nub’ on the left foot. (also present on the right foot)
  • Deforming Skeleton Nodes:
  • Hierarchy of nodes under and including $Bip01
  • The Ragdoll Deforming Skeleton , located in the LOD1 asset file, is used for collision and hit detection in the ragdoll.

Special Note: The recommended number of physicalized bones in a humanoid biped ragdoll is 10-14

AssetCreation CharacterCreationTutorial image009.jpg

The deforming skeleton 3dsMax material setup for a Crysis humanoid character.

Material Setup As you can see, the deforming skeleton has different submaterials assigned to it, these are used for hit detection in the engine. On Crysis, the first 10 submaterials were devoted to hit locations, and any after that were used for textures. This can vary by project.

AssetCreation CharacterCreationTutorial image010.gif

The submaterials in the engine correspond to surface types defined by code

If you open the sdk_character.mtl in the CryEngine2 Material Editor, you will see that the submaterials used for hit detection are assigned to corresponding surface types ; they are also assigned the ‘ nodraw ’ shader.

Special Note: Here are some things to keep in mind when altering or replacing the deforming skeleton with something of your own:

  • Keep your bones and rig elements in the ‘bip’ layer
  • Allows animators to easily hide the rig
  • Allows cryTools to manage rig visibility automatically
  • If you are using a new or custom skeleton, you should be prepared to recreate the full locomotion animation set to support it’s moving in the game.

The skeleton must face down the +Y axis*

  • Nodes in the hierarchy should have no scale applied to them

All bones/nodes should have 100 % XYZ scale*

  • There is a bug in Max where mirroring bones causes them to have a −100 % scale: be on the lookout for this. Use the mirror function in ‘Bone Tools’ before converting them to ePoly.

The root bone pivot should be placed at 0,0,Z* in world coordinate space.

  • The pivot of the root bone must have its positive X looking forward, positive Y looking left (of the facing direction of the character) and positive Z looking up vertically.
  • No bones can be outside of the skeletal hierarchy, the exporter starts at one root bone and steps through all its children.
  • This also means no external bones can be constrained into the skeleton

If you want bones to act like they are outside of the skeleton, you can change their transform inheritance in Command Panel->Hierarchy->Link Info->Inherit*

  • Once they are not inheriting transforms from their parents, you can drive them with constraints as if they were outside the hierarchy
  • The bones of the spine and head need to match the orientations and names of the biped skeleton for lookIK to work

The names are 'Bip01 Head' 'Bip01 Neck' 'Bip01 Spine3' 'Bip01 Spine2'*

  • If you want to have rig elements inside the hierarchy, keep them to the periphery and use the prefix '_' to comment them out of export
  • The '_' prefix effectively comments an object, and all of it’s children out on export
  • If you must have them in the hierarchy, and they are exported into the engine, try not to have them be splines or shapes, convert them to polygons
  • Keep in mind that any rig elements inside the hierarchy that are exported will be null bones in the engine, and take up memory/cpu time, so do this sparingly
  • It’s a good idea to put your hit material submats first for humanoid skeletons that you will re-use, this way the numbers will not change based on how many different texture submats you use.
  • Make sure that all the models are NOT linked to anything. Having, for instance, the pants of your character linked to it’s hands will cause an error in the exporter causing it to create multiple skeletons.

Ragdoll Deforming Skeleton (LOD1)

AssetCreation CharacterCreationTutorial image011.gif

Above you see the ragdoll deforming skeleton and ragdoll phys skeleton from the LOD1 file.

The deforming skeleton in the LOD1 asset file is used for collision/hit detection in the ragdoll, this is called the ragdoll deforming mesh . It can be made from arbitrary geometry, like the live deforming skeleton , but should be made from capsules, boxes, and spheres.

Special Note: Biped can be finicky, the best way to create your own custom ragdoll deforming skeleton is to align capsules and boxes to your existing skel, then via editPoly, attach them to your node and delete the old geometry.

The ‘Phys’ Skeletons

There are two phys skeletons that a character has, one in the main character file, and one in the LOD1. In case you skipped the file layout section, here is what the phys skeleton is responsible for:

  • Think of this skeleton as a set of switches, a node being present in this skeleton signifies that it’s counterpart in the deforming skeleton is physicalized in the engine.
  • Each node in this skeleton also stores physical properties for it’s corresponding bone in the deforming hierarchy, this is stored in the phys bone’s IK properties.
  • Phys Skeleton Nodes:
  • Hierarchy of nodes under and including $’Bip01 Pelvis Phys’

The ragdoll phys skeleton is stored in the LOD1 file (character_LOD1.max). It stores the ragdoll physical properties of the character in the same way that the live phys skeleton stores them for the live deforming skeleton .

AssetCreation CharacterCreationTutorial image012.jpg

Here we are looking at the phys skeleton in the main character file (character.max), this is also known as the live phys skeleton , because it is used for the live character physics.

Each part of the phys skeleton references a node in the deforming skeleton , it has the same name as that node, but the suffix ‘ phys ’. In the example above you see ‘ Bip01 Spine1 Phys ’, which is the phys node referring to ‘ Bip01 Spine1 ’ in the deforming skeleton .

Limits The phys skeleton nodes match the orientations of their counterparts in the deforming mesh exactly, and their IK limits are the offset rotations that that physics will be able to deviate from any playing animation. Be sure to check ‘ Active ’ and ‘ Limit ’, then enter in your values. If your limits exceed +/- 90 degrees read on about ‘ ParentFrames ’.

AssetCreation CharacterCreationTutorial image013.gif

ParentFrames When the needed rotational limits of a node in the phys skeleton exceed +/- 90 degrees, you will often need to use a ‘ ParentFrame ’. A ParentFrame is a node that sits above the phys node and zero’s out it’s rotations. It is basically an identical copy of the node, which sits above it in the hierarchy, and has the suffix ‘ parentFrame ’. Here is an example of a phys hierarchy with parentframes on all limbs:

AssetCreation CharacterCreationTutorial image014.jpg

Dampening and Spring Tension Stiffness of an angular spring at a joint can be adjusted via «Spring Tension» parameter. A value of 1 means acceleration of 1 radian/second2 (1 radian = 57�). Damping should also be set to some reasonable value (1.0 corresponds to fully dumped oscillations for an isolated joint, 1.0 is the recommended value).

As shown above, each piece of the phys skeleton has properties under the Hierarchy tab(IK).

Special Notes:

  • If you have a node present in the phys skeleton, it must have physical properties
  • If all it’s limits are defaulted to ‘0’ it will not be export into the game engine
  • This is important with the root, which should have no real limits, but needs garbage numbers in the limit fields to export properly (check SDK char)
  • The recommended number of physicalized bones in a humanoid biped ragdoll is 10-14
  • The deforming skeletons will have their shapes and mass taken into account, so the mesh must be physically valid in order to behave convincingly
  • Heavy-light-heavy patterns in bone structure should be avoided in the 'Phys Skeleton’.
  • A typical example from biped is spine-neck-clavicle-upper arm connection with heavy spine, light neck and clavicle, and relatively heavy upper arm.
  • For ragdoll phys skeletons it’s recommended to exclude neck (not necessarily neck1,2, though) and the clavicles from the Phys Skeleton.
  • Try to have your ragdoll deforming skeleton consist of primitives wherever possible.
  • Try to avoid sharp corners near joints
  • Avoid using joints with all 3 axis locked whenever possible, because they slow down the simulation w/o doing anything useful
  • Remember: Keep the phys mesh pivot points alligned in orientation to the bones they are suppose to be physicalising. When the phys IK values are set, they are translated onto the bones of the character in the game. But those IK values work with the pivot alignment. If the bone pivot orientation is different from that on the phys mesh, when in the game, the bone will be rotated to align to the phys mesh, thus creating the undesirebale effect.
  • When creating your own phys skeleton, because it needs to have the same orientations as the deforming skeleton, just snapshot your existing skeleton. Then, remove parts you do not want, reparent the children, and rename them. When you have removed one of these, it will remain locked in default orientation, and will not be physicalized. Check the spine setup on the SDK character for an example.
  • You can also place certain words in an object’s ‘user defined properties’ to force it into a primitive in the engine, this will generate a bounding primitive around the mesh. Here are some you can try
  • nonphysical
  • sphere
  • box
  • capsule
  • cylinder
  • If your limits and deforming skeleton meshes match for ragdoll and live skeletons, you can store all the rendermeshes in one file, this makes things a lot simpler
  • You no longer have two files to manage and two hierarchies to sync

Advanced Setup

These are some techniques/features that are not present in the SDK character example.

Character Ropes

Characters with ropes and hinges are not included in the SDK, but I will touch on them quickly.

AssetCreation CharacterCreationTutorial image015.jpg

Here is a piece of the ‘Trooper’ hierarchy, Rope3 is a physicalized rope

Character Ropes

  • In order to have some character bones simulated using rope physics one has to name the corresponding bones 'rope[rope number] Seg[segment number]' i.e "Rope1 Seg01”. The bones in the same rope strand need to have identical Rope numbers and continuous numbering for the segments, i.e. Seg01, Seg02, Seg03. The ‘rope number’ can go from 1-9, and then needs to be 01, 02, 03, etc. The roots of each strand (Seg01) should be linked to a point helper named "null_[rope name]_connect”, which in turn should be linked to the bone to which the ropes are required to be attached to.
  • All segments in one rope should have approximately equal length. Note that a rope bone should never be the leaf bone (w/o children), since the bone after the last rope bone is used to provide terminal rope vertex. Also note that currently ropes cannot connect 2 physicalized parts of a skeleton; they can be either «roots» (ex: hanging light cord), or leaves (ex: character’s ponytail or braid).
  • In game script one should first create some physical entity, then load and physicalize the character model. By default all bones are physicalized (unless « Phys» counterpart skeleton is present, which will most likely be the case only for characters). Note, however, that rope bones normally should not be a part of main character physics (which for hanging lamp will most likely be a rigid body), thus they should have 'nonphysical' keyword in their user-defined properties (as well as other bones that do not represent physical geometry).
  • During the physicalization ropes are created and stored internally in the character system. The 1st end of the rope is the one that is closer to the root bone. Both the 1st and the 2nd ends are automatically tied to character physical entity if they are connected to its physicalized parts (not necessarily directly).
  • In order to alter parameters of rope physics one should call:
  • SetCharacterPhysics(slot_number, «ropename», PHYSICSPARAM_ROPE,param_table).

param_table* can contain the following fields: length* — full length of the rope; entity_id_1* — entity id the 1st rope end is tied to (-1 if statically tied world, −2 if not tied at all); entity_part_id_1* — entity part id the 1st rope end is tied to end1 (vector)* — the 1st end attachment point (if unspecified, it is assumed to be current end point position); end2 (vector)* — the 2nd end attachment point; check_collisions* — 1 if the rope should collide with the environment (0 otherwise); coll_dist* — rope thickness for collision detection.

  • Currently ropes cannot apply forces or otherwise alter the behavior of the objects they are colliding with, save the objects they are directly tied to (and tied objects receive impulses only when the rope is fully strained along a straight line).
  • 'Stiff' ropes can be mimicked by having few rope segments (bones) and setting up mesh skinning so that visually the rope bends smoothly rather than abruptly at joint points.

Adjusting Rope Properties

To physicalize the ropes and make them active you also need to create phys bones for the first segment of each bone strand. These phys bones should be linked to the phys mesh of the character body. To activate collision of the ropes with the body and environment and/or activate the gravity you need to put ‘ "active_phys gravity”* ’ in the UDP (User Defined Properties). These are the settings to activate certain properties of the rope’s behavior and properties (set in the Hierarchy/IK/Rotational Joints panel): character collision* — y axis active, will collide with the local character environment collision* — x axis active, will collide with the environment joint limit* — spring tension x, this will be the per-bone rotational limit for the chain stiffness* — maximum x limit stiffness decay* — maximum y limit damping* — maximum z limit max time step (default 0.02)* — spring tension y friction* — spring tension z

Character Hinge Attachments

AssetCreation CharacterCreationTutorial image016.jpg

When adding CGF bone attachments in character editor, you can create hinge joints to give the rigid attachments realistic secondary motion. Just select the bone attachment, then check ‘ Physicalized ’, select a hinge rotational axis, and specify some values. It takes some trial and error to get right, but the results are great.

CGA Files

AssetCreation CharacterCreationTutorial image017.jpg

A CGA file is a conglomerate of CGF objects and animation data. They are used for rigid, non-deforming animations, like the baked physics above. CGA files are like character files with some major differences:

  • They store a hierarchy but no skinning data
  • There are CGF files attached to this skeleton, which are also stored in this file
  • There is a default animation also stored in the mail file
  • It is referenced as ‘Default’
  • A CGA can also play ANM files, and reference them in a CAL file.
  • CGA animated objects must use TCB controllers in 3dsMax; to reduce size, reduce keys

Special Notes: To convert many objects to TCB you can use this snippet of maxscript (or cryAnimationTools)

=forobjinselectiondo= =(= = obj.rotation.controller = tcb_rotation ()= = obj.position.controller = tcb_position ()= =)=
AssetCreation CharacterCreationTutorial image018.jpg

Exporting Your Character into CryEngine2

Add your render meshes into the ‘ Object Export ’ listbox, make sure that ‘ Export To ’ is set to ‘ Character (.chr) ’ and then click ‘ Export Nodes ’. Your CHR should be saved to disk in the location of the max file, you can click ‘ Exlore… ’ to go there immediately.

Special Notes: You can export multiple meshes at once; just add them in the Object Export list box.

CAL files

In the SDK folder (/human male), you may have noticed a CAL file, this is a Character Animation List . It points the engine to the animations a character can playback.

Special Note: Every character must have a CAL file, if you created a custom skeleton you might have to make custom anims to drive it, to do this you need to make a custom CAL file and Animation graph, which is beyond the scope of this tutorial.

CDF files

A CDF or ‘ Character Definition File ’ is used to group many CHR files together, or CHR files that have CGF attachments. For more information on assembling characters in the engine, please refer to the Character Editor documentation.

Special Note: You can also attach ‘null sockets’, which can be placeholders for particle effects, or node orientations for things like grabbing or orienting an object onto another in game.

In Engine Debugging (Animation, Hit Detection, Physics)

It can be difficult to tell if your skeletal changes are working in the engine. Well, it’s easy to see if it’s deforming by simply playing an animation on it. The difficult thing can be checking the phys setup. Here’s how:

On the Rollup Bar , select Entity , then drag a Grunt into an empty level. Under the ‘ Entity Properties ’ for the Grunt, find the ‘ Model ’ property.

image019.jpg Extracted from ReadOnly-0-Rev-2-character_creation_tutorial.doc_files.zip

AssetCreation CharacterCreationTutorial image020.gif

When you reload the entity, you should now see something like this:

AssetCreation CharacterCreationTutorial image021.jpg

‘Grunt’ Entity in engine with character.chr from the SDK loaded as ‘Model’ under Entity Properties

Special Note: Reloading Entity Scripts - When working with characters, you will need to reload them to check changes you have made, the easiest way to do this is right slick the character or the icon and select ‘ Reload Script ’, or you can click ‘ Reload Script ’ under the Entity Properties . Some systems can cache a character, and when all else fails, try closing Editor and reopening it again.

Hit Detection and Live Physics

So now that you have the character in the engine, let’s check out the skeleton, to do this, go to the console (‘ ~ ’ key) and type in ‘ p_draw_helpers 1 ’, without the ‘’ of course, and press enter. You should see something like this:

AssetCreation CharacterCreationTutorial image022.jpg Character.chr with ‘ p_draw_helpers ’ enabled, this shows the physical hit mesh.

If the skeleton is in the default pose, you might need to toggle ‘ AI/Physics ’ in the lower right.

So now you can see the deforming skeleton, and you can jump into game and shoot/test it. But how do you know if the hit materials are set up properly? If you jump into game mode and press ‘ 7 ’, you will see that you have a weapon that tells you the material of any object you point at, and it will tell you even more info about that item if you ‘shoot’ it. Here is what it looks like when pointing at the hit skel:

AssetCreation CharacterCreationTutorial image023.jpg

Using this tool you can debug all the parts of your skeleton, checking them to see that they are set up with the proper materials.

Ragdolls

Testing ragdolls in the engine can be a lot of fun, especially for non humanoids.

AssetCreation CharacterCreationTutorial image024.jpg

There are three ways to test the ragdoll physics of a character, the two best being shown above: Either gun them down, or right click them and select " Events>Kill

AssetCreation CharacterCreationTutorial image025.jpg

You can also add the character as a DeadBody entity. Be sure to uncheck ‘resting’, when you enter the game, or enable ai/physics, the ragdoll should simulate.

Special Note: I should say that ragdoll functionality has been been ‘nerfed’ in Crysis, and once a ragdoll rests it will cease to be simulated. (if your SDK is augmenting the commercial Crysis game) That said, licensees receive code drops with all CryEngine2 features intact.