logo
Main

Forums

Downloads

Unreal-Netiquette

Donate for Oldunreal:
Donate

borderline

Links to our wiki:
Wiki

Walkthrough

Links

Tutorials

Unreal Reference

Usermaps

borderline

Contact us:
Submit News
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Flying players appear to fall when viewing from other clients (missing replication of bCanFly) (Read 225 times)
Masterkent
Developer Team
Offline



Posts: 1050
Location: Russia
Joined: Apr 5th, 2013
Gender: Male
Flying players appear to fall when viewing from other clients (missing replication of bCanFly)
Apr 4th, 2018 at 7:43pm
Print Post  
Issue #61. Flying players appear to fall when viewing from other clients (missing replication of bCanFly)

When players use state CheatFlying (implied by Fly/Ghost mode), PlayerFlying, or PlayerClimbing, they look falling while viewing from other clients. Setting bCanFly to true client-side helps to eliminate this issue (probably, client-side prediction relies on this property).

In case of Fly/Ghost mode, function BeginState of state CheatFlying changes player's bCanFly to True on the server and the player's client, but not on other clients.

Although the UScript replication for Pawn.bCanFly is defined as follows

Code
Select All
	unreliable if ( Role==ROLE_Authority )
		bCanFly; 


the native replication of this property works differently, as far as I can see (native replication overrules the UScript replication statements). I presume, currently it works as if the corresponding UScript replication statement was

Code
Select All
	unreliable if ( Role==ROLE_Authority && bNetOwner )
		bCanFly; 


In case of states PlayerFlying and PlayerClimbing, bCanFly is not changed automatically.

Suggested resolution:

1. Change the native replication of Pawn.bCanFly to match the current UScript replication statement:

Code
Select All
	unreliable if ( Role==ROLE_Authority )
		bCanFly; 


2. Change/add the definitions of functions BeginState and EndState in states PlayerFlying and PlayerClimbing as indicated below:

for state PlayerFlying:

Code
Select All
	function BeginState()
	{
		SetPhysics(PHYS_Flying);
		if  ( !IsAnimating() ) PlaySwimming();
+		bCanFly = true;
		//log("player flying");
	}
+
+	function EndState()
+	{
+		bCanFly = false;
+	}
 


for state PlayerClimbing:

Code
Select All
	function BeginState()
	{
		EyeHeight = BaseEyeHeight;
		SetPhysics(PHYS_Flying);
		if( Base!=None )
			SetBase(Level);
		PlayClimbing(false);
		if ( CarriedDecoration != None && Role==ROLE_Authority )
			DropDecoration();
+		bCanFly = true;
	}
	function EndState()
	{
		WalkBob = vect(0,0,0);
		ActiveLadder = None;
		bIsWalking = false;
+		bCanFly = false;
	}
 

  
Back to top
 
IP Logged
 
Smirftsch
Forum Administrator
*****
Offline



Posts: 7702
Location: at home
Joined: Apr 30th, 1998
Gender: Male
Re: Flying players appear to fall when viewing from other clients (missing replication of bCanFly)
Reply #1 - May 16th, 2018 at 8:19am
Print Post  
ok, added UScript vars and changed native replication statement.
  

Sometimes you have to lose a fight to win the war.
Back to top
WWWICQ  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo