Wednesday, July 19, 2017

FSX with Live Camera Windowed Views (Part 1)



Tutorial for OpusFSI Live Camera Window Views on Client Displays for FSX — 

Purpose: Microsoft Flight Simulator (FSX) provides a means for displaying multiple graphics views on a PC with one or more extended displays. Using extended displays spanning 2 or more monitors provides a mechanism for viewing outside the aircraft, both left and right, as an aid for making the simulation more realistic. Additional views are especially useful for landing approaches, both VFR and IFR. Extended displays across two or more monitors is set up in Windows:Control Panel:...Display:Screen Resolution.

FSX on one PC with multiple views on several displays can easily overwhelm the system causing software crashes during a flight simulation. One approach to fixing this problem is to run FSX on two or more PCs which spreads the load and reduces the occurence of crashes.

Having FSX run on more than one PC requires some intermediate software to coordinate the simulations and displays between the PCs. One such Product is WidevieW, and a second is OpusFSI.

Wideview was purchased and tested but had issues with aircraft bouncing around on the ground and the software was abandoned without much luck.

OpusFSI was purchased and installed and provides good integration of views across two PCs. However, I was not able to find a detailed example of how to create multiple views in a fairly seamless manner. Opus Software provides a vast amount of documentation, but the documentation lacks examples of how to implement specific uses of the software. This tutorial describes one way of using the OpusFSI software to create side views from the perspective of the pilot of the simulator. The software vendor or other users may have other approaches to achieve the same end result.


Hardware/Software Configuration:

The hardware used for this tutorial include two PCs: 1) Intel Core-2 with Win7 32-bit Laptop with 2 displays (laptop display and Mini Display Port to VGA display); 2) Intel i7 with Win8.1 64-bit desktop with 2 displays (HDMI and Display Port, both 1080P). 

The Win7 laptop PC software includes: 1) FSX with Acceleration, 2) Mobiflight for home-built controls, 3) FSUIPC; and, 4) OpusFSI_V5 Server for FSX.

The Win8.1 desktop PC software includes:  1) FSX with Acceleration, 2) FSUIPC; and, 3) OpusFSI_V5 Client for FSX.

The OpusFSI documentation was followed for installing the Server and Client software, for setting the file sharing and permissions, and for establishing the communication via ethernet on home network between the Server and Client. The Live View Test, run on the Client, then the Server, will demonstrate whether the Server is communicating with the Client over the local network. Those tests must work before further installation tasks can be accomplished. These tests do not test if file sharing and permissions are set correctly, but will establish that the Server actually can control the Client. The Opus documentation discusses in detail the requirements for setting sharing and permissions.

The Server window "Configure" button is used to configure the number of Client machines, to enable Live Camera, and to provide the path to the FSX install directory.

The Server window "Cameras" button provides a window for defining and managing views. For this tutorial, 2D Windowed views will be created for the Cessna 172 aircraft or for all aircraft. Using the views for all aircraft is a bit easier for first use.


Software Start-up:

Start both the Server and Client PCs.
Run the FSX software with FSUIPC on both machines.
Run the FSI Server on the Server PC using a shortcut target "C:\OpusFSI_v5\FSISERVER.EXE FSX" as Administrator.
Run the FSI Client on the Client PC using a shortcut target "C:\OpusFSI_v5\FSICLIENT.EXE FSX" as Administrator.

The FSIServer and FSIClient will add an Add-On to the FSX Add-Ons menu along with the FSUIPC Add-On.

Have a copy of the same FSX flight on both machines. Load that same FSX flight on the Server FSX and the Client FSX. Both PCs should display the same view on startup if FSI Live Views have not been created. On the Client machine, use menu FSX:Options:Settings:Display and set the 2D display as the default and, if desired, set the transparency to 100%. This will hide the dashboard panel from showing, however, it will still exist and can cause some confusion when moving views that overlap with the transparent panel display. Save the changes to the Client aircraft flight.


Live Views:

Client Live Views are created using the FSI Server window, "Cameras" button, and Camera Management window. 
1) On the Camera Management window, first click the "Select Computer System" button and choose the Client PC by name. There should be both the Server PC and Client PC names displayed on the list of choices. The field to the right of the button will display the chosen Client PC name. 
2) Choose "All Aircraft Types", and "Create" to create a new view. 
3) Click "2D Cockpit", "OK", and the "Camera Editing" window will display. 
4) Rename the "Camera" named "Camera View x" to something meaningful to you. 
5) Choose "Windowed View", "2D Cockpit", set X to "-3", set Y to "1", set Pitch to "6.4", and set Yaw to "-40". You should see a full window view on the Client screen with a view 40 degrees to the left of front from the cockpit. The X=-3 moves the view to the left outside the cockpit and the pitch and yaw rotate the view to the desired angle. Push "OK" and "OK" again to return to the FSI Server window.

