ALS-Refactored icon indicating copy to clipboard operation
ALS-Refactored copied to clipboard

Set Actor Location from Server doesn't always work until Player jumps?

Open xkamronx opened this issue 2 years ago • 7 comments

Not positive of the root cause at the moment.

I run Set Actor Location from the server when loading a player save. Many times, a client will join, it will run Set Actor Location, but it doesn't move the player until they jump. They can run around all over, but as long as they don't jump, it doesn't move them to the correct location.

I have Teleport checked in the Set Actor Location node.

Will test in a default project if needed, but should be reproduceable in a default project running from the server on begin play.

xkamronx avatar Nov 20 '23 19:11 xkamronx

I believe the issue could also stem from not running the function as reliable from the server side.

xkamronx avatar Nov 20 '23 20:11 xkamronx

I ended up just removing the teleport / set actor location nodes entirely and spawning the character at the location instead because it doesn't seem easily fixable - not positive what causes it to not accept the changed position until jumping, but causes a lot of gameplay issues (like the player being invisible to other players) and log spam of invalid movement timestamps.

xkamronx avatar Mar 20 '24 18:03 xkamronx

Where exactly are you calling the SetActorLocation() function from? I tried calling it from AAlsCharacter::BeginPlay() but didn't encounter any issues.

Sixze avatar Apr 21 '24 21:04 Sixze

Where exactly are you calling the SetActorLocation() function from? I tried calling it from AAlsCharacter::BeginPlay() but didn't encounter any issues.

It was being called during the begin play but a bit delayed during the character information load.

It could also be related to something else, as it appears to sometimes happen without using Teleport/SetLocation when spawning the actor directly at a location input (from Blueprint) and then the log spams a Timestamp error and most stuff is delayed / buggy. Relogging can fix it.

xkamronx avatar Apr 24 '24 19:04 xkamronx

Still can't reproduce, and I'm not sure if this problem is ALS related, since it doesn't control the character's location in most cases.

I'll probably close this issue until more details become available.

Sixze avatar Apr 27 '24 17:04 Sixze

Understandable.

I'm currently moving more towards the issue being "high ping" as in the 150-300 range causing more of these issues than anything else.

Simulating ping in the default project, it's very easy to get the Timestamp expired spam which causes a lot of other issues.

LogNetPlayerMovement: Warning: ServerMove: TimeStamp expired: 26.517168, CurrentTimeStamp: 28.438307, Character: BP_Player_C_0 LogNetPlayerMovement: Warning: ServerMove: TimeStamp expired: 26.517168, CurrentTimeStamp: 28.461296, Character: BP_Player_C_0 LogNetPlayerMovement: Warning: ServerMove: TimeStamp expired: 26.517168, CurrentTimeStamp: 28.498211, Character: BP_Player_C_0 LogNetPlayerMovement: Warning: CreateSavedMove: Hit limit of 96 saved moves (timing out or very bad ping?)

xkamronx avatar Apr 30 '24 22:04 xkamronx

Still haven't been able to find the cause and solution for the timestamp errors. Seems like a dice roll on whether a player joining a server / multiplayer session will get a good connection or not. If they don't, the timestamp errors flood the log until they reconnect and anything that is reliant on their location being accurate doesn't work.

Usually just leaving and rejoining that session will fix it.

My flow is player joins > controller gets location of their character from a save file > spawn actor using the transform from the save file on server > possess the spawned player.

xkamronx avatar May 31 '24 06:05 xkamronx