Re: [Flightgear-devel] why jittering,use external fdm
--- tangyong wrote: Hi Curt, Just as you and Stuart said,the main reason of jittering is the inconsistent frame rate.But I find that if several FG clients connect to a local server ''fgms'',each client can see each other correctly and the flight is smooth,no jittering.Is there no fps varying when we use multiplayer function just like this: Player1 --multiplay=out,10,serveraddress,5002 --multiplay=in,10,myaddress,5002 --callsign=player1 Player2: --multiplay=out,10,serveraddress,5002 --multiplay=in,10,myaddress,5002 --callsign=player2 Then I modify the server to let it don't transmit Player2's velocity and acceleration data to Player1.I find that even I use a very low in/out frequency(1hz) in Player2 while the Player1's in/out =10hz,the Player2's flight still looks very smooth in Player1,no jittering.I don't see much changing than I use Player2's in/out=10hz,and transmit the velocity and acceleration data.why?what the difference bewteen them? Just to clarify your question: You want to know what the --generic I/O has a jitter problem but --multiplay doesn't? The simple reason is that the MP protocol code is clever and does various calculations to ensure that the aircraft smoothly interpolates from one position to another. In comparison, the generic protocol simply stuffs the values into the property tree. -Stuart ___ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] why jittering,use external fdm
--- tangyong wrote: Hi,everybody.I use these command lines to record a flight,then I replay it. Recording: fgfs --generic=file,out,20,flight.out,playback Playback: fgfs --generic=file,in,20,flight.out,playback --fdm=external but when I replay the flight record,I find the aircraft jittering,the flight is not smooth.why?And in the protocol playback.xml,it does record the aircraft's veolocities and positions etc.Since the position is only record at intervals ,does the FG use the velocity value to display aircraft in the meantime, between records. If FG does this,the flight and aircraft shuld not jitter.Can anybody tell me the reson? Hi Tanyong, As I recall (though I may be wrong), the playback.xml file doesn't include acceleration information, so the interpolation between data points will just be based on the velocities recorded, while the next data point will have more accurate position information that will reset the aircraft position. It is also the case that the FDM will cause subtle velocity and position effects that cannot simply be reduced to a number recorded every .05 of a second. This is most obvious on the ground when you are accelerating for take-off or decelerating for landing. You can reduce the effect of this by increasing the rate at which you take data points. Another reason for this occurring is when you are unable to record the data at the requested rate. For example, if you ask to record at 20Hz, but in fact your machine is only recording at 19Hz, when you come to replay your data at 20Hz there will be a discrepency between the position recorded and that resulting from the velocity of the previous frame. I don't know if we have a high-resolution timer in the properties tree, but it would be useful to record that in the .xml file to check the actual data recording rate. When I've used the playback system, I've tended to record at 20Hz, then play back at 40Hz. This seems to look more impressive from the outside. ;) Hope this is of some help. -Stuart ___ New Yahoo! Mail is the ultimate force in competitive emailing. Find out more at the Yahoo! Mail Championships. Plus: play games and win prizes. http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] why jittering,use external fdm
On 2/1/07, tangyong wrote: Hi,everybody.I use these command lines to record a flight,then I replay it. Recording: fgfs --generic=file,out,20,flight.out,playback Playback: fgfs --generic=file,in,20,flight.out,playback --fdm=external but when I replay the flight record,I find the aircraft jittering,the flight is not smooth.why?And in the protocol playback.xml,it does record the aircraft's veolocities and positions etc.Since the position is only record at intervals ,does the FG use the velocity value to display aircraft in the meantime, between records. If FG does this,the flight and aircraft shuld not jitter.Can anybody tell me the reson? I've never tried to play back data recorded with the generic protocol so I don't know all the issues, but Stuart makes some good points. Timing is very critical. Even though you specify an output rate, FlightGear isn't doing this in a separate independent thread (not that a thread would directly help the situation anyway.) FlightGear can only output data once at the end of drawing each frame of graphics. So as Stuart points out, if you are running at a somewhat inconsistent frame rate (let's say varying between 35-45 fps) and you can only output at the end of each frame, then the actual data intervals in your data file will jitter around substantially. Include sim time in your output and look at your dt between each record. I'm certain that the generic protocol makes no attempt to interpolate the incoming data in time. It just just plucks out the next record every 20 hz (or as close to that as it can get) and updates the view. So hear again if your playback frame rates are varying and FlightGear waits until at least 50ms has elapsed before fetching the next data packet, then any jitter at the recording stage is only going to be magnified at the playback stage. When dealing with external animation sources or playback, you *really* need to worry about locking FlightGear into a consistent frame rate (either with sync to vblank ... which is always a good idea ... and/or with the built in frame rate throttler code.) Note that all these mechanism can limit frame rates, but nothing can make FlightGear go faster (short of simplifying the graphics load or improving your hardware.) Take care to ensure you are running with exact, consistent frame rates, and your life will become a lot happier! Curt. -- Curtis Olson - University of Minnesota - FlightGear Project http://baron.flightgear.org/~curt/ http://www.humanfirst.umn.edu/ http://www.flightgear.org Unique text: 2f585eeea02e2c79d7b1d8c4963bae2d - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] why jittering,use external fdm
Hi Curt, Just as you and Stuart said,the main reason of jittering is the inconsistent frame rate.But I find that if several FG clients connect to a local server ''fgms'',each client can see each other correctly and the flight is smooth,no jittering.Is there no fps varying when we use multiplayer function just like this: Player1 --multiplay=out,10,serveraddress,5002 --multiplay=in,10,myaddress,5002 --callsign=player1 Player2: --multiplay=out,10,serveraddress,5002 --multiplay=in,10,myaddress,5002 --callsign=player2 Then I modify the server to let it don't transmit Player2's velocity and acceleration data to Player1.I find that even I use a very low in/out frequency(1hz) in Player2 while the Player1's in/out =10hz,the Player2's flight still looks very smooth in Player1,no jittering.I don't see much changing than I use Player2's in/out=10hz,and transmit the velocity and acceleration data.why?what the difference bewteen them? Best Regards, -Tangyong I've never tried to play back data recorded with the generic protocol so I don't know all the issues, but Stuart makes some good points. Timing is very critical. Even though you specify an output rate, FlightGear isn't doing this in a separate independent thread (not that a thread would directly help the situation anyway.) FlightGear can only output data once at the end of drawing each frame of graphics. So as Stuart points out, if you are running at a somewhat inconsistent frame rate (let's say varying between 35-45 fps) and you can only output at the end of each frame, then the actual data intervals in your data file will jitter around substantially. Include sim time in your output and look at your dt between each record. I'm certain that the generic protocol makes no attempt to interpolate the incoming data in time. It just just plucks out the next record every 20 hz (or as close to that as it can get) and updates the view. So hear again if your playback frame rates are varying and FlightGear waits until at least 50ms has elapsed before fetching the next data packet, then any jitter at the recording stage is only going to be magnified at the playback stage. When dealing with external animation sources or playback, you *really* need to worry about locking FlightGear into a consistent frame rate (either with sync to vblank ... which is always a good idea ... and/or with the built in frame rate throttler code.) Note that all these mechanism can limit frame rates, but nothing can make FlightGear go faster (short of simplifying the graphics load or improving your hardware.) Take care to ensure you are running with exact, consistent frame rates, and your life will become a lot happier! Curt. -- Curtis Olson - University of Minnesota - FlightGear Project http://baron.flightgear.org/~curt/ http://www.humanfirst.umn.edu/ http://www.flightgear.org Unique text: 2f585eeea02e2c79d7b1d8c4963bae2d 想加入吗?1.9亿用户正在使用网易邮箱 www.126.com - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel