News:

Precision Simulator update 10.180 (14 October 2024) is now available.
Navburo update 13 (23 November 2022) is now available.
NG FMC and More is released.

Main Menu

PSX.NET P3D ExternalSim

Started by Mark, Fri, 17 Jun 2016 13:05

Mark

Hi all,

As some of you will know; I've been working on an ExternalSim plugin for P3D. This effectively replaces the aircraft aerodynamics modelling in P3D with my own model that uses angle and velocity data directly from PSX to deliver silky smooth stutter-free movement. It supports multiple P3D instances and works nicely alongside the new View Group functionality in the latest P3D version to make multi-projector setups much easier.

We've been using this on the Simfest UK simulator and have worked out most of the bugs so I'm now happy to release a version to the community to try.

This is not as easy to set up as VisualPSX and is missing a couple of useful VisualPSX features (runway offsets) so if you're not the kind of person to live on the cutting edge, please don't install this!

System requirements:
-Windows 7/8/10
- .NET 4.5.1
- P3D 3.3.5 or higher
- PSX 10.0.8 or higher

PDF instructions on installation and usage are contained within the ZIP file.

One thing I haven't yet put in the instructions:

When loading a situation that starts on the ground, you'll notice the visuals will take a while to settle due to PSX receiving a ground elevation value from P3D and slowly slewing to correct. My recommendation, once it has settled, is to re-save the situation file. This has the effect of changing this parameter in the situation file:
Elev=-999999
to
Elev=2890
(Basic 003 - On ground and cleared for engine start.situ)

This will ensure the next time you load the situation, it'll be in the right place immediately.

Download link:
PSX.NET.P3D.ExternalSim 2.5.0
If you successfully use this in your sim, please post and let me know! This gives me an idea of how many people are using it.

Please write any feedback/feature requests/bug reports in this thread.

-Mark

Older versions:
PSX.NET.P3D.ExternalSim 2.4.0
PSX.NET.P3D.ExternalSim 2.3.0
PSX.NET.P3D.ExternalSim 2.2.0
PSX.NET.P3D.ExternalSim 2.1.1
PSX.NET.P3D.ExternalSim 2.1.0
PSX.NET.P3D.ExternalSim 2.0.0

Ivo de Colfmaker

Hi Mark.
I get this when clicking on the link

https://goo.gl/5S2Njy – this goo.gl shortlink has been disabled. It was found to be violating our Terms of Service. Click here and here for more information about our terms and policies respectively.

Ivo
A day at this forum is a day learned!

Mark

Hi Ivo,

I've edited my post with a new link, please try it.

-Mark


Ivo de Colfmaker

Hi mark,
ok now.
gonna look at it tomorow, thanks very much
ivo
A day at this forum is a day learned!

kiek

#4
Hi Mark,
I've installed your software (thx!) according to the instructions (I believe...), and the router is showing (normal?) numbers, see below:



However, in P3D my 747 is somewhere in an Ocean (in situ Basic 003 ...) , and every 3 seconds it looks like it loads terrain again (in a split second). When I try to load a situ with the 747 in cruize, I get repeated loading of Terrain, until P3D gets stuck at a certain percentage, or P3D crashes...

What am I doing wrong, you think?

Note that I have P3D (v3.3.5) at one computer, and PSX and the router at another.

EDIT: Contrary to Ivo below, I have only one livery in my aircraft.cfg file.

Regards,
Nico

Ivo de Colfmaker

#5
i have the same problem as Nico, also PSX and P3D on 2 different pc's
also in the ocean, only i see no plane, only a small bit of the overhead
Subscribed elevation models stays at zero
attached a piece of my aircraft.cfg

[fltsim.0]
title=Boeing 747-400 KLM
ExternalSimID = {3E6B47E7-C706-4A10-BC88-6E7C199ED5A6}
ExternalSimData = 75, 75, 100
ExternalSimModule = PSX.NET.P3D.ExternalSim.dll

sim=Boeing747-400
model=
panel=
sound=
texture=klm
kb_checklists=Boeing747-400_check
kb_reference=Boeing747-400_ref
atc_id=PH-BFB
atc_airline=Boeing
atc_flight_number=1123
atc_heavy=1
ui_manufacturer="Boeing"
ui_type="747-400"
ui_variation=KLM
ui_typerole="Commercial Airliner"
ui_createdby="Microsoft Corporation"
description="Standard FSX 747-400 plane."

[fltsim.1]
title=Boeing 747-400 MARTINAIR
sim=Boeing747-400
model=
panel=
sound=
texture=MAR
kb_checklists=Boeing747-400_check
kb_reference=Boeing747-400_ref
atc_id=PH-MAR
atc_airline=Boeing
atc_flight_number=1123
atc_heavy=1
ui_manufacturer="Boeing"
ui_type="747-400"
ui_variation=Martinair
ui_typerole="Commercial Airliner"
ui_createdby="Microsoft Corporation"
description="Standard FSX 747-400 plane."

