News:

Precision Simulator update 10.184 (15 September 2025) is now available.
Navburo update 13 (23 November 2022) is now available.
NG FMC and More is released.

Main Menu

Project PSXPL

Started by Raf, Sun, 30 Oct 2022 14:58

Raf

After weeks of coding, research, learning C++ and generally pulling my hair out trying to figure this out, I finally reached the point where I can call my little project feasible. I'm in the process of "merging" PSX and X-Plane 12, not just as a "windshield", but to allow X-Plane to render PSX screens in its 3D environment, with full and smooth 3D animation for every element from the landing gear and control surfaces to the last switch and a knob in the cockpit. Including VR. Full 2-way high speed communication and data exchange...

May I present you - Project PSXPL...

Let me just preface this by stating the obvious - that Hardys creation is simply the best 747 simulator software ever created for personal computers. It spoiled me, to the point where I don't even consider simming on anything else. Decades of development by Hardy, and thousands of other people - including many real 747 pilots contributed their time to make it as close to the real thing as possible. PSX is superior to pretty much everything else out there. It's stable, accurate and well... PRECISE :), the only thing it's lacking (in my opinion that is!) is full immersion. Yes, the 2D panels are nice and usable – they are perfect for home cockpit builders, but using them as an overlay on top of other sim is a bit cumbersome, and I think 3D environment would greatly improve the experience. I hope my little project will at the very the least keep PSX fan base growing (and increase revenue stream for Hardy  ;D  )

Before I can accomplish this, I had to find out if this is even possible – and as it turns out - IT IS! PSXPL consists of 2 elements - X-Plane 12 Plugin (and 3D aircraft model), and PSXPL control application. Both are written in C++. They require no extra runtime libraries, pure win32 API. Precision Flight Simulator is running in the background, PSXPL is intercepting/parsing/prepping communication to and from PSX and capturing PSX's video output. All this data is then sent to PSXPL X-Plane plugin via IPC (Inter-process communication) shared memory space. Basically X-Plane plugin and PSXPL share the same memory space in RAM to exchange data. It's insanely fast. X-Plane plugin then loads the data and applies it internally via the callbacks. The data is formatted in a way to minimize processing by the X-Plane plugin. All parsing, data and texture bitmap processing is done outside of X-Plane. X-Plane receives data that's "ready to go". This makes it run smooth. PSX runs normally in the background (it can by hidden/outside of the screen/behind other windows, but it cannot be minimized) with a special Layout that's 2048x1024 pixels and is designed to maximize the resolution of the captured elements. You only need one instance of PSX running to make it work.

Please check out the demo video, and like I said - this is just a proof-of-concept. The 3D cockpit you see is just a standard XP11 744 model, the only data received by X-Plane on that video is position data and video data for the screens. I'm planning to develop a custom 3D model, and interface every element with PSX. Performance, even at this early stage is great – and it's going to get even better as right now PSXPL Plugin is drawing ALL screens at the same speed, this is unnecessary – CDU screens don't have to refresh that fast, same with the lower EICAS. I will implement selectable FPS options for each screen. I will publish beta version for you guys to test once I get my own 3D assets ready.

-------------> LINK TO VIDEO




Bluestar

Very nice.  Please keep us updated.   
Grace and Peace,

Bode

Jeroen Hoppenbrouwers

The effect is really stunning.

Hoppie

Gary Oliver

Oh my this is very pleasing....

PSX in VR anyone :-) ?

jtsjc1

That looks great Raf.
Joe

Jeroen Hoppenbrouwers

Quote from: Gary Oliver on Sun, 30 Oct 2022 16:00Oh my this is very pleasing....

PSX in VR anyone :-) ?
Hear hear. And who doubts about touch screens?     :-)

Hardy Heinlin

Great work, Raf. Thank you!

The smoothness is really impressive.


Regards,

|-|ardy

Deki

Impressive! Keep going :-)

Ton van Bochove

Wow...that looks great! I already put X-plane 12 on the Mojave part of my HD after the experiments with X-view
Ton

Aleks

Amazing. And I thought I would not even consider XP12.

Will it also feed XP with weather from PSX, e.g. will it show that CB from wx radar in XP?
Perhaps that is another addon for XP.

I am still amazed with the video.

