Switching aircraft control

Discussion related to Mission design and creation.
Locked
TDinham
Posts: 5
Joined: Wed Jan 19, 2022 12:09 pm

Switching aircraft control

Post by TDinham »

HI,
i am currently trying to build a mulitplayer scenario where i have one player and Lots of AI planes. I want to be able to take control of these AI planes at runtime and fly them towards the player. However, i cannot see a way that i can switch between aircraft as a sim operator or a Observer.

Dose anyone know how this can be done or if it is even possible?
User avatar
JorgenSA
Posts: 6001
Joined: Sun Mar 11, 2018 7:17 am
Location: 5 NM ENE of EDXF

Re: Switching aircraft control

Post by JorgenSA »

I do not believe that this is possible. But I could be wrong.

The reason I do not believe it is possible, is that AI aircraft operate under the control of the AI flight plans, and strictly follow the route set out in them.

You might get around that by determining where approximately you are going to be in your own aircraft, and then creating AI flight plans that make the AI aircraft fly to and then around that area. And maybe someone more creative than I have a better idea.

Jorgen
System: i5-12600K@4.9 GHz, ASUS ROG STRIX Z690-I motherboard, 32 GB 4800 MHz DDR5 RAM, Gainward RTX 3060 w/ 12 GB DDR6 VRAM, Windows 10 Pro.

All views and opinions expressed here are entirely my own. I am not a Lockheed-Martin employee.
Clifton Crane
Lockheed Martin
Posts: 1207
Joined: Tue Sep 25, 2012 2:34 pm

Re: Switching aircraft control

Post by Clifton Crane »

Hi TDinham,

You should be able to control the behavior of the AI using a structured scenario created in SimDirector. This scenario would need to be configured to be useable by the multiplayer system (see ScenarioMetaData object in SimDirector). You will also need to create Player roles. Each joining client would need to select a role before the session starts. We ship a sample scenario called Multiplayer and SimOperator Base Scenario you may use for reference.

Your AI entities would need to be part of this scenario. They can be assigned a default state such as cruise or they can be assigned a Waypoint List. This should get the AI flying in a direction at a specified speed.

You could then use an Activate Waypoint List Action to assign the AI a new waypoint list to follow. This can be done via a Trigger in the scenario. The trigger could be fired based on some condition set in the scenario, or manually by the SimOperator if in a SimOperator session.

Another option would be to use an AI Behavior such as Pursue to tell the AI objects to follow the user. When using behaviors, an Entity Affiliation and Entity Identification must be configured on the AI objects as well as the Player objects. This will determine whether or not the AI object considers another object a Friendly, Foe, or Neutral object, which in turn determines how the behaviors will react.

Note that AI Behaviors and SimOperator are only available in the Professional Plus version of Prepar3D.

We don't currently have a way for the user object or SimOperator to take control (i.e. hand-fly), an AI entity, however this could be possible to some degree via SimConnect or PDK plugin.

Regards,
Clifton
Clifton Crane
Prepar3D® Software Engineer Sr.
Locked