[fltsim.2]
title=Boeing 747-400 British Airways
sim=Boeing747-400
model=
panel=
sound=
texture=BA
kb_checklists=Boeing747-400_check
kb_reference=Boeing747-400_ref
atc_id=G-CIVE
atc_airline=British Airways
atc_flight_number=BA117
atc_heavy=1
ui_manufacturer="Boeing"
ui_type="747-400"
ui_variation=British Airways
ui_typerole="Commercial Airliner"
ui_createdby="Microsoft Corporation"
description="Standard FSX 747-400 plane."

[General]
atc_type=BOEING
atc_model=B744
editable=0
performance="Cruise Speed\n0.85 Mach         565 mph         910 km\/h\n\nEngine options\nPratt & Whitney PW4062\nRolls-Royce RB211-524H\nGeneral Electric CF6-80C2B5F\n\nMaximum Range\n7,325 nm         13,570 km\n\nMaximum Certified Operating Altitude              45,100 ft          13,747 m\n\nFuel Capacity\n57,285 gal       216,840 L\n\nBasic Empty Weight\n394,088 lb    178,755 kg\n\nMax Gross Weight                        875,000 lb       396,893 kg\n\nLength\n231 ft, 10 in       70.6 m\n\nWingspan\n211 ft, 5 in         64.4 m\n\nHeight\n63 ft, 8 in         19.4 m\n\nSeating Typical 3-class configuration - 416\nTypical 2-class configuration - 524"
Category =externalsim



A day at this forum is a day learned!

Mark

Nico:

Your numbers are looking good, meaning you've got full bidirectional communication established and the external sim is running so the aircraft.cfg is correct.
(For future reference: I can tell this by the fact that 'Subscribed ElevationModels' is increasing - this means P3D, running the external sim, is sending data back to the Router.)

You said: "Note that I have P3D (v3.3.5) at one computer, and PSX and the router at another."
I've just downloaded the exact link I put up and used the files to replicate your setup on 2 computers and it all works.

Do you have any other Simconnect clients?

Edit: I've just had a thought that this could be a one-sided firewall issue - packets are getting from ExternalSim to Router, but not from Router to ExternalSim. Try temporarily turning off any firewalls on both PCs.

Ivo:

2 possibilities for you:

1. External sim is not running. As you've got multiple livery in your config file, consider copying the 3 'ExternalSim' config lines to all livery.
2. Perhaps a firewall issue, Windows firewall is preventing communication? Try temporarily turning off any firewalls on both PCs and see see if 'Subscribed ElevationModels' starts increasing.

Chris Kilroy

Mark,

I did a quick and dirty test run with ExternalSim on my center image channel this evening and all I can say is WOW!  :o The performance is absolutely fantastic. Silky smooth without even so much as the thought of a stutter. I can hardly wait to jump back in tomorrow to get my side channels set up and start tweaking P3D to see just how amazing it has the potential to look.

Thanks for your work on this, and for giving it to the rest of us to enjoy!

kiek

#8
Quote from: Mark on Fri, 17 Jun 2016 20:48
Your numbers are looking good, meaning you've got full bidirectional communication established and the external sim is running so the aircraft.cfg is correct.
bidirectional: does not that imply that there is no Firewall problem?
EDIT: I've explicitly opened up tcp ports 10760 and 10761 in both Zone Alarm fire walls, but no luck...
EDIT: I've switched off both Firewalls and both Windows Firewalls: no luck ...  :(

Quote from: Mark on Fri, 17 Jun 2016 20:48
Nico:
Do you have any other Simconnect clients?
Yes I have: VisualPSX, PSXseeconTraffic and PSXseeconvPilot are using SimConnect. But none of these are running in my testing of your software.
Is your program using SimConnect???

Greg Hateley

Hi Mark,
Thank you!
Just flew a couple of test flights to my usual airports.
Works very well and very VERY smooth.
Still working on getting the eyepoint correct.
Cheers
Greg

GodAtum

Thank you for creating this :) How long should the visuals take to settle, I've been sitting here for 10 minutes? The recieved boot, psx and published flightmodel values are increasing. Subscribed elevation model = 0. PSX elevation update = 1. Plane is in correct airport.

I use the 2D cockpit view without panels, what view do you use for your sim and what values do you use?

Mark

Chris and Greg

Thank you for your kind words and confirming that it's all working for you! It's encouraging me to keep adding more features in :)

Nico

Quote from: kiek on Sat, 18 Jun 2016 07:22
bidirectional: does not that imply that there is no Firewall problem?
Well, on 2nd thought when I did the edit, healthy numbers on the ExternalSim router doesn't necessarily mean that P3D is receiving the published FlightModels from the Router.

Next thing to try is changing the <DebugLogToFile> setting in PSX.NET.P3D.ExternalSim.xml to

<DebugLogToFile>true</DebugLogToFile>