What will seem odd at this point is that the Client display will not show the new view that was just created. To get the view to display requires that a different aircraft (Not the same type, just choose the Piper Cub or something else) and the new view will display. Now go back and choose your desired aircraft and the rotated view should display. The Instrument Panel or 3D Virtual Cockpit may also show, you just have to remove those from the display.


Adjust the Views on the Client Displays:

For one or more displays, set your FSX window to "not full screen" and expand it to span across your multiple displays, as big as you want your FSX window to be. 

According to the OpusFSI documentation, you can have a view that is either "docked" or "undocked". A docked view will reside inside the FSX main window, while an undocked view can be moved outside the FSX main window. However, FSX will not load a view as "undocked" and any view that you want as undocked will require manual intervention each time the software loads. To fix that problem, the FSX window can be made as large as the multiple displays will allow. Then the "docked" views can be loaded, sized, and moved to the desired locations automatically as the flight loads.

1) Resize the Client FSX window as large as you desire.
2) Move and resize your Windowed View(s) to where you want it on your Client display inside of the FSX window.
3) Save your aircraft using the FSX:Flights:Save... using your current flight name. At this point the Client flight is a bit different than the Server flight of the same name, but that is OK. Saving the aircraft will save the large size of the FSX window.
4) On the Client FSX menu choose "Add-Ons:OpusFSI:Save Windowed Views" to save the view size and location within the FSX window. If a Client view is then moved, clicking "Add-Ons:OpusFSI:Restore Windowed Views" will move the views back to the locations and sizes when they were last saved.

This process can be used to create multiple views that will load automatically on the Client when FSX/FSUIPC/FSI are started on the Server and Client.

Issues:

As mentioned earlier, "undocked" views must be manually undocked. This can be mostly overcome by expanding the FSX window and just displaying the Windowed Views as "docked" views within the FSX window. 

According to Opus Support, if an "undocked" view is desired, a "docked" view can be "undocked" (right mouse click) and the "Add-Ons:OpusFSI:Restore Windowed Views" will move the views back to the locations and sizes when they were last saved, including the now "undocked" views which may be moved to locations outside the FSX window. I was not able to get that functionality to work, so development focused on using docked views within the FSX window spanned across multiple displays.

A second issue arises if the Client FSX goes down by a crash or through manually stopping the FSX software. If I am in a lengthy simulation and the Client PC FSX crashes, I would prefer to restart the Client and continue with the flight. What happens when the FSX Client stops on my system is that the C172 aircraft.cfg file gets over-written when the FSX Client is restarted. At that point, the aircraft.cfg no longer contains the Windowed View definitions, so they can not load and display on the Client.

I have found a couple of fixes for this problem that may be a bug in my system that I do not know how to fix at this time.

1) After restarting the Client FSX but before selecting the flight/aircraft, replace the aircraft.cfg file without the view configurations with a copy of the file that contains the view configurations. Use Notepad++ to edit the .cfg files and you will find where the missing view configurations should be.

The default aircraft.cfg file used by FSI will have the following lines at about line number 476:

=============== Example aircraft.cfg without Windowed Views ===============
[deice_system]
structural_deice_type=0     //0 = None, 1 = Heated Leading Edge, 2 = Bleed Air Boots, 3 = Eng Pump Boots

[CameraDefinition.899]
Title = "OpusFSI Aircraft View"
Guid = {01021987-E220-6507-1024-462840738899}
Description = OpusFSI Aircraft View
Origin = Center
SnapPbhAdjust = Swivel
SnapPbhReturn = FALSE
PanPbhAdjust = Swivel
PanPbhReturn = FALSE
ShowAxis = FALSE
ShowWeather = TRUE
Category = Aircraft
MomentumEffect = FALSE
ShowLensFlare = FALSE
CycleHidden = No
PitchPanRate = 30
HeadingPanRate = 75
PanAcceleratorTime = 0
SmoothZoomTime = 2.0
AllowZoom = TRUE
XyzAdjust = TRUE
AllowPbhAdjust = TRUE
InitialZoom = 0.8
InitialXyz = 0,6,-30
InitialPbh = 6,0,0
Track = None

