Sending joystick inputs
Options
I'm sending joystick inputs using OnPhotonSerializeView(). I'm using a bit mask for the inputs so each send is a single integer. I'd like to run this at 30hz and have set PhotonNetwork.SendRate = 30; and PhotonNetwork.SerializationRate = 30;
The stream.IsWriting calls run like clockwork every .033 seconds. The stream reads calls in OnPhotonSerializeView() on the receiving end however are being batched together. I'm basically getting 5 aggregated batches per second. I get the first read after a .2 second delay from the last batch, then the rest of the reads in the batch follow after at .001 seconds each. So i'm basically getting a .2 second lag followed by a quick blast of the batched reads. This makes for a gittery mess of the controls that are looking for things like how long a button has been held down. I can run a timer to space out the batch reads that are happening to fast, but that's just adding more lag.
Is there a way to stop the batching? Is there a better way I can do any or all of this? I hoped by only sending a single integer per write i could get away with a higher send/receive rate. But, between the batching and my correction timer i'm seeing lag of up to a .35 seconds on the input.
The stream.IsWriting calls run like clockwork every .033 seconds. The stream reads calls in OnPhotonSerializeView() on the receiving end however are being batched together. I'm basically getting 5 aggregated batches per second. I get the first read after a .2 second delay from the last batch, then the rest of the reads in the batch follow after at .001 seconds each. So i'm basically getting a .2 second lag followed by a quick blast of the batched reads. This makes for a gittery mess of the controls that are looking for things like how long a button has been held down. I can run a timer to space out the batch reads that are happening to fast, but that's just adding more lag.
Is there a way to stop the batching? Is there a better way I can do any or all of this? I hoped by only sending a single integer per write i could get away with a higher send/receive rate. But, between the batching and my correction timer i'm seeing lag of up to a .35 seconds on the input.
0