Jump to content
The simFlight Network Forums

Want to control simulator from external stream


Recommended Posts

Hello,

My main question is: does FSUIPC provide a method for controlling the motion of the simulator (e.g., control or "slew" inputs). If so, are there advantages for using it instead of the "FSR" (Flight Video) format that Microsoft provides (as documented in the "Netpipes SDK")?

I'm also looking for advice/suggestions from anyone that could help me in my effort, which I describe below:

I've been playing with the "FSR" format in order to get the simulator to "play back" a flight recorded on a GPS. I currently have a rudimentary translator from NMEA to FSR, but the simulator is behaving badly when fed these files -- there are many parameters I'm leaving out, and Microsoft even directly suggests this should be OK (e.g., the simulator will figure out appropriate values for the missing parameters). Perhaps needless to say, it's tedious to debug!

All I have is the stream of time/coordinates/altitude. I can also get heading and speed from the GPS. I'd like to feed this info to the simulator and have it "fly" the course, with it doing as much of the work as it can (such as calculating the appropriate bank angle, engine settings, etc.) Again, Microsoft seems to imply that the simulator will do this, but the evidence doesn't show that.

Perhaps I should use a pure "slew" mode (at least at first), since all I really want to do is to "play back" the GPS track, and have it realized in a visual way. Perhaps actually "flying" the track is not a reasonable goal. In any case, is there a way to access the "slew" mode internally? Could I control the time/lat/lon/alt/hdg by doing this?

Thanks ahead for any useful feedback!

Link to comment
Share on other sites

My main question is: does FSUIPC provide a method for controlling the motion of the simulator (e.g., control or "slew" inputs). If so, are there advantages for using it instead of the "FSR" (Flight Video) format that Microsoft provides (as documented in the "Netpipes SDK")?

As documented in the FSUIPC SDK, you can set LLAPBH (Latitude, Longitude, Altitude, Pitch, Bank, Heading). In FS2002 and before the PBH could only be set in Pause, Slew, or zero-simulation rate modes. In FS2004 all six aspects can be set even in flight mode.

Whether this can result in a smoother and more "realistic" flight than the video method, I really have no idea. I don't know anyone who has done any comparisons. One this I know can't be done through FSUIPC, and that is controlling the airspeed directly. Maybe that's a deciding factor.

There is a third way, of course, and that is using the multiplayer interface to feed in the flight of another aircraft, and have the user's FS set in MP "observer" mode rather than in his own aircraft.

Perhaps I should use a pure "slew" mode (at least at first), since all I really want to do is to "play back" the GPS track, and have it realized in a visual way. Perhaps actually "flying" the track is not a reasonable goal. In any case, is there a way to access the "slew" mode internally? Could I control the time/lat/lon/alt/hdg by doing this?

If it is the visual path you want, then the facilities available in FSUIPC will do all that. Whether you use Slew mode or not would need to be a choice based on what you find, but as documented in the FSUIPC SDK you can switch that on and off through the interface.

I would not keep changing the time in FS, however. This could cause nasty pauses whilst things redraw. Best to set the start time (both Local and UTC or Zulu) then let FS update its time naturally with you keeping pace with the inputs.

For smoothness you'll want to interpolate values between your GPS readouts which are probably rather infrequent. Aim at at least 10 frames per second, ideally around 20. (18 corresponds to Windows "tick" time of 55 mSecs, so would be useful). Interpolation of Lat/Lon/Alt would be easier if you have the Ground Speed and Track values as well, but you would not be using either of those directly in FS.

Regards,

Pete

Link to comment
Share on other sites

I did have a quick play with flying the sim via FSUIPC a while back, and it all worked quite well.

I wrote a simple external flight model program that sent the LLAPBH to FS2004. You don't want to be in flight mode while doing this (even though it does work) because the sim gravity takes over in between FSUIPC updates which makes for a bumpy ride.

Running in paused or slew mode works just as well. I think I prefered paused mode.

Airspeed and VS were automatically calculated, but you'll have to provide engine values.

Mark

Link to comment
Share on other sites

Running in paused or slew mode works just as well. I think I prefered paused mode.

Only trouble with paused mode would be if you wanted the time to match -- or can you update the time in paused mode without the Sim doing any stupid things like reloading scenery/textures?

Airspeed and VS were automatically calculated

Now that's unexpected, and quite a bonus! Is this new in FS2004, because I thought the airspeed readout itself was one of the problems in FS2002?

Thanks,

Pete

Link to comment
Share on other sites

Pete,

Thanks so much for the helpful feedback!

Is there any diagnostic facility or other feedback from the sim available that I could use to help me to understand what it's doing with my Netpipes (FSR) data stream?

I can only imagine that some sort of debugging "back door" was left behind, to be activated by some registry or .ini entry.

Do you (or does anyone else) know of anything like this?

I'm quite sure that the sim doesn't like something about my FSR stream and is for the most part ignoring it. It sure would be good to have a hint...

Link to comment
Share on other sites

Is there any diagnostic facility or other feedback from the sim available that I could use to help me to understand what it's doing with my Netpipes (FSR) data stream?

Sorry, it is an area which I never studied. I took a quick glance at the NetPipes SDK when it first appeared, to see if had anything to make things easier for my implementations, found it didn't so put it aside.

Regards,

Pete

Link to comment
Share on other sites

  • 5 years later...
Ok, last question

Last question in this thread, after the previous entry which occurred over 5 years ago? sorry, i don't follow.

Pitch bank and Heading, are they INT or UINT's? from offset 0578 057C and 0580 ?

Daniel

Please refer to the offsets lists for their descriptions. It does say clearly that pitch and bank can be positive and negative, for different directions -- how would you accommodate signs in a UINT? And as far as headings are convcerned -- what do you think? Do you like negative headings? They are still meaningful (eg -6 = +354), but are not generally used. Please do read the actual write-ups.

And please use FSInterrogate to help you understand variables -- you can see how they behave in real time then.

Pete

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.