Board index FlightGear Development Add-ons

Announcing Mission Generator Addon

FlightGear has support for add-ons, to further extend the simulator's core functionality.

Announcing Mission Generator Addon

Postby wlbragg » Fri Sep 24, 2021 9:11 am

This post is to announce the start of a Mission Generator addon. It currently has the functionality of the search and rescue and random fire ignition features that were a part of the Wildfire addon.

I plan to add to it when ever I dream up new missions or features.

If is available as an addon at https://sourceforge.net/p/flightgear/fgaddon/HEAD/tree/trunk/Addons/MissionGenerator/
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7587
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Announcing Mission Generator Addon

Postby erik » Fri Sep 24, 2021 3:03 pm

One possible mission, which might not be on anybody's radar right away, is a scramble mission to intercept an unidentified or hostile aircraft:
https://en.wikipedia.org/wiki/Scrambling_(military)

Erik
Current: Parachutist, Paraglider, Pterosaur, Pilatus PC-9M and variants, ERCO Ercoupe, Fokker Dr.1, Fokker 50, Fokker 100
Less active: Cessna T-37, T-38, Santa Claus. Previous: General Dynamics F-16. Worked on: Wright Flyer
erik
 
Posts: 2244
Joined: Thu Nov 01, 2007 2:41 pm

Re: Announcing Mission Generator Addon

Postby wlbragg » Fri Sep 24, 2021 5:07 pm

Do you know of anything already available with any of the elements needed for something like that?

I think an AI aerial tanker re-fueling example would be a starting point for the incoming aircraft. Or possibly using any nearby AI commercial aircraft as the bogie would be even better. You wouldn't have to write any code for the bogie aircraft and there are literally thousands of them out there in the FG world. A long time ago I wrote a really small script to track an AI and try to converge or follow it. All the information for that is already available in the property tree. Just loop through AI aircraft in range and pic one at random then vector the interceptor aircraft to that AI for visual verification. Great idea, and actually fairly simple!
I've already created an algorithm that loops through AI for the cargo towing addon. That could easily be adapted for this.

If anyone wants to create a "mission feature" for this addon, I plan to categorize the main menu and we can add the new mission category to the menu and if the new feature is modular and self contained, it will fit nicely in the scheme.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7587
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Announcing Mission Generator Addon

Postby erik » Fri Sep 24, 2021 6:05 pm

My initial thoughts where: reuse the firefighting mission, add a 3d model (it would probably be okay if it always is a 737) and give it a random cruise altitude, direction and a fixed speed.

Erik
Current: Parachutist, Paraglider, Pterosaur, Pilatus PC-9M and variants, ERCO Ercoupe, Fokker Dr.1, Fokker 50, Fokker 100
Less active: Cessna T-37, T-38, Santa Claus. Previous: General Dynamics F-16. Worked on: Wright Flyer
erik
 
Posts: 2244
Joined: Thu Nov 01, 2007 2:41 pm

Re: Announcing Mission Generator Addon

Postby wlbragg » Fri Sep 24, 2021 6:41 pm

Yeah, that would work and be fairly simple for me, other than attaching a flight path animation to a model that way. That would have to be written. I think it would be more rich and actually less work using all the AI aircraft already flying at different altitudes, speeds and headings at locations throughout the world. I think you have convinced me to make that my next task. Sounds like a really fun project to add to the addon.

I'm thinking...
1) catch x amount of the closest local AI aircraft
2) randomly select one
3) feed its vector data to the Event notification (data is already available in property tree)
4) event notification states "Scramble, intercept bogie at: Lon Lat Bearing Range", the same optional parameters as the s&r and random fire point.
5) visually identify the AI aircraft by if ( aircraft.pos.distance_to(AI.pos) < xxx meter) triggers visual conformation, exercise over.

If I am remembering the data in the property tree correctly, this is a really easy and very rich feature to create. I think I could add it in a few hours.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7587
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Announcing Mission Generator Addon

Postby wlbragg » Fri Sep 24, 2021 6:56 pm

I think one more dimension to add to this is a choice to do any of these features under a completion timer to add some urgency. I would want it optional however.

One addition to the s&r feature I want to create is to feed a grid search pattern to be searched for the victim or incident instead of a vectored approach. That would have a time frame attached for success or failure. The larger the grid search the longer the time allotted, up to days of potential survival expectations.

