Hi
I just updated to 3.10.7R Pro from 2.5.4 Pro! (I know, big gap!)
I have noticed straight away that my tranforms across the network are much more jittery. I am using Network Transform, has this become the less prefered option now? (I see prediction but haven't looked into it yet) If it's still ok, can I share my settings to see if they look ok? Actually, the worst objects are both Client Authoritative and Synchronize Parent.
Many thanks
#Network Transform
64 messages · Page 1 of 1 (latest)
Hi, feel free to post screenshots of your setup and hopefully we can see if there's anything that's causing it. A Network Transform is still a preferred option for many use cases.
Thanks I will, in the meantime can I ask if i'm doing things right. I update the positions and rotations of objects on the server, its all done in normal Update(). I don't know if I should control my server's framerate or do anything with FN's time manager? What would you recommend is the best way to do this. I get the worst results viewing these objects as a client in VR which is pretty much steady at 72fps (especially rotations).
If you are moving the objects on the server, then the NT should be set to server auth, or the NOB should have no owner
Update is ok to use
I think the interpolation and extrapolation are probably set too high, but anyways are you using a rigidbody or character controller?
I simply update the position and rotation myself, I have my own physics algorithm. It's smooth as can be running standalone (i.e. not across a network). I had much better results before updating FN. I noticed a few new parts to NT like, Scale Threshold, Use Network Level of Detail, Componant Configuration.
Jitter can often be caused by having different parts fight for control of an object, for example physics running on the client and server. I'm not sure what could have changed between the versions specifically that started causing it though
I'll keep investigating today, hopefully improve things. For a slow moving and rotating object like a ship, what would be recommended (ball park) starting values for interpolation and extrapolation?
I think the default settings are usually sufficient. Setting them too high can cause more delay
As the new 'Use Network Level of Detail tick hides the old interval slider, is this level of detail defaulting to 1? where is it set?
It's clear from this mornings tests that a client on PC (hard wired to fast broadband) is fine, but a VR headset on wifi (not full bars) is struggling. I've always known this issue but it's definetly worse. Can we think of ways to improve where internet connection may be slower?
Because the network transform interpolates, the latency shouldn't matter 🤔
I guess that is why I had it so high to start with. Something has changed, I'll keep digging.
Should I be considering using the TimeManager instead of leaving everything free? My Server runs on Linux, and clients can join in either VR (Android) or PC. All moving objects use NT, and updates to positions etc (mostly on server) are done in Update(). I do not throttle or control framerates, but in the VR they are pretty stable at 72fps. Looks like the server is at 31 fps.
That could indeed save some performance
Looking in ServerManager should I lock off max framerate at 72? or leave free?
I would lock it at something so it doesn't waste cpu
ok, will add to my tests.
Do you have a guide on how to swap out Update() with the TimeManager method(s)?
I don't have a guide for it unfortunately, but basically you just subscribe to the tick method
I'll see if I can find some examples
Here's an example I grabbed from the CSP docs:
public override void OnStartNetwork()
{
base.OnStartNetwork();
base.TimeManager.OnTick += TimeManager_OnTick;
}
public override void OnStopNetwork()
{
base.OnStopNetwork();
if (base.TimeManager != null)
base.TimeManager.OnTick -= TimeManager_OnTick;
}
private void TimeManager_OnTick()
{ }
many thanks!
Just to clarify though (and I know it might not matter) I'm currently not using CSP
Yep, no problem there 🙂
Do I only need to do the OnStartNetwork & OnStopNetwork in one class or in each class I may use TimeManager_OnTick() ?
It's like the Start method
But it only runs once the object is fully initialized on the network
ok so in each class I may want to replace Update()
yep
👍
ok, looking at introducing Tick to replace Update() methods. Need some info... I put the above script in on the Server online 'game' and it reported an FPS that matched the ServerManager Framerate I had set. I was confused because I added a TimeManager and it's Tick Rate was 30. What is the relationship between the two, what is the recommendations in terms of helping smooth out my objects motions? Many thanks
What sort of FPS are you checknig?
I just put this script in my TimeManager_OnTick() method: if (timer < 1)
{
timer += Time.deltaTime;
fps += 1;
}
else
{
Debug.Log("Tick FPS: " + fps.ToString());
timer = 0;
fps = 0;
}
ah, could be the Time.deltatime?
Ah ok, you are using Time.deltaTime there
What should I use instead?
Try using TimeManager.TickDelta
ok.... thanks
Thats got it, I get 31 but close enough (probably order of the little script) anyway, as my key concern here is getting rid of jerky motion, should I try and match my VR headset framerate (72) or am i missing the point?
Hmm, so which motion is the problem one?
As covered at top of this thread, I'm using NT but noticed an increase in jerky motion after updating FN, just trying to improve things but flying blind with using Tick as opposed to Update() to change object positions and rotations on the server.
That's the part that confuses me a little, the jerky motion is only affecting objects moved by the server?
It also affects a few client auth objects like the Player(s) and their avatar parts.
So for a really simple example: a cube object being moved only on the server in the Update method with a network transform placed on it. Does it show up as moving smoothly on a client?
No it dosen't, positions will sometimes jump, and rotations are jerky.
I see. And this only happens on certain devices or with certain latency or frame rates?
Running a client on the pc is also jerky?
It's noticible on a fast PC with a good connection or on a VR headset with a wifi (sometimes not great) connection.
A good example is I connect with both, I used to be able to see myself on the PC Client waving from my VR client and it was smooth (or smooth enough) now the wave lags a bit or is jerky.
I can run it without VR, just using a PC client, things are obviously better due to faster internet but still visible.
For now I just want to know if it's worth replacing my Update() methods with TimeManager_OnTick() and if so what should I set as Tick rate and ServerManager Framerate.
It probably comes down to me not fully understanding what Tick Rate is.
I don't think that would solve it tbh
It sounds like the problem is being caused by something else
ok, so I'll focus my attention on the NT values and try and get things as smooth as I can. I'll also reduce the Server framerate to help performance.
thanks @mild vigil