CIGI Crash when using P3D as IG

Any issues, problems or troubleshooting topics related to the additional features present in the Prepar3D Professional Plus client application.
Post Reply
User avatar
OPS_Support
Posts: 8
Joined: Tue Jun 26, 2018 12:15 am

CIGI Crash when using P3D as IG

Post by OPS_Support »

Hello,

I am attempting to use P3D as an IG with external flight model environment. My initial test was to connect P3D to a CIGI Host. I am using the CIGI Host Emulator 3 software that is provided by CIGI as a test module. After I press "Start IG" in the P3D Menu I can see CIGI packets being sent to/from the host machine for a few seconds then P3D hangs and crashes to desktop.

Am I missing something in the setup that is causing P3D to crash when used as an IG? Do I need to add a specify TypeID into the DISEntityTypes.xml for the aircraft that I intend on flying in P3D?

The end goal is to have the HOST machine fly around the P3D aircraft and for me to be able to use the navigation equipment inside of the P3D aircraft (since my flight model software doesn't have a navaid database). Is this possible?

Thanks,

Lukas
User avatar
Brady Butler
Lockheed Martin
Posts: 965
Joined: Tue May 09, 2017 5:31 pm

Re: CIGI Crash when using P3D as IG

Post by Brady Butler »

Hello Lukas,

Did you review the CIGI page in the Learning Center? https://www.prepar3d.com/SDKv4/prepar3d ... rview.html

Do you know which packets are being sent before the crash happens (and possibly the data inside them)?

Are there any Prepar3D add-ons installed such as aircraft models, etc?

Regards,
Brady
Brady Butler
Prepar3D® Software Engineer
mchriest
Posts: 33
Joined: Tue Feb 21, 2012 4:17 pm

Re: CIGI Crash when using P3D as IG

Post by mchriest »

I've been working with Lukas, and have independently attempted to configure p3d as a cigi IG. I've started with the CIGIMinitHost, provided as an example with the cigi class library, and am getting a similar result.
After clicking StartIG, my host receives exactly one SOF message from P3D before P3D becomes unresponsive. At that point, any click on the P3D window crashes the program. The SOF message includes a non-zero timestamp, and timestamp is valid = 1, but indicates 0 values for Frame counter and LastRecvdFrameCount.

I'm on a clean (brand new) machine, brand new install of p3d pro plus 4.3. No plug-ins.

Any chance someone can provide a sample for a minimal host (just need entity position/type), that won't crash p3d?
Clifton Crane
Lockheed Martin
Posts: 1207
Joined: Tue Sep 25, 2012 2:34 pm

Re: CIGI Crash when using P3D as IG

Post by Clifton Crane »

Hello,

Which CIGI version are you targeting? Is this correctly set in the CigiConfig.cfg file? Does the IG SOF message ever report in the Ready state or is it always in Standby? Also, can you try testing in both Synchronous and Asynchronous mode.

Thanks.
Clifton Crane
Prepar3D® Software Engineer Sr.
mchriest
Posts: 33
Joined: Tue Feb 21, 2012 4:17 pm

Re: CIGI Crash when using P3D as IG

Post by mchriest »

Hi Clifton. Thanks for the reply. FYI, P3D is no longer crashing, although I don't know why, and don't like that.
I can tell you that this morning I put a breakpoint at the top of my host code, running in debugger, and stepped through the main loop. Got an SOF packet, as expected. sent data and back to beginning of loop. Expected crash, but got a new SOF with updated frame count. After that, P3D no longer crashes when starting IG in P3D.
So mystery progress, but I'll take it. Now I'm getting reliable SOF packets with updated time, frame count, etc. but the P3D scene never changes, other than the ownship "disappearing" when IG mode is started.

I am targeting cigi 4.0, and it this is set correctly in the CigiConfig file.
I have tried both synchronous and asynch. Same result.
SOF IGMode is coming across as 1 (operate). No reset or standby.

I am currently sending entity control, entity control position, IGControl and ViewDef packets. Please advise if P3D requires any other packets.

I have an idea what the problem is, but haven't yet finished breaking out for testing.
As I mentioned, I'm using the host example that comes with the Cigi class library, and I see that this code is packing the IGControl and EntityControlPosition packets into the same message, although the cigi 4.0 icd states only 1 packet per message. I'm assuming the class library, if implemented on the IG side, would separate these packets out.
I'll break them up manually and see what I get.

If you have any other insights, please let me know.

thanks,

Mike.
Clifton Crane
Lockheed Martin
Posts: 1207
Joined: Tue Sep 25, 2012 2:34 pm

Re: CIGI Crash when using P3D as IG

Post by Clifton Crane »

Mike,

In the CigiConfig.cfg file there is a ViewID setting, you will want this to match the ViewID of your ViewDef packet. You should then see the Prepar3D main window view respect the entity location and the view definition offsets.
Clifton Crane
Prepar3D® Software Engineer Sr.
mchriest
Posts: 33
Joined: Tue Feb 21, 2012 4:17 pm

Re: CIGI Crash when using P3D as IG

Post by mchriest »

Yes, thanks. ViewID = 0 on both sides. I'll see what happens when I've broken the packets into separate packets.
mchriest
Posts: 33
Joined: Tue Feb 21, 2012 4:17 pm

Re: CIGI Crash when using P3D as IG

Post by mchriest »

Last week I resolved the issue of the scene not changing. The View Control packet was required, in addition to the View Def packet.
My above comment regarding 1 packet per message is incorrect. The packets should be packed together in a single message. the cigi icd contradicts itself later, making this clear. Hope this helps someone.

My view is now updating, but I am still having no success in rendering my ownship object. I've opened that topic in another thread.
sunilhalvi
Posts: 10
Joined: Sat May 02, 2020 6:32 am

Re: CIGI Crash when using P3D as IG

Post by sunilhalvi »

Hi, mchriest,
I am facing a similar issue, I have configured P3D to run as IG. I have my own CIGI host application. I am sending a view control packet and view definition packet every time I send a response to the IG's SOF. ViewID in CigiConfig.cfg is set to 0 and ViewID is set to 0 on both view control and view definition packets and GroupID is set to 0.
P3D is not changing the scene. However, the weather control packets are working the cloud layers are rendered when I send weather control packet.
Kindly, help me to solve this. please provide the details of the entity control packet, view control packet, and view definition packet you sent to P3D.

Thank You
Sunil (India)
sunilhalvi
Posts: 10
Joined: Sat May 02, 2020 6:32 am

Re: CIGI Crash when using P3D as IG

Post by sunilhalvi »

Hi,
This post is to inform future readers if they are curious.
I solved this by assigning Entity type ID in the DISEntityTypes.xml file. Because I had not assigned any entity type ID in this file, the P3D IG had no clue about entity control packet I was sending.
Post Reply