Page 1 of 1

CIGI Crash when using P3D as IG

Posted: Fri Oct 12, 2018 5:48 am
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

Re: CIGI Crash when using P3D as IG

Posted: Fri Oct 12, 2018 11:39 am
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

Re: CIGI Crash when using P3D as IG

Posted: Wed Oct 17, 2018 9:49 pm
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?

Re: CIGI Crash when using P3D as IG

Posted: Thu Oct 18, 2018 4:40 pm
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.

Re: CIGI Crash when using P3D as IG

Posted: Thu Oct 18, 2018 5:49 pm
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.

Re: CIGI Crash when using P3D as IG

Posted: Thu Oct 18, 2018 6:02 pm
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.

Re: CIGI Crash when using P3D as IG

Posted: Thu Oct 18, 2018 6:07 pm
by mchriest
Yes, thanks. ViewID = 0 on both sides. I'll see what happens when I've broken the packets into separate packets.

Re: CIGI Crash when using P3D as IG

Posted: Tue Oct 30, 2018 1:30 pm
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.

Re: CIGI Crash when using P3D as IG

Posted: Tue Oct 26, 2021 12:47 pm
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)

Re: CIGI Crash when using P3D as IG

Posted: Tue Dec 21, 2021 7:11 am
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.