Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi there and hello everybody !

I am currently working on a project where we want to update an existing (rather old) professional Flight Simulator with a new visual system.

After evaluating different options we have the idea to use Microsoft FSX for that.

What we would do would be to feed the current data from our simulation (Bank,Pitch,Heading,Altitude,Position) into FSX via the FSUIPC interface.

Has anybody here in the forum done something like that before ?

Does anybody know if that might be possible with regards to performance - we would feed around 5 data updates/s into FSX.

Thanks a lot in advance !

Marcus

Posted

What we would do would be to feed the current data from our simulation (Bank,Pitch,Heading,Altitude,Position) into FSX via the FSUIPC interface.

Okay.

In fact you might even find it easier and more efficient these days to do it via the Lua plug-in interface. There are plenty of examples provided of both reading out values (display vals) and setting them (see below). There's even support for Luasocket built in, so you could drive it direct from an Ethernet connection using TCP, say.

Does anybody know if that might be possible with regards to performance - we would feed around 5 data updates/s into FSX.

5 Hz should be very easily accomplished. One would hope for something more like normal frame rates, i.e. 20 Hz.

Try the supplied Lua plug-ins which link two networked PCs both with FSX installed (actually one or both could be FS9), one as Master the other as Slave. The Lua plug-ins are "SlaveServer" and "MasterClient", and don't need much configuring -- only the name or IP address of the Server in both. I've got good results at up to 20 fps with those.

Regards

Pete

Posted

Hi Pete,

one additional question: Am I right that LUA is sort of a Sub-plugin utilizing FSUIPC as a lower layer ?

I am just asking because I am not a big fan of scripting languages - I woud prefer using C# with .NET or ANSI C as I do have plenty of experience with those languages.

I suppose the performance and handling would be the same using any other language to access FSUIPC and FSX.

The update rate is giving by the data rate we get out of our simulator. The rate is around 5-10 updates per second. However, FSX itself should do sort of an interpolation between our updates as the the "plane" inside FSX is flying, too.

Marcus

Posted

one additional question: Am I right that LUA is sort of a Sub-plugin utilizing FSUIPC as a lower layer ?

Lua is a programming language used by a lot of programs for customisation and plug-in options. Please see the details in the brief documentation available in the "Lua Plug-ins.Zip" package -- it is installed with FSUIPC or available in the Updates and Other Goodies announcement at the top of this Forum.

I am just asking because I am not a big fan of scripting languages

Your choice. I was only suggesting it because one end of your possible TCP/IP link is already done in the demo "slave" Lua program I mentioned.

- I woud prefer using C# with .NET or ANSI C as I do have plenty of experience with those languages.

I suppose the performance and handling would be the same using any other language to access FSUIPC and FSX.

Not quite. The Lua plug-in route has the advantage of being a thread within the FSX process, so there's no process switching. Multithreading is much more efficient.

The idea of the Lua plug-in part isn't to become a large program in any case. It would just be doing the FSX control for you. You interface to the plug-in, whether locally or remotely, in any case with whatever large C/C++ project you wanted to do.

(I am a .NET Managed language hater BTW! I'd prefer Assembly Language if it were productively feasible in today's over-complex systems, but as it is I use a little Assembly here and there and the rest is C, not even C++.)

The update rate is giving by the data rate we get out of our simulator. The rate is around 5-10 updates per second. However, FSX itself should do sort of an interpolation between our updates as the the "plane" inside FSX is flying, too.

I'm afraid it doesn't . If you want it to look smooth you'd certainly need to interpolate between your values to bring the rate up to nearer 20, really 15 at minimum, depending on the aircraft speed of course. If it's a slower aircraft you could get away with less. If it's a fighter or stunt aircraft you'd probably need 25 to 30.

If, instead, you wanted FSX to fly the aircraft you'd really need to supply it with a very very detailed flight plan and fly on autopilot and autothrottle, perhaps manipulating those parameters too.

Regards

Pete

Posted

Hi Pete,

thanks again for the info.

I will have a look at LUA plugins, maybe that saves me some work.

I think the best choice regarding the programming language will be plain ANSI C.

Regarding .NET: While I am working with C now for 25 years I have already done large, complicated projects with teams of up to 10 developers.

In such an environment managed code and object oriented development has got some big advantages ...

I will see what will be the best way to reach sufficient frame rates. As we only simulate a piston twin speed is not such a big issue for us.

Thanks again for your quick replies.

Marcus

Posted

Regarding .NET: While I am working with C now for 25 years I have already done large, complicated projects with teams of up to 10 developers.

In such an environment managed code and object oriented development has got some big advantages ...

Yes, of course. I understand that. It's just that I come from more of an engineering background, and when I managed departments of up to 30 or 40 programmers we were working on development and diagnostic test suites for mainframes and minicomputers, as well as simulators to test them on. I started when there were still computers in our Bureau using valves and mercury delay line memories! ;-)

The "bottom up", "don't trust software if you don't know what it is doing" mentality became rather engrained! I'm not likely to change now, at 66! ;-)

Regards

Pete

  • 3 weeks later...
Posted

Hi Pete,

in the meantime I have finished the software that reads out the data from our old simulator.

We get all the parameters with a framerate of 20 fps which is pretty good and means we do not need any interpolation.

To start I have simply taken your SlaveServer.lua (unchanged). I am writing the data directly on a TCP socket I am creating in my programm.

With this approach I was able to have a pretty good result within around one hour of programming :D

However, a few questions remain:

- To avoid flickering of the screen I need to pause the FSX while feeding it with data. While that is no general problem I always have the "Press "P" to continue" message o n the screen. Is there any more elegant way to do that without pausing the simulation ?

- Sometimes the LUA plugin stops processing the data. I can reconnect and even restart the plugin and it does react (it pauses when I close the client end) but the FSX does not show anything.

Any ideas regarding these questions ?

Thanks in advance, Marcus

Posted

- To avoid flickering of the screen I need to pause the FSX while feeding it with data. While that is no general problem I always have the "Press "P" to continue" message o n the screen. Is there any more elegant way to do that without pausing the simulation ?

You can set parameters in the FS CFG file to remove such messages. You shouldn't really get flickering anyway, but an alternative is to use Slew mode, again with the on-screen message inhibited.

- Sometimes the LUA plugin stops processing the data. I can reconnect and even restart the plugin and it does react (it pauses when I close the client end) but the FSX does not show anything.

Sorry, I don't know why it should stop processing it. You'll need to apply some debugging to see why. Is it still running? Has there been some sort of network glitch?

Regards

Pete

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.