OldUnreal / UnrealTournamentPatches

Other
967 stars 29 forks source link

[469c] Animation glitches after throwing the same weapon twice #1196

Open w0ss4g3 opened 1 year ago

w0ss4g3 commented 1 year ago

The animation when throwing a weapon on the first occurrence is smooth. If you pick up the weapon again and throw it, it will be unsmooth/jagged. This also seems to apply to weapons being dropped when a player dies.

The only appears to apply to dedicated servers - offline remains smooth after many drop/pickups.

Steps to reproduce on multiplayer server:

  1. Throw weapon once
  2. Pickup weapon
  3. Throw weapon again.

Think this happens in 436 too.

Thanks

w0ss4g3 commented 1 year ago

Video showing the behaviour. https://www.youtube.com/watch?v=N4f8vJfursM

SeriousBuggie commented 1 year ago

Not found anything unusual in weapon actor state/properties. There present base and velocity after pickup, but if it clean in BecomeItem - issue not resolved. Look like issue related to native side state, not unrealscript state.

SeriousBuggie commented 1 year ago

Also in bugged drop I see flicker weapon in small view in different places on screen. img img img And it update position really slow, Once per few frames. img On this sshots showed one same drop.

I think it is render issue based on some internal things,

stijn-volckaert commented 1 year ago

We're going to start testing a fix for this in 469d. Here's some context on this problem:

Initial state:
- Player is holding a weapon. The weapon's RemoteRole is ROLE_SimulatedProxy. That means the client will simulate any changes in weapon physics on the client side

Player throws weapon:
- Server calls Botpack.TournamentWeapon.DropFrom. This changes the weapon's physics to PHYS_Falling, the RemoteRole to ROLE_DumbProxy, and bSimFall to true. 
- While bSimFall is true, the server replicates changes in the Weapon's Physics/Acceleration/bBounce properties to the client
- In this case, the server tells the client the weapon has started falling
- The client then simulates the fall locally

Weapon lands on the floor:
- Server calls Botpack.TournamentWeapon.Pickup.Landed and changes bSimFall to false. This means the server will no longer replicate the weapon's Physics/Acceleration/bBounce properties to the client
- Because of this, the server does not tell the client that the Physics of the weapon are now PHYS_None
- The client has simulated the fall though, so the client knows the Physics are PHYS_None

Player picks up dropped weapon:
- Server calls Engine.Inventory.BecomeItem. The RemoteRole goes back to ROLE_SimulatedProxy. Physics are still PHYS_None

Player throws the weapon again:
- Another call to Botpack.TournamentWeapon.DropFrom. Physics change to PHYS_Falling again on the server, but the server is too stupid to realize that it needs to inform the client
- Why? Because the last time the server thought the Physics property was relevant to the client, the weapon was also falling
SeriousBuggie commented 8 months ago

Issue still happen on 469d (e preview):

https://github.com/OldUnreal/UnrealTournamentPatches/assets/70026933/ffb30ed3-cf0e-4522-a70d-73567af9e6b3

Some weapons drop with lags. Some weapons drop as small size, until not reach ground.

It much less from what be before, but still, not what feel like expected.