Smooth Sync: Sync your Transforms Smoothly across the network

Ahh! Silly of me. I was unchecking ‘replicates’ instead of ‘replicates movement’. Rookie error!

I do still notice some jittery movement for other clients who are with me on my boat/moving platform. I tried increasing the send rate for players and the boat to 60 but that doesn’t seem to have any impact sadly. I also have ‘scale’ set to NONE, but perhaps that is unnecessary (it doesn’t seem to be causing the issue anyway). They are all clients, currently running this using “Play As Client”.

Thanks again for the support :slight_smile:

@
Hello,
I am using smooth sync for vehicle replication and it is much much batter then replicating movement thanks to your component.

But I have few questions or i am just confused.

  1. Is data being send to client, even if client not owning vehicle ?
  2. If yes then can I disabled and enabled when needed ?
  3. If no then can it do position correction when vehicle is not controlled by client but set controller as owner only?
  4. How does it affect with net cull distance ? do i have to use “always relevant” for large map?

I’ve got kind of a funky issue I’d like to ask about in case it’s a bug or I just need to change my implementation.

I’m using 4.25 to develop a pvp space combat game in which the player can exit their ship’s cockpit and walk around inside their ship (by unpossessing the ship actor and possessing their player actor). I’ve noticed that when a client exits and then returns to the cockpit (repossessing the ship actor) the ship actor becomes completely desynced for about 10 seconds before “snapping” into position. The clientside ship will stop moving and not respond to input, but on the server the ship responds to inputs as if everything is normal. However, this seems to only happen if the player re-enters the cockpit within about 10 seconds.

Input is sent from the client to the server and then the ship moves serverside and that is synced back to the client. From what I’ve described does it sound like I’m using the plugin incorrectly or is that an issue where I’ll have to wait on a fix?

You probably need to attach the players to the ship or make them a child of the ship so that Smooth Sync will sync the relative position. You may need to use the setSceneComponentToSync to make sure Smooth Sync syncs the correct component.

Sorry, I don’t really understand the first few questions. Smooth Sync syncs from the Client associated with the PlayerController that owns whatever object Smooth Sync is on, to the Server and all other Clients. If there is no PlayerController in the hierarchy of the object then Smooth Sync will sync from the Server to all Clients since the object has no Client owner. If you are worried about handling ownership changes you can enable the “Sync Ownership Change” option which will include some extra info in the State info that Smooth Sync uses to seamlessly handle changing ownership.

Smooth Sync handles Net Cull Distance about how you would expect. It will stop sending and updating position if outside of the cull distance. Checking “always relevant” should work as expected to prevent the cull distance from being used.

I believe this is a bug that I just fixed but hasn’t been released yet. It should be fixed in the next release that I’m working on now.

That’s great to hear because I was worried I’d hit a total brick wall in development haha! Thanks for the reply!

Whats the proper way to teleport using smoothsync? When i do the below and teleport multiple vehicles back to starting position next to each other. Everything teleports but the client doesn’t see the server vehicle until it moves after the next round start. In other words the server vehicle is teleported and in the correct place but is invisible to the client until smoothsync starts syncing player movements again.

This runs only on owning client

void AVehicleBase::ClientTeleport_Implementation(AActor* Target)
{
  SmoothSync->teleport();   
  TeleportTo(Target->GetActorLocation(), Target->GetActorRotation());
     
}

Hi

@ Sorry in advance if there’s a dedicated support channel, I did not find any so I’m posting it here: I’m getting a 100% of this when spawning actor in Able ability systems’ editor window

LoginId:6410cc4148692ebf741a8b9898590f5c
EpicAccountId:76e2e33cc1b04510b570bfd150264ef0

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000148

