High z-velocity by jumping on a decoration

Discussions about UT99
User avatar
Barbie
Godlike
Posts: 2393
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

High z-velocity by jumping on a decoration

Post by Barbie » Sun Jul 03, 2022 10:50 am

If you play on a server and jump up from a decoration (trash bin, barrel, ...) sometimes you get a very high positive velocity in z-axis. If there is an obstacle above you, you'll die at the crash. It happens for example always on MH-Dust2.Chest2 (see pic) or only sometimes, if you have shot the decoration before.
Is there any explanation for it?
MH-Dust2.Chest2
Show

Code: Select all

Begin Map
Begin Actor Class=Chest Name=Chest2
     Health=75000
     bAlwaysRelevant=True
     Level=LevelInfo'MyLevel.LevelInfo0'
     Tag="Chest"
     Base=LevelInfo'MyLevel.LevelInfo0'
     Region=(Zone=LevelInfo'MyLevel.LevelInfo0',iLeaf=2439,ZoneNumber=9)
     Location=(X=-5568.000000,Y=-976.000000,Z=-944.000000)
     OldLocation=(X=-5568.000000,Y=-976.000000,Z=-944.000000)
     bSelected=True
     bMovable=False
     Name="Chest2"
End Actor
End Map

Automatically merged

I made a minimal version of it (see attachment). After you have shot the chest, jumping on it is either not possible at all or you get damage. Happens even at local play. If you die, the message is "left a small crater". The log file does not contain any helpful.
You do not have the required permissions to view the files attached to this post.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett

User avatar
sektor2111
Godlike
Posts: 5871
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: High z-velocity by jumping on a decoration

Post by sektor2111 » Sun Jul 03, 2022 3:23 pm

Interesting find... I can recreate death stage all the time.
How To...
- get weapon or not;
- step away from decoration;
- start running at decoration;
- when you feel first step over it quickly press Jump Key = Instant Death.

Now I will want to check decoration class... :wtf: .

Edit: Nah... I think here is a problem... In PlayerPawn more exactly...

Code: Select all

function DoJump( optional float F )
{
	if ( CarriedDecoration != None )
		return;
	if ( !bIsCrouching && (Physics == PHYS_Walking) )
	{
		if ( !bUpdating )
			PlayOwnedSound(JumpSound, SLOT_Talk, 1.5, true, 1200, 1.0 );
		if ( (Level.Game != None) && (Level.Game.Difficulty > 0) )
			MakeNoise(0.1 * Level.Game.Difficulty);
		PlayInAir();
		if ( bCountJumps && (Role == ROLE_Authority) && (Inventory != None) )
			Inventory.OwnerJumped();
		Velocity.Z = JumpZ;
		if ( (Base != Level) && (Base != None) )
			Velocity.Z += Base.Velocity.Z; 
		SetPhysics(PHYS_Falling);
	}
}
Section capturing my attention...

Code: Select all

...
		if ( (Base != Level) && (Base != None) )
			Velocity.Z += Base.Velocity.Z; 
		SetPhysics(PHYS_Falling);
...
Based on my understanding:
If Player has a "Base" which is not the map, it will add a velocity on z copied from this base (which is Zero). And now the "side effect": Player has no velocity on Z but physics are changed to "Falling" resulting something interesting. If this is done faster, perhaps effect is boosted by other cute function...

For me this code looks stupid. You don't really check if that "Base" has a positive Z velocity but you are forcing a fall after adding ZERO velocity on Z for Jumper-boy.

Edit2: Everything works fine with this...

Code: Select all

....
if ( (Base != Level) && (Base != None && Base.Velocity.Z > 0) )
			Velocity.Z += Base.Velocity.Z;
		SetPhysics(PHYS_Falling);
Now I have to build another to do list for fixing server(s)...

User avatar
papercoffee
Godlike
Posts: 10140
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.

Re: High z-velocity by jumping on a decoration

Post by papercoffee » Sun Jul 03, 2022 5:54 pm

Do you know the book-riding?
step on a book and shot with a hit-scan weapon on it ... the book will fly up with you on top of it depending on the damage the book has taken the flight will be much higher.

User avatar
sektor2111
Godlike
Posts: 5871
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: High z-velocity by jumping on a decoration

Post by sektor2111 » Sun Jul 03, 2022 6:10 pm

I know book-riding, I think in the "fix" won't mess anything. But when decoration is "static" I could fall to the death whenever I wanted.
Anyway that logic of adding ZERO at Z velocity for me doesn't make any sense. Adding a velocity should happen if Z has valid data. I did a test again in Barbie's sample map... and I'm no longer having any issue...

The fix might have two options:
- conforming an Engine updated file;
_ or _
- replacing said function using XC_Engine.

Buggie
Godlike
Posts: 1483
Joined: Sat Mar 21, 2020 5:32 am

Re: High z-velocity by jumping on a decoration

Post by Buggie » Mon Jul 04, 2022 5:53 am

It is because this deco after shoot hold some Velocity.
This happen because Physics goes to Phys_Falling. But bMovable is false, so this "Falling" goes never end. So when you jump on it, it same as jump from fast falling deco. And you crash into it, since it not move in fact.

So as temp solution - walk over all bMovable = false on some interval and reset Velocity to zero.

Automatically merged

https://github.com/OldUnreal/UnrealTour ... issues/925