I also need to verify right now if a night search with, lets say the AirCrane spot light, can illuminate the campfire smoke or the human model. That is a whole new dimension and can be an additional search type, apprehension. Would love to have a nice animated human model on foot or better yet a vehicle, or both.

Also as it is now, in s&r, if the victim is on the ground it requires a WOW event to succeed. I need to make that optional, either landing or hovering. Maybe hovering should only work with rope deployed through cargo towing addon?
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7587
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Announcing Mission Generator Addon

Postby wlbragg » Fri Sep 24, 2021 7:23 pm

I just verified the spotlight works in the aircrane (compositor) and does indeed illuminate the smoke particles and the human model so night searches are possible.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7587
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Announcing Mission Generator Addon

Postby Hooray » Fri Sep 24, 2021 8:28 pm

FWIW, we have previously toyed with a simple UI driven mission generator, where people would configure a handful of variable elements (airport, aircraft, weather/environment, mission), and the mission generator would then create permutations of these variables by randomly creating new missions:

Code: Select all

var airports = ["ksfo", "klas", "krno"]
var aircraft = ["c172p", "C310", "PA18"]
var list_of_different_METARs = [....]


Such missions could in turn be based on "templates" (which are easily supported by Nasal) - and such templates could then be filled in using page-based dialogs to walk people through the process of creating/editing and updating/maintaining missions.

https://wiki.flightgear.org/Mission_Editor#Approach
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Announcing Mission Generator Addon

Postby wlbragg » Fri Sep 24, 2021 9:09 pm

For sure, right now it's the time to think of how this framework should be laid out. I've already identified certain features that need to be standardized to be called as a function for other areas of the mission generator to draw from. Such as the slider to set a range, or the dial widget used to set a time frame. I need to start out as modular as possible. In order to allow add-on modules. The idea would be each module might be a GUI menu item under the drop-down Mission generator main menu. Each module would be self contained in its own folder under the add-on umbrella. Each add-on could use the common resources for their own brand of mission. In just the couple type of missions I have already created, the commonality a functions needed is significant.
I really think the scope of what I wanted to create is the very catalyst for my procrastination. But seeing a start, one part at a time, maybe the way to go. Just let it grow and evolve overtime. Especially with a good starting framework.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7587
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Announcing Mission Generator Addon

Postby Hooray » Sat Sep 25, 2021 9:58 am

Originally, this is what the PUI-based wizard looked like in the pre-Canvas days:

Image

Obviously, this could also be easily re-created using a Canvas based approach instead.

Basically, we would be dealing with a vector of hashes - with each hash representing a single "page" of a wizard, including things like:

  • label
  • input type (checkbox, text, number etc)
  • description/tooltip/help string
  • optional validation callback (to validate the input before proceeding to the next page)

A working proof-of-concept using this approach can be seen here (the whole UI being procedurally built from a vector of hashes): https://wiki.flightgear.org/Howto:Imple ... of_concept
Image


That way, it would be pretty easy to create a mission generator, that can come up with many different types of missions, simply by exchanging/replacing some variables (type of aircraft, type of airport, weather, mission type, aircraft failures etc)

The same type of wizard-framework could then also be reused for other FlightGear related purposes, for instance, Stuart has been using template-based stubs to pre-create Nasal files for his FG1000 - that sort of thing could also be based on a wizard framework that is UI driven.

Thus, I would suggest to focus on discussing a "wizard framework" for now - we could then use that wizard framework, to create a custom instance of it, specifically for creation missions - and in fact, since we already have the tutorial system, that could become the foundation for such a wizard - e.g. by allowing people to create "tutorials" via such a wizard-based interface, consisting of different pages and options.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Announcing Mission Generator Addon

Postby wlbragg » Sat Sep 25, 2021 6:08 pm

Thanks Hooray for ideas, there always welcome even if not adopted.

This stuff can be made as elaborate or simple as we want. There so many possibilities as to how to arrange missions, the interface, the types, the complexity, the associated artwork, etc. It's vast. You could get bogged down in discussion to infinitum or lock yourself into a path that in the end isn't the best one. For now, I want to just start adding pieces. Keep them as modular as possible and work the rest out as I go. Until I see what all comes up I really don't know how I would want it laid out.

The key ideas I'm resting on are...

1) Modular.
2) Anything goes if modularized ie; tutorial based, scripted, AI
3) To not lock this addon into a predefined path where possible.
4) In the long run, needs to be canvas GUI interfaces whenever possible.