UE4Editor_Engine
UE4Editor_SmoothSyncPlugin!USmoothSync::TickComponent() [D:\Build++Portal\Sync\LocalBuilds\PluginTemp\HostProject\Plugins\SmoothSyncPlugin\Source\SmoothSyncPlugin\Private\SmoothSync.cpp:809]
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Core
UE4Editor_Core
UE4Editor_Core
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_AbleEditor!FAbilityEditorViewportClient::Tick() [D:\Build++Portal\Sync\LocalBuilds\PluginTemp\HostProject\Plugins\Able\Source\AbleEditor\Private\AbilityEditor\ablAbilityEditorViewportClient.cpp:229]
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
kernel32
ntdll

Is it something that can be fixed on SmoothSync’s side? Thank you

You need to teleport on the client that has control. And you should call teleport() on SmoothSync after moving the object not before.

I’m not really familiar with Able Ability System, and Smooth Sync definitely wasn’t designed to support it. I can add some code to get that error message to stop being printed if that’s all you need, but I don’t know if Smooth Sync is going to have other issues with that plugin. I’ll at least get rid of that error message by the next release though.

Hi there, Sorry if this is a stupid question but how would I go about having the client experience smooth movement and just update the server with what it’s doing?

I am attempting to allow players to rotate a door by clicking on it and moving, this works fine server side and SmoothSync has really helped make the client side feel smoother but I am wondering if I could do this better, so the client doesn’t feel the network round trip every time they want to interact with a door.

Relatively new to networking so any detail on how to achieve this would be great!

Thank you for your time, Love the plugin!

Hi! Do me need change smoothsync settings on client or server? Example: change interpolation back time. Smoothsync own server or client?
and I have this error:
Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:G:\UE425Custom\Engine\Source\Runtime\Core\Public\Containers/Array.h] [Line: 674]
Array index out of bounds: 32 from an array of size 32

0x00007ffbb3ff4b59 KERNELBASE.dll!UnknownFunction []
0x00007ff655661c56 GhostNew.exe!UnknownFunction []
0x00007ff6556652f6 GhostNew.exe!UnknownFunction []
0x00007ff655425ccd GhostNew.exe!UnknownFunction []
0x00007ff655373bcb GhostNew.exe!UnknownFunction []
0x00007ff655374300 GhostNew.exe!UnknownFunction []
0x00007ff659c58ee8 GhostNew.exe!UnknownFunction []
0x00007ff654c0a0a8 GhostNew.exe!UnknownFunction []
0x00007ff654c0e5ef GhostNew.exe!UnknownFunction []
0x00007ff654c1522c GhostNew.exe!UnknownFunction []
0x00007ff65578f669 GhostNew.exe!UnknownFunction []
0x00007ff6559b1b76 GhostNew.exe!UnknownFunction []
0x00007ff6583bed4c GhostNew.exe!UnknownFunction []
0x00007ff6583bd471 GhostNew.exe!UnknownFunction []
0x00007ff65835233b GhostNew.exe!UnknownFunction []
0x00007ff658358e75 GhostNew.exe!UnknownFunction []
0x00007ff65835c140 GhostNew.exe!UnknownFunction []
0x00007ff65835c848 GhostNew.exe!UnknownFunction []
0x00007ff6586fb655 GhostNew.exe!UnknownFunction []
0x00007ff6586fcd5b GhostNew.exe!UnknownFunction []
0x00007ff6550a2beb GhostNew.exe!UnknownFunction []
0x00007ff65872fa2d GhostNew.exe!UnknownFunction []
0x00007ff655be273e GhostNew.exe!UnknownFunction []
0x00007ff658605904 GhostNew.exe!UnknownFunction []
0x00007ff65846e8c5 GhostNew.exe!UnknownFunction []
0x00007ff654b75050 GhostNew.exe!UnknownFunction []
0x00007ff654b8772c GhostNew.exe!UnknownFunction []
0x00007ff654b877ea GhostNew.exe!UnknownFunction []
0x00007ff654b98a80 GhostNew.exe!UnknownFunction []
0x00007ff659b849c2 GhostNew.exe!UnknownFunction []
0x00007ffbb5277034 KERNEL32.DLL!UnknownFunction []
0x00007ffbb6482651 ntdll.dll!UnknownFunction []
I wanna get smoothsync settings in server .txt files to client smoothsync