This will create a debug log file in the same location as the config file. At the moment this doesn't output much debug data (I want to add more in future releases, like a confirmation that data is being received from the Router) but it might give me a clue.

Quote from: kiek on Sat, 18 Jun 2016 07:22
But none of these are running in my testing of your software.
Is your program using SimConnect???

That's good, please double check that no other simconnect clients are running (it'll be ok to turn them on again later once you've got ExternalSim all working).
Yes, ExternalSim uses Simconnect internally but it's a local-only connection that ignores any config files due to being hosted inside the P3D process. Relevant line of code:

SimConnect_Open(&hSimConnectExternalSim, "ExternalSim", NULL, 0, NULL, SIMCONNECT_OPEN_CONFIGINDEX_LOCAL)

SIMCONNECT_OPEN_CONFIGINDEX_LOCAL means "ignore SimConnect.cfg settings, and force local connection"

GodAtum

Quote from: GodAtum on Sat, 18 Jun 2016 09:51
How long should the visuals take to settle, I've been sitting here for 10 minutes?
Subscribed elevation model = 0.
I use the 2D cockpit view without panels, what view do you use for your sim and what values do you use?

When everything is fully working, it usually takes about 10-60 seconds for the aircraft to settle to the correct elevation. As your subscribed elevation models are 0, I think you've got a firewall blocking issue.

If Gary sees this thread, he might be able to provide further detail on views. From memory I think we just use the standard cockpit view with no instruments showing and tweak the aircraft.cfg with the desired eyepoint and offsets we want. We also use the new P3D ViewGroups feature for easy setup of Left/Centre/Right viewports on our multi-projector setup.

kiek

Hi Mark,

Here the content of the log file:

18-6-2016 - 12:36:19: System: Starting ExternalSim
18-6-2016 - 12:36:19: Task starting: TaskRouterSub
18-6-2016 - 12:36:19: Task starting: TaskFeedbackPub
18-6-2016 - 12:36:19: Task starting: TaskDebugPub
18-6-2016 - 12:36:19: Task started: TaskDebugPub
18-6-2016 - 12:36:19: Task started: TaskRouterSub
18-6-2016 - 12:39:49: System: Stopping ExternalSim

Rgrds,
Nico

GodAtum

#13
I tied it all on one PC and it kind of works. I get an increasing elevatinmodels value but it does not stop loading P3D. I've waited for a 10 minutes and the value is over 10000.

Mark

Nico

Could you please try this debug DLL

This replaces one of the DLLs in the main P3D directory. It behaves a little differently inside, and logs a bit more stuff.

Gary Oliver

Guys,

I wonder if alot of problems are caused by not disabling windows firewall entirely.  Turning it to off still leaves some inbuilt rules behind.

Best bet is go to 'Windows Firewall with advanced security' and then set all 3 profiles to 'allow' inbound 'allow' outbound. 

Cheers
Goli

GodAtum

#16
Would that still have an effect if I run everything on the same PC? It seems to get all the correct values increasing, but in p3D it keeps reloading.

Ivo de Colfmaker

Could it be we don't  have the correct SimConnect version?
Just thinking out loud.
There must be a reason why person 1 have no problems, and  person 2 does!
Windows version?
Ivo
A day at this forum is a day learned!

kiek

#18
Quote from: Mark on Sat, 18 Jun 2016 11:50
Nico Could you please try this debug DLL]
Here the log, I waited more then a minute in BASIC 003 while my 744 is in an Ocean, in the dark, and P3D re-loads (terrain?) every 3 seconds (in a split second)...

18-6-2016 - 18:12:14: System: Starting ExternalSim
18-6-2016 - 18:12:14: Task starting: TaskRouterSub
18-6-2016 - 18:12:14: Task starting: TaskFeedbackPub
18-6-2016 - 18:12:14: Task starting: TaskDebugPub
18-6-2016 - 18:12:14: Task started: TaskRouterSub
18-6-2016 - 18:12:14: Task started: TaskFeedbackPub
18-6-2016 - 18:12:14: Task started: TaskDebugPub
18-6-2016 - 18:12:14: Task subscribe complete: TaskRouterSub
18-6-2016 - 18:12:14: Task binding complete: TaskFeedbackPub
18-6-2016 - 18:12:14: Task binding complete: TaskDebugPub
18-6-2016 - 18:12:14: FlightModel connection established.
18-6-2016 - 18:12:16: TimeModel connection established.


Rgrds,
Nico

evaamo

Hi Mark, first of all thank you for sharing this addon!

I tried using it today and it worked great except for one thing:

I had to disable P3D AI Traffic. The simulator would become stuck in an infinte loop of the P3D pop-up screen of " loading air, land and sea traffic" every 2 or 3 seconds. The only way it worked was to either stop running ExternalSim's router or disable AI traffic (I chose the latter of course).

Would a screenshot help to understand this issue?

Thanks!
Cheers
-E
Enrique Vaamonde