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=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to