I'm developing a billiard game my problem is I don't know how can I sync balls in network
I use forge for networking but feel free to answer photon or unet because I know them.
#What I tried
What I tried
1.sending position and rotation of each ball in network
2.sending force direction and Intensity inside network
networkObject.SendRpc(RPC_SHOOT,Receivers.AllBuffered,force);
public override void Shoot(RpcArgs args)
{
Vector3 Force = args.GetNext<Vector3>();
GetComponent<Rigidbody>().AddForce(Force);
}
I don't know why but when I send force direction and Intensity in network sometimes Physics is different! I asked this question in forge forum and they tell me:
It's non-deterministic It's how most physics simulations work Because of floating point inaccuracies and different CPU architectures and a whole load of other factors That's how PhysX works Well PhysX is technically deterministic for the same inputs But all inputs have to be identical
#source is available: