CryEngine 5.4 - Improve the default third person movement system

#1
What the default third person movement system have - Simple move and aim, period!
What I have tried Goal:
- Add sprint ability (When hold Shift)

Create the Blend space file (Assume you've already known how to apply this blend space file for your character)
\Assets\Animations\motusAnims\bspace\1DONE-BSpace_jog.bspace

Code: Select all

<ParaGroup> <Dimensions> <Param Name="MoveSpeed" Min="0.2" Max="2.5" Cells="9"/> <Param Name="TravelAngle" Min="-3.14" Max="3.14" Cells="29"/> </Dimensions> <ExampleList> <Example SetPara0="0.2" SetPara1="-3.14" AName="walk_bck_3p"/> <Example SetPara0="0.2" SetPara1="-2.093" AName="walkcross_bck_rgt_3p"/> <Example SetPara0="0.2" SetPara1="-1.047" AName="walkstrafe_rgt_3p"/> <Example SetPara0="0.2" SetPara1="0" AName="walk_fwd_3p"/> <Example SetPara0="0.2" SetPara1="1.047" AName="walkcross_fwd_lft_3p"/> <Example SetPara0="0.2" SetPara1="2.093" AName="walkstrafe_lft_3p"/> <Example SetPara0="0.2" SetPara1="3.14" AName="walk_bck_3p"/> <Example SetPara0="2.5" SetPara1="-3.14" AName="jog_bck_3p"/> <Example SetPara0="2.5" SetPara1="-2.093" AName="jogcross_bck_rgt_3p"/> <Example SetPara0="2.5" SetPara1="-1.047" AName="jogstrafe_rgt_3p"/> <Example SetPara0="2.5" SetPara1="0" AName="jog_fwd_3p"/> <Example SetPara0="2.5" SetPara1="1.047" AName="jogcross_fwd_lft_3p"/> <Example SetPara0="2.5" SetPara1="2.093" AName="jogstrafe_lft_3p"/> <Example SetPara0="2.5" SetPara1="3.14" AName="jog_bck_3p"/> </ExampleList> <Blendable> <Face p0="6" p1="5" p2="12" p3="13"/> <Face p0="5" p1="4" p2="11" p3="12"/> <Face p0="4" p1="3" p2="10" p3="11"/> <Face p0="3" p1="2" p2="9" p3="10"/> <Face p0="2" p1="1" p2="8" p3="9"/> <Face p0="1" p1="0" p2="7" p3="8"/> </Blendable> </ParaGroup>
Register sprint button as Left shift key
Code\Components\Player.cpp

Code: Select all

void CPlayerComponent::Initialize() { //... m_pInputComponent->RegisterAction("player", "sprint", [this](int activationMode, float value) { HandleInputFlagChange((TInputFlags)EInputFlag::Sprint, activationMode); }); m_pInputComponent->BindAction("player", "sprint", eAID_KeyboardMouse, EKeyId::eKI_LShift); }
Apply move command for sprint
Code\Components\Player.cpp

Code: Select all

void CPlayerComponent::UpdateMovementRequest(float frameTime) { //... float moveSpeed = 10.0f; if (m_inputFlags & (TInputFlags)EInputFlag::Sprint) moveSpeed *= 3; //Sprint - triple the speed //... }
Result Here is the humble result, this video shows the flickering issue in walk animation
https://vimeo.com/251757744
Purpose of the topic Discussing the methods to make the movement of the player looks more natural and performance friendly or any template that you find worth sharing (doesn't have to be good though)
I post this topic on CryEngine forums instead of general game dev forums because I want to make use of the Blend Space feature of CryEngine which is pretty good.

I hope we can have a better movement system as reference resource for the community. Any input is appreciated.
Last edited by HDN on Fri Jan 19, 2018 5:27 am, edited 2 times in total.
Small tips
How to add an image to a forum post
[C++] How to smoothly turn your character

Re: CryEngine 5.4 - Improve the default third person movement system

#2
Here is a freaking simple idea to make the sprint speed increase over time
Code\Components\Player.cpp

Code: Select all

void CPlayerComponent::UpdateMovementRequest(float frameTime) { //... //declare float m_fVerlocityIncrease = 0.0f; in the CPlayerComponent class. float moveSpeed = 10.0f; const float MaxIncrease = 200.0f; const float increaseSpeed = 10.0f; if (m_inputFlags & (TInputFlags)EInputFlag::Sprint) { if (m_fVerlocityIncrease < MaxIncrease) m_fVerlocityIncrease += frameTime * increaseSpeed; moveSpeed += m_fVerlocityIncrease; } else m_fVerlocityIncrease = 0.0f; //.. }
Small tips
How to add an image to a forum post
[C++] How to smoothly turn your character

Re: CryEngine 5.4 - Improve the default third person movement system

#3
Has anyone changed the default third person movement system (it's like character-based movement which - I think - like GTA Vice City movement style) to third person camera-based movement style (Like GTA SanAndreas movement style). camera-based movement style is pretty popular, many titles have used it: GTA titles after GTA SanAndreas, Sleeping Dogs, Prince Of Persia, Prototype,...
Small tips
How to add an image to a forum post
[C++] How to smoothly turn your character

Who is online

Users browsing this forum: No registered users and 2 guests