How to create a simple arcade space ship movement system?

After a little bit pokin around in the engine code, internet searches regarding input vector and what happens actually in the movement component figured out some stuff that might interest you, which fundamentally confirms all the stuff I wrote in a hight level description. I did custom movements before in the engine for my game like wallruns, climbs, slides, hangs, wallrun mantles, normal mantes etc but never dig deep into base movement (Think its because of time allocation of the things I have to do)

Here is step by step breakdown also what happens in the engine when you add an input vector.

  1. Function runs on the frame. Think that function input like “Player wants to move this direction”
  2. This input is basically hold in pawn as LastInputVector then on the frame update its consumed.
  3. Then this vector actually converted to movement, there are some check functions on component like speed depending on what kind of movement will be made.
  4. These checks as commonly can be friction, slope angle, gravity etc. for calculate the actualy movement
  5. This is something I deal with and generally happens functions like UCharacterMovementComponent::PhysWalking(float deltaTime, int32 Iterations) which in a high level : Velocity,Delta Distance etc
  6. Then you apply these basically with a function like SafeMoveUpdatedComponent(Velocity * DeltaTime, UpdatedComponent->GetComponentQuat(), true, Hit);
  7. After movement happened the other things get updated like animations and so on

There is many aspect when a movement is tried, calculated and executed.

Like are running on ground and sliding as an example.. press crouch, you try to detect if player can slide (if speed, floor angle is available for sliding) then you calculate the actual slide with floor angle, enterance speed, boosted factor for speed for mass, max slide distance etc. and in the end calculate this movement and apply movemeent for each frame.. Since on the next frame there could be a rock that would stop player from sliding then movement mode changed, something else happens, or its a big rock, speed gets down already and slide ends, player goes to default movemeent mode which is walking..However eeach calculation is still derived from base physics laws.

Since movement is something very core at gameplay, it deserves a little bit attention and iteration. It can be overlooked but what I think movementcomponent code base is one of the nicest things in unreal.