Hmm. Thousands of objects in the warehouse but the player will only be interacting with 1 or two at a time. Would there be a way to use this plugin and optimize it so that it doesn’t send information for every object but instead only the objects that have moved? Because most of the objects won’t be moving on the server.
Correct me if I am misunderstanding, but with this plugin, physics can’t be simulated on both the client and server, but rather only by the server which then replicates the transforms and the client interpolates between them? Do you happen to know how that would perform as opposed to having a client and server simulation with the client correcting it’s object’s simulations?
@GuacFrog
You are correct, the physics will only be simulated by one system. It can be either the server or any client, but not more than one system at once. The position, rotation, etc. will then be interpolated on all other systems.
I’m not really sure how the other way would act unfortunately.
Thanks for the time you have taken to address my concerns. One last point that I want to stress to make sure that we are on the same page (last question I promise :D). You said it wouldn’t work for thousands of objects, but what if the players only interact with a single object at a time (ie moves a box around the warehouse) and occasionally throws a box which might move around a few more. Do you think this plugin is still not suited for a situation like that? Thanks again for the time you have taken to respond.
@GuacFrog
No problem at all, feel free to ask questions any time.
Smooth Sync won’t send any information across the network if actors are not moving, but I’m honestly not sure how it’ll fair. I’ve been meaning to try to figure out the limits for my Plugin anyway so I’ll take a look at it sometime this week and get back to you.
Upon further research, if the data being transmitted is compressed, I think this plugin should work for what I want to do. If this plugin is not transmitting data for every object UNLESS the object has moved, then it should work with thousands of objects so long as only a few of them move at once, right?
I’m going to purchase the plugin and give it a shot. I’l let you know how it goes.
I think maybe I understand what you meant by client prediction. For example, with this plugin, if the client were to push a cube that is simulated on the server, that client player would lag into the cube because of the delay, correct? And the fix would be client prediction?
In other words, this plugin is good for smoothing actors so long as the player doesn’t directly interact with those actors (ie pushing them)? For instance, a ball falling down a mountain would be smoothed well. However, a soccer ball that is being physics simulated on the server being pushed around by the client would not smooth properly with high ping.
I made a quick video demonstrating.
Here is another issue that might have to do with the problem. It seems like the original collision is getting left behind.
@GuacFrog
Keep in mind that compression will only work up to a certain number before it starts becoming inaccurate. I want to say it’s around 63,000 for half floats, which we use.
Maybe, but I’m not sure on Unreal’s limitations in just the general amount of objects that can be networked even when not moving. I know with the success of Fortnite they have been making huge strides in networking so it may work fine, but it may not.
Correct, it would not physics well and the fix would be client prediction.
You can try turning down the Smooth Sync InterpolationBackTime and raising the Smooth Sync LerpingSpeed variables though to get more reactivity. It should then be better in this regard but still not that great.
One other option may be to send an RPC to push it on the server when it collides on the local client, but I’m not sure of your game’s needs.
Correct. You may be able to send an RPC to move objects which would work for some games, but it wouldn’t react in real time locally like a game like Rocket League would. The rubber banding you see in a game like Rocket League is the result of the client becoming off from what the server thinks it should be so the client gets corrected.
Yes the first video is what I would expect from trying to physics collide with an object owned by one system and the other object owned by another system. Try lowering InterpolationBackTime and raising the LerpingSpeed variables though and it may act a bit better, but still not that great depending on what you need the box interaction for in your game.
The second video is pretty crazy though and not what I would expect from Smooth Sync, lol.
Is the box and the player both using Smooth Sync?
Would I be able to recreate this issue by using the ThirdPersonTemplate and adding a box to push around? Let me know if there’s anything else you did besides that to recreate the issue.
Let me know if I didn’t respond to anything or if you want more explanation on anything. Get back to me about that second video for sure and I’ll see what’s going wrong with Smooth Sync.
Interesting. I’m going to do some more tests and get back to you. A couple of questions regarding replicating physics simulations from server to client. 1) Do I have to explicitly disable client physics simulations on the actor after checking simulate physics? 2) Are there any other steps I should know about when doing this?
Regarding the second video, I believe that this is an Unreal problem and I am close to solving it.
@GuacFrog
I’m not really sure how Unreal does it specifically with networked objects if you are asking about that. Smooth Sync itself will set the velocity to zero every frame so it doesn’t interfere with Smooth Sync though.
Okay, here is a better example.
The following test was done with 150ms ping and 12 packet variance. The server is on the left and client on the right (ping is simulated).
Interpolation back time is 0.025, position/rotation lerp speed is 0.9, and send rate is 60. The player is NOT using smooth sync. Only the cube.
My basic goal is to get the player pushing the box without the major glitches. I’m okay with a few artifacts, but this is unplayable. Let me know what you think.
@GuacFrog
Is it better or worse when Smooth Sync is on the player? One other thing is to raise your TimeCorrectionSpeed, but it’ll start getting jittery at a certain point. You could try lowering the InterpolationBackTime and raising the Position Easing Speeds more too. It’s never going to be that great when doing physics if one system is determining the position and then physicsing into an object with a position determined by another system.
It looks like you are going inside of the box a lot. Maybe mess around with Unreal collision stuff so it does that less. You can also try sending an RPC over and moving the box on the server when you hit it on your client.
When putting smooth sync on the player, it keeps him from being able to push the box on the client. He can only barely nudge it. Not sure why this is.
@GuacFrog
Because the physics have to happen on the same system that determines the box position. In a game like Rocket League, the server determines the position of everything (with client prediction though so it seems like it’s not). If you hit it on the client, it’s not really hitting it on the server. Your client player would have to try to go into a position that it can’t because the box is there in order for it to hit on the server. I thought I made it clear that you wouldn’t be able to physics when two separate systems are trying to physics together. If you think not though, I’d be happy to offer a refund.
Sending an RPC to the server to move the box when you hit it on the client may work, but it depends on what you are trying to do for your game.
I do not want a refund. The plugin works well when applied to my player character (keeps him from jerking around). I think I will use this on my player and try to create a client prediction system for the physics actors in my game.
I apologize for the misunderstandings. I am quite new to replication. A quick note, you mention how you made it clear that physics can’t be enabled on both system, but I never had physics enabled on the client, only the server. And for some reason, the player has trouble pushing around a cube when the smooth sync is applied to him.
Thanks for the help, I appreciate it.
@GuacFrog
No problem, glad it’s working out a bit.
Physics can be enabled on both systems, Smooth Sync will just set the Velocity to 0 on ‘non-position setting systems’ and when trying to push things around physically, it’s not going to work right if one system is trying to push an object who’s position is determined by another system. Even if that functionality were to be turned off though, it wouldn’t help because it still tries to set the position every frame.
Basically my understanding of the whole situation is, the reason it doesn’t work is that in order to push the cube (position determined by server), your player (position determined by a client) would have to try to move into a position the cube is, but the player can’t because the cube is being set to the server position every frame. So the version of your client player on the server (position determined client) needs to physically bump into the cube but it can’t.
Version 1.23 is now up on the Marketplace.
**Change Log:
-**Fix for origin rebasing.
I also just submitted a version for Unreal 4.23 that I expect to be on the Marketplace sometime Monday.