News:

Precision Simulator update 10.188 (22 June 2026) is now available.
Navburo update 13 (23 November 2022) is now available.
NG FMC and More is released.

Main Menu

X-Plane linkage with PS13 broker

Started by Cedric Groux, Wed, 22 Jun 2011 18:38

Cedric Groux

Hi Mike and others,

As there seems to be out there some people interested in using X-Plane as scenery generator, this thread might help to join our forces...

Quote from: mikeindevonAs I understand the X-Plane SDK, you build a plug-in which has access to a large number of the sim variables. The plug-in gets called once each sim loop. I assume that you can feed in position (6 degs of freedom) and velocity and run the thing as a scenery generator.
That's correct. In addition, before being allowed to override the plane's orientation in X-Plane you need to disable the physics model (key sim/operation/override/override_planepath). X-Plane let you also to inject data for flaps, spoilers, gear, etc.. so the plane looks more alive.

Quote from: mikeindevonI have also seen elsewhere that there may be some differences in airport positions that have led to pilots in fly-ins landing on taxiways. Garry - your software seems to look after this.
Correct, airports are layed down differently in X-Plane than in PS1 and also differently from MSFS. One tricky thing with X-Plane are the sloped runways (and the fact that the threshold heights are not directly available from files). My current approach is to generate an offset.txt file to fix the runway alignment problem on PS1 side, and use code algorithms in the plugin to deal with altitude alignment.

To summarize what I did so far:
- Plugin is written in C++ and compilation with Gcc under Linux (Ubuntu).
- Connection with PS13 broker is working fine (a plugin menu allows IP/port configuration)
- Position & orientation are injected at the rate they are available from broker (no smoothing yet)
- Gear/flaps/spoilers are injected (smoothed)
- Code to generate the offset.txt exist but is far from perfect
- Code to deal with altitude alignement is under work

Just to give you an idea, here is how it looks like (with the plug-in setup window on the right). PS13 is running here using VirtualBox.


click on image for full-size

Now the bad news for that plugin... my free time has shrunk drastically following my promotion as a new father  ;) So if you Mike, or anyone else, is planning to develop such PS1 to X-Plane link and are interested in having access to the source code I wrote, just let me know. Of course, it's free, but in a not-finished state :-)

Cedric

mikeindevon

Hi Cedric,  cc Garry, Jeroen, others,

Yes, I would be very pleased to have a go at this and the offer of your source is most kind and welcome.  The screenshot is impressive.  Is all the work done in the x-plane plug-in or do you have an intermediate program to limit the risk of slowing up x-plane's loop?

I have the MS C++ pro compiler and run under Windows 7 but that shouldn't present me with a problem.

Timescale - will start now but progress will speed up in the autumn when there is less gardening to do!

Good luck with the fatherhood thing - writing C++ is easier !

Mike

Pierre Theillere

Hi, Cédric and Mike!

Wow, looks like you already had a good progress into the coding! I'm really interested in such a program, as (and maybe it's a bit of a challenge) to have a "M$-Windows"-less complete flight deck once PSx is released!
Shame there are offsets (to deal with) between different sims... as they should match one single real world!
Keep up the good work, and glad to see that this project has 2 brains!
Pierre, LFPG

Cedric Groux

Mike,

Ok, I will send you my project in the coming next days (just the time for me to put it back in a state where it compiles).

Quote from: mikeindevonIs all the work done in the x-plane plug-in or do you have an intermediate program to limit the risk of slowing up x-plane's loop?
All is done within the x-plane plug-in. The plug-in uses multi-threads. One thread in listening to the broker, in parallel to the flight-loop, so there is no slow-downs.

Quote from: mikeindevonGood luck with the fatherhood thing - writing C++ is easier !
Thanks, I fully agree with you  :D

Cedric

Cedric Groux

Hi Mike,

Here is the full code: X-Plane_visual_for_PS13

It is compiling and working on my linux platform. You will probably need to look at some Windows sample plug-ins to see how you need to set the compilation environment on your side. Note that on Linux, it must be compiled for 32-bits platform (and not 64-bits) because X-Plane is a 32-bits application.

As already mentioned, data transfer works globally fine. Most troubles and remaining work are due to the simulated world mis-alignments.
Previously, I had a separate program to generate the offset.txt file. Now it's all included in the plug-in... but the migration did not reached a stage where it is working again. So if you just compile and run, you will get no alignment, however the code is included. For your info, in file CAirportList.cpp, you will find the function ExportGoogleEarth that I found very usefull to debug the alignment.

Feel free to do whatever you want with that code. I am not trying to impose it and I won't feel bad if you don't use it. However, in case you decide to use it as starting base, maybe we could put the code on some source-sharing server (eg. SouceForge or anything similar) so we could add our efforts. I don't have much free time but for sure my enthusiasm is still very high ;-)

Pierre: thanks for your encouragements :-)

Feel free to contact me by mail (cetdric@grtoux.org <- remove the 2 't' letters) for any technical details of the code that might be beyond the scope of this forum.

Cedric

mikeindevon

Hi Cedric,

I really appreciate what you have given me, although I haven't looked at it yet.  I am sure with both our heads we can achieve something good.  I am fine on the algorithmic stuff, but not so experienced on TCP/IP and threads – but it seems you have done that bit already.

I'll have a look at the code over the next few days and get everything working on my platform.

I have sent you a mail so that you can pick up my address.

Best wishes,

Mike

Cedric Groux

This is not my intention to start another MSFS vs X-Plane debate ;)
... but I just came across a video presenting the default 744 that will be shipped with the next X-Plane version (v10).

http://www.youtube.com/watch?v=H6Ox--mzFok

Of course, the plane's systems are not expected to reach Precision Simulator level of details, but at least it looks nice for scenery generator purpose.

Cedric

Jeroen Hoppenbrouwers