Raf

Thanks Hardy! Yeah to be honest I was surprised myself how smooth it is. PSXPL grabs and transfers 8,388,608 bytes (8MB) of bitmap every single frame. It's reusing the buffer, so it isn't consuming much RAM - right now the process is using about 9MB of memory and between 1-2% of the CPU. I'm experimenting with different ways of capturing PSX window, including DirectX. I'm planning to also put position/data sending and bitmap sending on different threads so they don't affect each other, as well as optimizing refresh rates for the screens inside X-Plane plugin for even more performance. Once I get a robust base I will start building the 3D mesh.

Quote from: Hardy Heinlin on Sun, 30 Oct 2022 16:56Great work, Raf. Thank you!

The smoothness is really impressive.


Regards,

|-|ardy

Raf

Weather injection is a must. At least a synchronized airport METAR, but I'd like to implement user selectable mode of operation (direction of injection PSX-> XP12 or XP12-> PSX). PSX has a way of injecting weather data, and can also provide weather data for XP. As for WX radar right now you'll see whatever is showing on the PSX screens, I need to dig into documentation more about the weather but I don't think you can inject details into PSX like a position of a single CB cloud. On the other hand XP12 is still in Beta, SDKs are still in Beta so I simply don't know. If XP12 would provide a simple way of getting radar data it would be totally possible to "draw" it on the texture.

 
Quote from: Aleks on Sun, 30 Oct 2022 18:36Amazing. And I thought I would not even consider XP12.

Will it also feed XP with weather from PSX, e.g. will it show that CB from wx radar in XP?
Perhaps that is another addon for XP.

I am still amazed with the video.

Will

Hmmmm, this is quite interesting. Sounds like you are running everything on one PC, right?

And what we're seeing is just an X-Plane cockpit, with PSX overlayed on the screens? What about the FMCs? Are those from PSX, or from X-Plane?

Also, how do you handle inputs? Like for example if we go up to the Overhead and use the mouse to click on a fuel pump switch, are we sending an input from X-Plane to PSX? Or straight to PSX?

Will /Chicago /USA

evaamo

This is pretty cool!  Are you using OpenGL to capture PSX's framebuffer and then using render-to-texture in XP12?

Some weeks ago, I was discussing options with a few guys to do something along the lines, but your solution looks very smooth compared to what I assume was going to be a performance-hungry implementation.

I have an xview replacement for XP12 done at 70%, I am waiting for LR to publish their weather API to move on. My plan was to re-use XP11's 744... but I think you're right that a 3D model will have to be done for scratch. Are you going commercial with this project, or do you plan go to open source and are open to collaborating?

Congrats, it looks awesome!

 
Enrique Vaamonde

Ton van Bochove

QuoteI have an xview replacement for XP12 done at 70%

I hope you go on with this remake of Xview. PSXPL looks very good but it is another setup than the current Xview I like very much.
Ton

Hardy Heinlin

Quote from: Raf on Sun, 30 Oct 2022 19:40... but I don't think you can inject details into PSX like a position of a single CB cloud.

Yes, you can. You can design weather details in SIGMET language. A large thunderstorm area may include randomized CB core positions, but if you make the respective SIGMET area smaller, the randomization also gets smaller. Here's an example:

https://aerowinx.com/board/index.php/topic,5007.msg54329.html#msg54329


Regards,

|-|ardy

Raf

Quote from: Hardy Heinlin on Mon, 31 Oct 2022 03:11Yes, you can. You can design weather details in SIGMET language. A large thunderstorm area may include randomized CB core positions, but if you make the respective SIGMET area smaller, the randomization also gets smaller. Here's an example:

https://aerowinx.com/board/index.php/topic,5007.msg54329.html#msg54329


Regards,

|-|ardy

Why am I NOT surprised this a thing with PSX  ;D. Excellent. So yeah if XP12 APIs would let me get the data, I don't see why that wouldn't work.

Raf

#17
Quote from: Will on Sun, 30 Oct 2022 21:29Hmmmm, this is quite interesting. Sounds like you are running everything on one PC, right?

And what we're seeing is just an X-Plane cockpit, with PSX overlayed on the screens? What about the FMCs? Are those from PSX, or from X-Plane?

