Replies: 5 comments 4 replies
-
Just to clarify, assuming say 2 players, are they both operating the same aircraft, e.g. pilot and co-pilot and so need to see the exact same state on their PCs? Or are they flying their own individual aircraft? If they're flying their own aircraft, do you need to transmit more than the aircraft's pose (position and attitude), so that you can render the other player's aircraft in the virtual world correctly? |
Beta Was this translation helpful? Give feedback.
-
How are you keeping things in sync currently assuming no network issues? Do you forward, at 120Hz (default JSBSim sim rate), all the control inputs on PC-A which are fed into an instance of JSBSim on PC-A to simulate Aircraft-A, to PC-B via the server, where PC-B then feeds these control inputs into it's Aircraft-A JSBSim instance that it has running to mirror Aircraft-A? |
Beta Was this translation helpful? Give feedback.
-
So if there is say a 2s break in comms between PC-A and the server, one option would be to send a list/queue of the control inputs that were made by the user to the server, where the server could feed them into the JSBSim instance it's running to mirror Aircraft-A, faster than real-time to catch up. |
Beta Was this translation helpful? Give feedback.
-
I was thinking that the server in this case would pause simulation, no control input packet no simulation timestep for the particular aircraft, then when it received 2mins worth of inputs when the network connection was restored and play the 2min worth of inputs in a fraction of a second.
And what level of state, the full state including things like fuel state etc.? |
Beta Was this translation helpful? Give feedback.
-
What about all the other states? There are potentially a large number of states that you haven't included, here are just a couple off the top of my head.
Now if in your initial testing you've only had the first instance running for a couple of seconds, then took a snapshot, and then launched a new JSBSim instance, or update an existing instance that has been out of sync for a while and tried to initialize it the differences I mentioned above may not be that big a deal. But if there is a larger time period there will be. |
Beta Was this translation helpful? Give feedback.
-
I'm working on a project in Unreal Engine using JSBSim and I'm attempting to get it to work with multiple players. It's working fine, however in the case of a client/server desync, I'm not sure exactly what information I need to send the client from the server to correct its local simulation (and how best to do it). Is setting the position/rotation/velocity enough for the simulations to sync up again (assuming no wind)? And if so what is the best way to do that? Can I modify these values mid simulation or should I reset entirely with new initial conditions?
Beta Was this translation helpful? Give feedback.
All reactions