@erik, funny I didn't really remember the extent as to what I already have for a "scramble" type mission. Look at the information we already have "easily" at our disposal for this type of "incident". The cargo towing addon has all the pieces needed in order to use FG real world AI aircraft data :wink: Either pick and choose or grab one at random or both options?

Image
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7587
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Announcing Mission Generator Addon

Postby wlbragg » Sat Sep 25, 2021 6:32 pm

I have a task for anyone willing to provide it to me. I need the math to vector your chosen aircraft that your running in the sim to the AI target.

Data you can have at hand and use...

Target -
position
range
speed
heading
altitude

Your local aircraft data -
bearing to
max speed

I can't think of anything else needed for this.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7587
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Announcing Mission Generator Addon

Postby Johan G » Sun Sep 26, 2021 12:42 am

My understanding of this is based on only a few sources.

If the target information is of use for several friendly aircraft target information will be given in bullseye format, and if it is for one specific aircraft or if the aircraft are in visual range it would be given in BRAA format.

A bullseye is a predetermined location from which bearings and distances is given together with an altitude in thousands of feet. A BRAA is a position and aspect (bearing from your aircraft, slant range, altitude in thousands of feet, and aspect,[1] unless HOT, that is heading your way) given in relation between your aircraft and the target of interest. Likely the BRAA format is more often used for intercepts.

It seems this video, by a virtual squadron, likely is at least somewhat accurate, though very basic (and a bit slow):

Carrier Air Wing Eleven, CVW-11 Tutorials: Introduction to Air Intercept Control (14 min, uploaded 4 September 2020)


See also the FlightGear wiki article Aircraft interception (permalink)
____
[1] Aspect is the other aircraft's heading relative to you. HOT is 0-30° off your nose, FLANKING is 30-70° off your nose, BEAMING is 70-110° off your nose, or DRAG/COLD, 110-180° off your nose.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: Announcing Mission Generator Addon

Postby wlbragg » Sun Sep 26, 2021 6:37 am

Johan, thanks for the introduction, that was helpful in as much as it confirmed I really don't want to take the time to be an expert on any of this. It was a really good introduction to all the terminology involved and now that I am aware of it maybe I will use the terminology to visualize the data to the pilot in a more proper fashion than what I originally intended.

What I am actually looking for to start with though is the math equation that will give me the intercept course to the target aircraft as well as the VS to reach target altitude at intercept.

I want to calculate a real time intercept bearing and VS and display that updating information to the pilot by some mechanism, eventually in a manner realistic to the terminology you introduced me to. The data will also be available to developers in the way of properties to use in whatever aircraft systems they desire.

To begin with, I plan to send to the Incident Report Dialog the following information.
The target aircraft's range, heading, speed and altitude. Possibly the initial intercept bearing.

Once we have all this, anyone, or myself, can implement any kind of routine for an intercept with the information.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7587
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Announcing Mission Generator Addon

Postby erik » Sun Sep 26, 2021 8:40 am

wlbragg wrote in Sat Sep 25, 2021 6:32 pm:I need the math to vector your chosen aircraft that your running in the sim to the AI target.


It's best to use matrices for this (do this for both yourself and the bogey):
  1. Construct en velocity vector using the heading, velocity value and climb speed.
  2. Create a Cartesian XYZ position from latitude, longitude and altitude.[1]
  3. Create a matrix and rotate it using the normalized velocity vector.
  4. Transpose the matrix using the XYZ position.
    Now you have two position-and-orientation matrices.
  5. Invert the me-matrix
  6. multiply by the bogey-matrix
The resulting matrix contains the relative velocity-vector and relative position of the bogey to yourself.
The relative distance can now be calculated from the relative position:
Code: Select all
dist = sqrt(x*x + y*y+ + z*z);

By the way, there is also a track_target.nas which might contain all you need.

Erik

[1]
Code: Select all
var xyz = geodtocart(me._lat * R2D, me._lon * R2D, me._alt); // see geo.nas
Current: Parachutist, Paraglider, Pterosaur, Pilatus PC-9M and variants, ERCO Ercoupe, Fokker Dr.1, Fokker 50, Fokker 100
Less active: Cessna T-37, T-38, Santa Claus. Previous: General Dynamics F-16. Worked on: Wright Flyer
erik
 
Posts: 2244
Joined: Thu Nov 01, 2007 2:41 pm

Next

Return to Add-ons

Who is online

Users browsing this forum: No registered users and 3 guests