Smooth Sync: Sync your Transforms Smoothly across the network

@Ramasurinen
I’ll take a look at it tonight and get back to you tonight as well. Thanks for letting me know about it and for describing it well.

@Ramasurinen
OK, here’s some things that helped me.

Try turning NetPriority up in your Replication menu on your object that has Smooth Sync.

Try turning the SendRate down on SmoothSync. The default value of 30 a second is probably too high really (only sends if variables have changed though). I usually see around 15 sends a second as a good send rate. With a SendRate of 15 your InterpolationBackTime will be good at default but if you lower the SendRate to below 10, you’ll want to raise your InterpolationBackTime. Read the InterpolationBackTime mouse over details for more information.

Let me know how it goes.

If none of that helps, about how many objects with SmoothSync are you trying to sync?

@

Thank you for your prompt reply and your help.

I tried your settings changes, but unfortunately there was no improvement. The issue definitely seems to be tied to cpu load, or something internal to Unreal which is related to that. At the moment there are only two objects in my scene using smooth sync, my two playable characters, one on each machine.

Were you able to replicate the problem? Quickest way would probably be to throw down a landscape and load it up with a bunch of foliage. As soon as my client’s fps starts to waver between 58 and 60 smooth sync will drop out within 20 seconds. If it gets any lower than 55 fps then it just drops out immediately. Only when the machine can comfortably push far more than the 60 fps cap does it work perfectly all the time.

Thanks again for your assistance.

@Ramasurinen
I tested low fps by using “t.MaxFPS 30” in the console with the Third Person Template. I went down to 10 fps and didn’t see what you were seeing either. I was seeing some jitter at 10 but it’s probably expected at that point and it never got cut off.

I’m not sure what could be causing your issue. I’ll test with a bunch of foliage later and see if anything comes up and get back to you.

@

Thanks for giving it a go! I’ve sent you a PM with a video of the issue I’m seeing on my end. Maybe that will help.

Cheers!

@ It might be useful to know that 4.22.0 just dropped - Consider supporting this engine version ASAP.

@e3pojedi
Already submitted. It’ll be on the store whenever Epic gets around to approving it. It’s usually not more than a day or two though.

Hello! Thanks for this Plugin. I tested it and it worked great inside editor environment. However, when I created dedicated server from comand line using command: “C:\Program Files\Epic Games\UE_4.21\Engine\Binaries\Win64\UE4Editor.exe” “D:\NetWorkTutorials\NetWorkSyncTest\NetWorkSyncTest.uproject” /Game/ThirdPersonCPP/Maps/ThirdPersonExampleMap -server -log

I get the errors in server log:

Any ideas? Thanks!

edit: Errors are gone if I move the component from actor

@Frisco
I don’t see this issue when I use a fresh Third Person template and create a dedicated server from the command line in the way that you have.

/Script/SmoothSyncPlugin doesn’t look familiar. Did you move the plugin outside of the plugins folder it goes into when you download from the Marketplace? I’m not sure on the rules on moving plugins outside of that folder as other plugins seemed to break for me in the past from me doing this too. Try redownloading SmoothSync from the Marketplace but keep it where it downloads it to.

If you want to move it into your project or something, try copying over just the SmoothSync.h/cpp and State.h/cpp files. You may want to make these files first inside of your project then just copy over the content. Then change the SMOOTHSYNCPLUGIN_API near the top of the header files (.h) to whatever your project name is (just the SMOOTHSYNCPLUGIN part is your project name, then put the _API at the end of it). Make sure to keep the ALL CAPS for your project name even if it’s not in all caps when you made the project name.

Let me know how it goes.

@ does smooth sync support NPC’s? My project seems to be crashing every so often, but I don’t know what is the cause of it. Server travelling also causes a crash too.

@e3pojedi
Hmm. I don’t think I’ve ever tested character controllers that don’t have player controllers. I’ll test it out later today and get back to you. If it doesn’t work, I will definitely be supporting it once I fix it.

If you can give me a screenshot of the actor you are trying to sync and showing the components you have on it, that will help me try to replicate the issue too.

I get this error below. This occurs when the match ends via pressing escape (quitting) or changing levels, but only sometimes. I don’t know what triggers it to crash though, there’s no consistent way to trigger it.

"Access violation - code c0000005 (first/second chance not available)