Also, how do you handle inputs? Like for example if we go up to the Overhead and use the mouse to click on a fuel pump switch, are we sending an input from X-Plane to PSX? Or straight to PSX?



PSXPL will get the datarefs from X-Plane via the plugin the same way it sends the data to XP (IPC). Lets say you click on a button in 3D cockpit, that 3D element is an OBJ8 object with attached manipulator (see OBJ8 file format specification). When you click it (or drag it for rotary knobs) it changes the internal datarefs of X-Plane. X-Plane will handle 3D animation as well. My plugin will scan for changes and transfer that information to and from PSXPL, PSXPL will translate and send them to PSX. If you change something in PSX it will send the message to PSXPL, PSXPL will translate that again and send it to X-plane for the next dataref update. As far as performance - well I tested this too written by Lee C. Baker - DataRefTool (https://datareftool.com/). It scans AND DISPLAYS changes to the datarefs in XPlane in realtime. It handles over 10,000 datarefs (yeah ten thousand) without any issues with performance. If you decrease update frequency to 10Hz it's only about 4fps loss. For 10,000 datarefs! PSXPL will not need that many, and also will not need to draw any info on the screen, plugin will just dump it into memory for PSXPL to process. We are talking about pressing buttons here, how fast can you type on the CDU kayboard?  ;D I did the screens first as it sends massive amount of data, and if that didn't work the whole project would fail. User input data traffic is minuscule in comparison.

FMC and all other aspects of the simulation are handled by PSX only, that includes flight model as well. X-Plane physics engine is disabled when you run PSXPL.

Raf

Quote from: evaamo on Sun, 30 Oct 2022 21:44This is pretty cool!  Are you using OpenGL to capture PSX's framebuffer and then using render-to-texture in XP12?

Some weeks ago, I was discussing options with a few guys to do something along the lines, but your solution looks very smooth compared to what I assume was going to be a performance-hungry implementation.

I have an xview replacement for XP12 done at 70%, I am waiting for LR to publish their weather API to move on. My plan was to re-use XP11's 744... but I think you're right that a 3D model will have to be done for scratch. Are you going commercial with this project, or do you plan go to open source and are open to collaborating?

Congrats, it looks awesome!

 

Thanks! Right now I'm just using Win32 API to capture PSX. I'm still experimenting with other ways, but it looks like it won't make much difference on the performance level. The data will still need to go through the CPU/RAM anyway. I don't think direct GPU texture injection into X-Plane pipeline would be easily achievable.

New 3D assets are a must. XP11 747-400 3D model is a property of Laminar Research that's one. And two - modifying the existing OBJ8 is not as easy as you'd think. I only had to change the mapping of the panel texture for my demo, and that itself was a huge PITA. It's far easier just to create my own. On a good note: I have most of the cockpit elements done. See the pic below, those are just some my 3D CADs with dimensions taken directly from the real thing. It's just a matter of converting them to polys, dumping unnecessary faces and texturing.




Daniel Neugebauer

#19
I think I first came across PSX shortly after its release. Seeing it featured on Simfest's streams and watching britjets excellent training videos always made me want to get it but the lack of a virtual cockpit put me off (although the 2D panels are really nice, I just also prefer a 3D cockpit for immersion and building a home cockpit is not an option for me). I had many thoughts on implementing a VC integration myself for several years now but not having PSX meant I never could actually start having a look into it. Over the past weeks and after the idea come up repeatedly on a certain Discord channel (I'm one of the "few guys" evaamo mentioned :) ) I was finally "mentally ready" to buy PSX yesterday.

As it wouldn't make much sense to have 2-3 competing new implementations trying to achieve exactly the same goal (and even being worked on at the same time) I also wanted to ask if you would be open for collaboration? However, I'm currently trying to completely move away from Windows and thus would prefer a platform-independent implementation that's also able to just grab the PSX stream from another machine via LAN (I thought about running PSX in a Linux Docker container on a second machine and simply using VNC to capture the screens for X-Plane). Getting the screens into XP is probably the easiest part, synchronizing both simulators and coming up with some 3D model (and textures) for the cockpit will require a lot more time and effort. As that part could be fully platform-independent and holds lots of problems that need to be solved for any connector, it would certainly be better to try combining our efforts.