UE1 - UT MoveSmooth & Move

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Davill

New Member
Aug 19, 2009
28
0
0
Russia
Tell me please, what is the difference between MoveSmooth & Move methods of actor. I tested both in game, but watched same movement.
 

meowcat

take a chance
Jun 7, 2001
803
3
18
A call to Move is supposed to stop as soon as a blocking object is encountered (so if the entire distance delta may not be moved, the actor will only move part of that distance). MoveSmooth is supposed to try and slide the actor along even if that means "stepping up" or poking below a ledge, or hitting a wall and moving along it.

If an actor is set to not collide with anything there would be no visible difference between using move and movesmooth.
 

meowcat

take a chance
Jun 7, 2001
803
3
18
Sort of, but not really. If the actor has its physics set to anything other than PHYS_None, it should automatically have move or movesmooth called from native code every tick with the delta distance being calculated (roughly) something like:
Code:
//pseudo code, not sure if gravity vector is always added, or only when falling

simulated function TickMove(float dt) { // dt is deltatime, the maount of time that has passed since the last frame
local vector vMoveDelta;
local vector vClampVel;

// calculate clamped velocity
vClampVel = Velocity + acceleration*dt;
if(Physics == PHYS_Walking) vClampVel = Normal(vClampVel) * FMin(VSize(vClampVel), GroundSpeed);
else if(Physics == PHYS_Falling){
   vClampVel.Z=0; // don't take into account the vertical component when clamping velocity while falling
   vClampVel = Normal(vClampVel) * FMin(VSize(vClampVel), GroundSpeed) + gravity*dt + Velocity.Z * vect(0,0,1); // don't forget to add gravitational "pull" and the existing Z component of velocity
}
else if(Physics == PHYS_Flying)  vClampVel = Normal(vClampVel) * FMin(VSize(vClampVel), AirSpeed);
else if(Physics == PHYS_Swimming)  vClampVel = Normal(vClampVel) * FMin(VSize(vClampVel), WaterSpeed);


vMoveDelta = vClampVel*dt;

MoveSmooth(vMoveDelta);

}

If you set Physics to PHYS_None, you could probably use the above function to simulate the native movement (and using some other variable for the Physics checks). I don't remember if there was a simple way to specify whether move or movesmooth would be called, but my best guess is that it is solely based on whether the actor collides with anything else (world geometry or other actors) or not. MoveSmooth will also take into account the MaxStepHeight to determine how far up to perform offset traces when seeing whether the actor can move into a location or not.

See this UDN page for a better explanation.
 
Last edited:

Zur

surrealistic mad cow
Jul 8, 2002
11,708
8
38
49
Is this why players sometimes slide around when they're deconnected unexpectedly :) ?