Flipping players

  • 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.

The_Pixie

UnrealFortress coder
Feb 20, 2001
13
0
0
Visit site
This is pretty hard to explain but I wonder if you've seen this as well...

Start up a network game or join a network server. Move up behind a friendly player that is walking forward and bump into him from behind. Just walkin into his back. On large open areas you will sometimes notice that the bumped player pops/flips away a distance (most of the time all the way to the distance wall or whatever is in the way) and back again.

This happens more often in games where you have different playerclasses with different groundspeed, but you can also see it in normal UT CTF.

Seen it? Any idea why it happens?

I've seen it happen lots of times in unrealfortress where you have a large range of different groundspeeds. Trying to backstab someone or infect an enemy can be pretty hard when the enemy flips/pops away like that.
 

usaar33

Un1337
Mar 25, 2000
808
0
0
Unknown
www.UsAaR33.com
It is part of the unrealtournament netcode:

from playerpawn.replicatemove:

ForEach AllActors(class'Pawn', P)
if ( (P != self) && (P.Velocity != vect(0,0,0)) && P.bBlockPlayers )
{
Dir = Normal(P.Location - Location);
if ( (Velocity Dot Dir > 0) && (P.Velocity Dot Dir > 0) )
{
// if other pawn moving away from player, push it away if its close
// since the client-side position is behind the server side position
if ( VSize(P.Location - Location) < P.CollisionRadius + CollisionRadius + NewMove.Delta * GroundSpeed )
P.MoveSmooth(P.Velocity * 0.5 * PlayerReplicationInfo.Ping);
}
}
Appearently, it doesn't work very well :p
Epic screwed up and forgot to divide ping by 1000 ;p
 

The_Pixie

UnrealFortress coder
Feb 20, 2001
13
0
0
Visit site
Yes, I'm in the UnF team, so I know where to put it, I just wondered if you knew how to fix it up code-wise. But I'll look into that part and see what can be done about it since It annoys me :)

Is it the value of PlayerReplicationInfo.Ping that is too high?

One funny thing... I mailed Tim about this a year ago or so, and this bug/effect came like news to him. He thought we had done something ourselves to the pawn movements. I always thought it was somewhere in the Pawn bump-events...never saw this one ;)

You got the same code in ClientUpdatePosition. I wonder what will happen if this piece of code was commented away. Risk getting stuck inside another player in network games?

Thanks again usaar33, you rock.
 

usaar33

Un1337
Mar 25, 2000
808
0
0
Unknown
www.UsAaR33.com
simply divide ping by 1000 for a true ping.

It should be noted that Mongo feels, and I now agree with, that the 0.5 should not exist.

However, the code has a fundamental problem: if fixed, you will keep pushing the player in front and thus overrun your pos on the server (and be pushed back with clientupdateposition).

You may want to ensure that the player is only moved when the server updates the location of that player. (yes, it will be very hard to know when this occurs)
 

The_Pixie

UnrealFortress coder
Feb 20, 2001
13
0
0
Visit site
I just tried this out. I do like this in replicatemove():

P.MoveSmooth(P.Velocity * (PlayerReplicationInfo.Ping/1000));

and tested it on my LAN. Seems to work perfect the few minutes I tried it out, but dividing the ping with that much will result in a close to zero velocity - the bumped player doesn't move at all. *shrugs* Seems to do the trick anyway, it's WAY easier to knife down the enemy now... ;)