Posts

Showing posts with the label Character

Look at the object by rotating head

Image
Step 0. If you move the character's head according to the environment change, the game quality will increase. It feels like there is a better AI and more animations. So we try bone rotation to see world actors. Step 1. Place NPC characters. You can substitute another class for testing. Step 2. Edit character blueprint. Add a vector that named 'InterestingLocation'. Add a function to find the nearest interesting location in the world space. Step 3. Find proper bone to use. We will use 'neck_01' here. Step 4. Edit AnimGraph. Add a 'Transform bone' node. Set the value as shown in the screenshot below. Step 5. This is animation event graph. Depending on character blueprint and bone rotation, 'Make Rot from Y' should be replaced with 'Make Rot from X' or something else. The remaining issue... - If you want smooth transition, you need to make more changes. - It shou...

Bone name based animation retargeting(C++ modification)

Image
Step 0. Unreal Engine 4 Animation retargeting  : https://docs.unrealengine.com/latest/INT/Engine/Animation/RetargetingDifferentSkeletons/index.html Animation retargeting system is useful but it's not a match based on a name, so sometimes it gets bad results. Step 1. Open this file. \Engine\Source\Editor\Persona\Private\BoneMappingHelper.cpp FBoneMappingHelper::CalculateNameScore() seems to be fixed, but there are a lot of things that need to be corrected due to the additional weighting and comparison of candidates. If you fix FBoneMappingHelper::TryMatch(), you can get the desired result. This is the code for a typical naming. You can make it better one. Step 2. This is the result screenshots.

Animation reuse for improved performance

Image
Step 0. A well-made game shows a lot of characters without losing the quality of the rendering. In general, fewer bone counts and proper LOD usage will help optimize character rendering performance. A closer look reveals that the animation is being reused. Undoubtedly it will be very helpful. This time, we will do a basic test for 'animation reuse' with Unreal engine 4. Step 1. 'Set Master Pose Component' is the blueprint we were looking for. I've used it before in another article. https://gameenginebread.blogspot.com/2017/09/render-skeletal-mesh-with-different.html Step 2. Create many characters for testing. I used 21 * 21 characters. Step 3. This is the result of reusing the animation. Type console command 'stat anim' to see detail. 'AnimGameThreadTime' : 2.91ms CPU i7 6700k and Geforce 1060 are installed in the test PC. Step 4. Remove link to 'Set Master Pose Component' node and test a...