This tutorial aims to explain the process of replacing a player character from the Isometric Pathfinding Template C++ template project with another animated model.
Please be advised that GameSDK is NOT used for this tutorial. It is based on the templates that are provided with the Engine, so create a new project using the Isometric Pathfinding template.
If you prefer to watch a video tutorial rather than read a written one, check out the video tutorial at the bottom of this page.
This tutorial can be used as a base for other templates, but these don't work exactly the same as the Isometric Pathfinding template. Please be careful when attempting this.
Download the following file and extract anywhere:
This is just an example asset. It is of course possible to use other .fbx characters.
Save it under objects/characters/
Importing will create several different assets related to this character model, so it is recommended to create a new folder inside objects/characters, e.g. objects/characters/deer.
The .zip file also contains a texture file, deer_texture.tif. To assign this to the deer model:
Drag the deer_texture.tif into the same folder in the Asset Browser.
When looking under Animations, it will become clear that the one animation that came with this model (i.e. Take 001) is actually made up of three different animations: an idle animation, a walking animation and a running animation.
First, it is important to know which frames represent which animation. To find this out, go to Character Tool -> Playback panel and change Seconds to Frames:
Changing seconds to frames
Check when the animations start and which frame is the last of each animation. Write these frames down for later use.
The first frame is the default pose and therefore not part of an animation. Make sure to skip this frame and start the first animation on frame 1.
To separate the animations:
Rename the animation clip from Take 001 to something relevant, like deer_idle.
Click Preview this to test the animation.
Since the skeleton list is not used in Engine release from 5.6 onwards, any references to skeletonlist.xml within this tutorial can be ignored.
This means that if you're using CRYENGINE 5.6 or later, your next step should be Changing the Third-Person Model to the Deer Model.
To add the skeleton of the deer, either the Character Tool can be used, or the skeletonlist.xml file can be edited.
Copy and paste the line for the existing skeleton onto the following line and replace the name and path to match your deer skeleton, e.g.
<Skeleton name="deer" file="Objects/Characters/deer/deer.chr"/>.
It is advised to name the skeleton the same as the name of the file that was imported earlier, in this case deer.
Now that the model and all its associated parts (skeleton, texture etc.) have been imported into the Sandbox, the template source code needs to be modified to load the new deer model instead.
Look for line 25, which contains m_pAnimationComponent->SetCharacterFile and replace the thirdperson.cdf with the deer.cdf, including its path. The line would then read something similar to:
m_pAnimationComponent->SetCharacterFile("Objects/Characters/deer/deer.cdf");
The line number mentioned here may vary between Engine versions.
Change the model at the end of line 4 and 5 to your deer.cdf, including its path (like in step 5).
The character still needs to be set up to use the new animations that were imported earlier, because the animations from the third-person template (Motus character) are incompatible with the new deer skeleton.
In the Fragments tree in the top left, expand the Idle -> Walk animation and double-click Option 1:
Finding the Walk animation
To the right in the Anim Clip Properties, click the field next to Animation and change this to the deer_walk animation:
Changing animation clip
Now press Ctrl + G to test the deer in the template level. Clicking anywhere in the level or on the ramp should make the deer walk there.
It is advised to name the skeleton the same as the name of the file we imported, in this case deer.
An example level can be found in the Asset Database that combines the results from this tutorial and the next one. You can find it on the Asset Database.
Topic index: