Problems encountered with AI waypoints.

Discuss on the SimConnect SDK can be used by programmers to write add-on components for Prepar3D
Post Reply
rvDevman
Posts: 8
Joined: Wed Jan 26, 2022 6:25 am

Problems encountered with AI waypoints.

Post by rvDevman »

Hi.

I have a question about how to set waypoints for AI aircraft to fly using SimConnect.

I have created a SIMCONNECT_DATA_WAYPOINT array and am using SetDataOnSimObject() to set the waypoints.
However, the AI aircraft ignores the waypoints and flies away.

In what cases does this happen?
Also, is there an upper limit to the number of waypoints that can be set?

I would be grateful for your advice.
Thank you.
rvDevman
Posts: 8
Joined: Wed Jan 26, 2022 6:25 am

Re: Problems encountered with AI waypoints.

Post by rvDevman »

Hello,
I have reorganized the questions.

About the accuracy of waypoints
I created a SIMCONNECT_DATA_WAYPOINT array with SimConnect and set waypoints for the SetDataOnSimObject AI aircraft, but immediately after takeoff, but the AI ​​aircraft ignores the waypoints and flies.

The data definition is as follows:
simconnect.AddToDataDefinition (DEFINITIONS.AI_Waypoints, "AI WAYPOINT LIST", "number", SIMCONNECT_DATATYPE.WAYPOINT, 0.0f, SimConnect.SIMCONNECT_UNUSED);

The waypoint data settings are as follows: (Wp = SIMCONNECT_DATA_WAYPONT array)
Object [] objv1 = new Object [wp.Length];
wp.CopyTo (objv1, 0);
simconnect.SetDataOnSimObject (DEFINITIONS.AI_Waypoints, objectID, SIMCONNECT_DATA_SET_FLAG.DEFAULT, objv1);

Are there any points to note when creating waypoint data?
for example,
・ A certain interval is required between waypoints
・ A sharp angle cannot be turned etc...

Also, when recreating waypoints, I recognize that I will follow the steps below, but is that okay?
-Delete the created aircraft.
-Recreate and set again.

Could you please give your comment?

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

Re: Problems encountered with AI waypoints.

Post by Clifton Crane »

Hi rvDevman,

Is your aircraft starting on the ground or in the air? Also, which aircraft are you attempting to assign waypoints?

You will probably want to place your waypoints keeping the speed of the aircraft in mind. For example, a smaller aircraft will likely follow closer waypoints better, where as a faster aircraft will likely prefer waypoints with greater spacing. If an aircraft fails to hit a waypoint, its possible it may circle back to try and intercept it.

Have you tried running the Managed AI Waypoints sample? Do the vehicles in the sample follow the waypoins?
Also, when recreating waypoints, I recognize that I will follow the steps below, but is that okay?
-Delete the created aircraft.
-Recreate and set again.
Yes, this should be fine.

Regards,
Clifton
Clifton Crane
Prepar3D® Software Engineer Sr.
rvDevman
Posts: 8
Joined: Wed Jan 26, 2022 6:25 am

Re: Problems encountered with AI waypoints.

Post by rvDevman »

Hello,

Thank you for your answer.
I tried various tests.
Certainly, if you set a route that does not force you, it will feel like it is working as expected.

However, one thing I found out is that Waypoint cannot specify the posture.
Actually, I wanted to make the AI airplane loop-the-loop, but it seems difficult with Waypoint, so I will consider how to use SimConnect.

Thank you.
Post Reply