[CameraDefinition.0]
Title = "Right Wing"
Guid = {C690EAFD-223A-42d0-99E0-681ADF93BB59}
Description = View from the right wing tip looking at the cockpit
Origin = Center
SnapPbhAdjust = Swivel
...

===============================================================


=============== Example aircraft.cfg with Windowed Views =============
[deice_system]
structural_deice_type=0     //0 = None, 1 = Heated Leading Edge, 2 = Bleed Air Boots, 3 = Eng Pump Boots

[CameraDefinition.899]
Title = "OpusFSI Aircraft View"
Guid = {01021987-E220-6507-1024-462840738899}
Description = OpusFSI Aircraft View
Origin = Center
SnapPbhAdjust = Swivel
SnapPbhReturn = FALSE
PanPbhAdjust = Swivel
PanPbhReturn = FALSE
ShowAxis = FALSE
ShowWeather = TRUE
Category = Aircraft
MomentumEffect = FALSE
ShowLensFlare = FALSE
CycleHidden = No
PitchPanRate = 30
HeadingPanRate = 75
PanAcceleratorTime = 0
SmoothZoomTime = 2.0
AllowZoom = TRUE
XyzAdjust = TRUE
AllowPbhAdjust = TRUE
InitialZoom = 0.8
InitialXyz = 0,6,-30
InitialPbh = 6,0,0
Track = None

[CameraDefinition.990]
Title = "OpusFSI Windowed View 1"
Guid = {01021987-E220-6507-1024-462840738990}
Description = OpusFSI Customized Scenic View
Origin = Cockpit
SnapPbhAdjust = Swivel
SnapPbhReturn = FALSE
PanPbhAdjust = Swivel
PanPbhReturn = FALSE
ShowAxis = FALSE
ShowWeather = TRUE
Category = Custom
MomentumEffect = FALSE
CycleHidden = No
PitchPanRate = 30
HeadingPanRate = 75
PanAcceleratorTime = 0
SmoothZoomTime = 2.0
AllowZoom = TRUE
XyzAdjust = TRUE
AllowPbhAdjust = TRUE
InitialZoom = 1.0
InitialXyz = -3,1,0
InitialPbh = 6.4,0,-40.5595
Track = None

[CameraDefinition.0]
Title = "Right Wing"
Guid = {C690EAFD-223A-42d0-99E0-681ADF93BB59}
Description = View from the right wing tip looking at the cockpit
Origin = Center
SnapPbhAdjust = Swivel
SnapPbhReturn = FALSE
...
=============================================================

On my Client PC, anytime the Client FSX and FSI software is shutdown, all of the aircraft.cfg files revert to the default copies. To fix this problem, make backup copies of the files that contain the additional view definitions.

In addition, the view definitions should also exist in the Client C:\OpusFSI_V5\OpusFSI_Server_CamDefs.txt file. The contents of this file can be pasted into the default aircraft.cfg to add the view definitions manually. See the above example for the location of these definitions in the .cfg file.

To prepare files for this fix on the Client, when the Client views are properly displayed, navigate to "C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\SimObjects\Airplanes\(your aircraft)\aircraft.cfg", copy the file, paste the file as a copy, and rename it so that you have a copy to use when required (after a Client FSX shutdown or crash). If this copy is recopied over the file without the view definitions, and then the FSX flight is chosen on the Client, the flight and aircraft will load with the saved views. You may need to "Open" or "Restore" the Client Windowed views, but the views should display properly and the current flight on the Server can resume with little impact.

You can force the Client to retain the aircraft.cfg file with the added Live View definitions by changing the Properties:Read Only and maybe also turning off Everyone permissions on the file or folder. This fix just stops the modified files from being over-written by the Server so the views are always defined. Any desired changes to the views would require an update of the aircraft.cfg files with the revised view definitions. (Just one more thing to have to remember)

A second fix to the missing aircraft.cfg view definitions, is to use FSI to write the proper files from the Server back to the Client. To do this, have the Client FSX/FSUIPC/FSI running,  but do not load the flight, yet.

On the Server, use the FSI Server window, click "Cameras" button, choose any one of the 2D Windowed views on the Client, "Edit", to display the edit window, then push "OK", "OK" twice to exit the Edit window back to the FSI Server window. The Server will update the necessary files on the Client. If the flight has not yet been loaded on the client, do so now. If a flight was already active, select a different type of aircraft to force the loading of the modified files, then select your aircraft, and use "Open" or "Restore" if nessary to put the views in the desired locations.

If you find a better method or fix a bug in what has been described above, please share your knowledge.

Thanks