UE4Editor_Engine!FPSCPool::Cleanup() [d:\build++ue4\sync\engine\source\runtime\engine\private\particles\worldpscpool.cpp:45]
UE4Editor_Engine!FWorldPSCPool::Cleanup() [d:\build++ue4\sync\engine\source\runtime\engine\private\particles\worldpscpool.cpp:246]
UE4Editor_Engine!UWorld::CleanupWorld() [d:\build++ue4\sync\engine\source\runtime\engine\private\world.cpp:3884]
UE4Editor_UnrealEd!UEditorEngine::TeardownPlaySession() [d:\build++ue4\sync\engine\source\editor\unrealed\private\playlevel.cpp:748]
UE4Editor_UnrealEd!UEditorEngine::EndPlayMap() [d:\build++ue4\sync\engine\source\editor\unrealed\private\playlevel.cpp:324]
UE4Editor_UnrealEd!UEditorEngine::Tick() [d:\build++ue4\sync\engine\source\editor\unrealed\private\editorengine.cpp:1992]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() [d:\build++ue4\sync\engine\source\editor\unrealed\private\unrealedengine.cpp:403]
UE4Editor!FEngineLoop::Tick() [d:\build++ue4\sync\engine\source\runtime\launch\private\launchengineloop.cpp:3699]
UE4Editor!GuardedMain() [d:\build++ue4\sync\engine\source\runtime\launch\private\launch.cpp:174]
UE4Editor!GuardedMainWrapper() [d:\build++ue4\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:145]
UE4Editor!WinMain() [d:\build++ue4\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:276]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283]
kernel32
ntdll"

Also, the image for the AI is attached - Are there too many components? @

Also just a note - If Smooth Sync is lagging, increase the bandwidth - Put this into your DefaultEngine.ini script. @Ramasurinen @

[/Script/Engine.GameNetworkManager]
TotalNetBandwidth=25600000
MaxDynamicBandwidth=12800000
MinDynamicBandwidth=10000000

[/Script/Engine.Player]
ConfiguredInternetSpeed=12800000
ConfiguredLanSpeed=12800000

@e3pojedi
There’s not too many components, I just wanted to see the actor you are trying to sync so I could try to recreate it on my end. Unfortunately when starting from the default VehicleAdvanced template and putting another car in the scene and having it drive without being controlled by a player, I was unable to recreate the issue.

I have no clue what that crash message could be. Nothing Smooth Sync related pops up in your crash message?

Maybe try taking SmoothSync off and switch to Unreal’s “Replicate Movement” to see if you get the same crash?
Maybe try going back to the default VehicleAdvanced template and copy over the smallest amount of things to try to get the issue to happen?
Let me know if you have any other tips on how to recreate the issue.

If you take off SmoothSync and turn on Replicate Movement and the crash doesn’t happen any more, you can send me your project in a PM or email and I can take a look at your exact scenario.

Thanks a bunch for the bandwidth tip! It wasn’t making sense why RPCs would stop otherwise.

I swapped the smooth sync to Unreal’s Movement Replication and level transitions worked, so it’s a problem with smooth sync.

I was able to replicate it in this project -Download the Vehicle Kart Template https://drive.google.com/open?id=0B9b7Gw4N64LCa2hGdDZsNExyY3M

1: Enable smooth sync plugin (Don’t put it on anything)
2: Go to the level blueprint
3: Add “OnBeginPlay” to a delay of 10 seconds and then the execute console command node and put in it “servertravel Map_Example”
4: Press Play In Editor options, add an extra player to make it multiplayer, and press play, then wait 10 seconds.

A solution ASAP would be fantastic, I’m planning to get my project completed within 2 weeks!

@

@e3pojedi
Ah, you are using Unreal 4.18. Unreal doesn’t let code plugins put out updates for versions earlier than the three latest versions of Unreal. I have messaged Unreal in the past about this because it seems kind of ridiculous but they gave me no response. I think I’m going to try again because it really is an insane policy.

I have PMed you a copy of the newest Smooth Sync files, I definitely had some null fixes between then and now. I think you can just copy over the SmoothSync and State scripts and then restart Unreal for the changes to take affect? Unreal is weird, I always had issues editing engine plugins.

Either way I’ll take a look at it to confirm myself, but I don’t have Unreal 4.18 so it might be until tomorrow when I respond.

@e3pojedi
When I use Karting Template 4.18 with SmoothSync not enabled, I still get the crashing issue on your level change.

“SetActiveLevelCollection attempted to use an out of date NetDriver: GameNetDriver”

is the error I get over and over right before it crashes.

I’m using UE 4.21.2, I just converted the template over to that version. I’ll give the plugin a shot now. @

Is the plugin you provided the same on the marketplace (because I am using that already)? I upgraded to 4.22.0 and the error is completely gone on my project, maybe that’s the issue? I really have no clue. @

@e3pojedi
Yes, the version I sent is the same that’s on the Marketplace. It all works now for you?