thank you!

Hey there,

We are using this plugin in our project and it has been working great but sometimes we get this crash when trying to load into the game and it seems to come up more and more often recently. I was wondering if you had any clues or could point us in the right direction?

Cheers,
Dan.

1 Like

I sent an email of the problem I’m having but just discovered this thread.
I updated the plugin for UE 4.26.2 and now when I attach items to my character they fly up into the sky and it looks like they are rotating around my character as if I’m inside a tornado. It worked great before I updated the plugin. Any ideas?

I think the smooth sync “Enable Smooth Sync” node doesn’t work because if I remove Smooth Sync component from my master BP the items attach like they should. Because I use that node to disable smooth sync and it doesn’t.

How I had it setup was after my items spawn to be attached I call to disable smooth sync and then I attach the item to the socket. That is how it used to work before this last update :frowning:

I can’t be totally sure but that looks an awful lot like it’s related to an issue that is fixed in the next release. So I recommend you update to that when it becomes available (I’m packaging it now) and let me know if you still experience the issue.

Sorry but Smooth Sync just isn’t really designed to work this way. You can get away with changing some settings at runtime but others need to be set at the start and can’t be changed. Interpolation Back Time and Send Rate really can’t be sanely changed at runtime, or at the very least you should make sure they have sane values at the start as they are used to calculate the buffer size for storing states.

These settings can be changed at runtime on the controlling client (or the server if not client controlled):
Send Rate**
Send Position Threshold
Send Rotation Threshold
Send Scale Threshold
Send Velocity Threshold
Send Angular Velocity Threshold
At Rest Position Threshold
At Rest Rotation Threshold

And these settings are used only on the non-controlling clients:
Interpolation Back Time**
Time Smoothing
Position Lerp Speed
Rotation Lerp Speed
Scale Lerp Speed
All the extrapolation settings
Received Position Threshold
Received Rotation Threshold
Position Snap Threshold
Rotation Snap Threshold
Scale Snap Threshold

Things you definitely should not change at runtime:
Any of the Sync Modes
Is Using Origin Rebasing
Always Send Origin
Sync Ownership Change

** Not really sure about these, change at runtime at your own risk. Make sure values are sane (not 0) at start.

You have two options:

  1. Give control of the door to the client that is interacting with it and you won’t have the input latency on the controlling client, and the movement would be synced to the server and all other non-controlling clients. The issue though is that you then need to switch who controls the door every time a player wants to interact and you definitely can’t have two players interacting with it at once.
  2. Some form of client-side prediction where you temporarily disable Smooth Sync on the client that is interacting with the door so that they can interact directly with no delay, while still sending the rpc to the server so that the action happens there and gets synced to everyone else. After the client is done interacting with the door you can re-enable Smooth Sync and it will go back to receiving the position from the server so the client will see if another client interacts with the door.

Hello,

Can you help me to understand how to setup this plugin in c++.
Did someone as an example how to setup the files ?
I have add “SmoothSyncPlugin” in Publicdependency in Build.cs
then in .h

class USmoothSync;

UPROPERTY()
USmoothSync* SmoothSyncPlug;

But in .cpp

#include “J:\UE_4.27\Engine\Plugins\Marketplace\SmoothSync\Source
SmoothSyncPlugin\Public\SmoothSyncPlugin.h”

SmoothSyncPlug = CreateDefaultSubobject(TEXT(“SmoothSyncPlugin”));

Visual studio give me type USmoothSync is not defined.

I have another question i am making a little tank game so i use smooth sync to replicate
the movement smoothly, the second phase of the project will be to make the turret turning
with the mouse cursor. When i finish with all calculation i will have some extra transform let’s
say “FVector turretPosition” is it possible to add this FVector to the smoothSync packet who is already replicating the position and rotation from the main base tank object ?

Thanks.