Board index FlightGear Development Add-ons

Announcing Mission Generator Addon

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

Re: Announcing Mission Generator Addon

Postby Hooray » Sun Sep 26, 2021 8:49 am

See geo.nas it already has most of the stuff you need, the rest can probably be found in tanker.nas
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 » Sun Sep 26, 2021 5:16 pm

track_target.nas may be all that I need. I think that is the one I was referencing in a prior post. I just didn't remember if it was a function in fgdata that I was using, or something I made. I think I might have tied into track_target, back when. I'll take a look, Also looking at tanker.nas, thanks!
Much better not having to reinvent the wheel.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7609
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 » Sun Sep 26, 2021 7:13 pm

After looking at target_track.nas it's probably got some of what I want. But it is not "predictive". It won't vector you to a future point. However tanker.nas might, I need to study that a little better.

Before I go to far down either path, @erik, is there anything you would like to suggest or request or add to the discussion seems how your the one that brought up this potential mission?
Like, how you want to be vectored? Is following a targets current location sufficient, or do you want to know the "fastest intersection" course. The data could potentially contain feasibility of intercept. For example if your in a Cessna and the target is a Heavy, you may not be able to catch it at all, even with the fastest intersection course.
I'd like to cover as wide a range as possible in as limited a resource overhead as possible. I assume your mostly interested in military intercept, where speed is not a problem. But I can also see a use for civilian intercept.

What I am wanting to do, in the short term, is get the basics in place and others can build upon it at a future time if so desired. Like I said, any of this stuff could be really complex and contain all the bells and whistles you can dream up. But if I can provide the basic data needed, anyone can use it for more elaborate mission addons in the future.

I can also envision just tying target_tracker.nas to it's own mission line item. Give it a simple PUI to input the requested configuration to use it. In fact, I probably should just do that first.

Dang rabbit holes. What I maybe should do is make target_tracker.nas into a stand alone addon? Then tie to it with the mission generator addon. Same type of tie I use with wildfire and the Mission Generator.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7609
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 » Sun Sep 26, 2021 9:10 pm

https://sourceforge.net/p/flightgear/ma ... /37356665/
wlbragg wrote:hus my dilemma, what I am indecisive about is whether or not users will want to have to load several addons to get certain functionality?
[...]
What is the best way forward now that we have the addon framework and someone is willing to convert some of the nasal tools?


Speaking in general, you will probably want to identify useful functionality and refactor/turn such functionality into a separate library/module, which can then be used by your addon, or other modules.
That is also something that is long-standing idea, e.g. a generic "AI" module for stuff like tanker.nas or fox2.nas, i.e. modules that use Nasal to create/control AI objects.
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 » Mon Sep 27, 2021 1:05 am

identify useful functionality and refactor/turn such functionality into a separate library/module

In what manner? Like a combined nasal library of function that you can call any individual function instead of addons?
Or add that library of functions under the Missions addon umbrella?
I don't completely understand what your referring to.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7609
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 » Mon Sep 27, 2021 4:57 am

it's actually fairly straightforward: let's assume you find a handful of parts useful in other addons/scripts - you'd then go and copy/paste those into a new module (let's call it "interception_calcs.nas" for now).

Next step would be to generalize what you copied/pasted so that it can work in a standalone fashion, i.e. by removing hard-coded assumptions originating from the original script (let's suppose you are reusing stuff found in tanker.nas/fox2.nas) - obviously, any copied code will be somewhat specific to the original use-case.

Thus, you would remove such hard-coded assumptions and generalize the copied code so that it works without the original script.

A simple way to do just that is to add a corresponding "test_foo()" function to your new module/library.

For instance, for the interception tracking, you could add a test function that tracks/calculates known numbers - that can then be easily tested.

So, once your copied code is sufficiently generic, and can be executed standalone (say via the Nasal console), you can easily test if it works properly.
At that point, you can use your new module/library in other addons - and once you are satisfied it works correctly, you can also remove (comment out) the corresponding section in other modules, i.e. those from where you copied the original code - because once you have successfully generalized these routines, you have now "refactored" the original code and turned it into a generic, and reusable, component - that you can simply use via a library call (analogous to how geo.nas provides functionality to other scripts)

That's basically the whole process, and it sounds more complicated than it really is.

You could start by experimenting with a single function that you find useful, and then take it from there, step by step.
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 benih » Mon Sep 27, 2021 10:39 am

Three maybe interesting mission types for small ga planes could be:
- charter flight persons to another airport
- express delivery of goods
- tourist trips that start and end at the same airport and will show the scenery to tourists (ie stay in the air for some time, and fly to a nearby poi/mountain/town/lake/etc)


Edit: oh and of course maybe fly up parachuters that will drop off at a designated altitude and area
User avatar
benih
 
Posts: 1711
Joined: Tue Aug 15, 2017 10:34 am
Callsign: D-EBHX
Version: next
OS: Debian Linux 64bit

Re: Announcing Mission Generator Addon

Postby Bjoern » Mon Sep 27, 2021 7:30 pm

Helicopter:
- Medevac (requires location data for hospital helipads and maybe roads)
- Oil rig or ship supply missions, if you can access the locations of these objects
- Scenery object inspection flights (power lines, wind turbines, coast lines for oil spills)

Helicopter/airplane:
- Maritime surveillance (monitor suspicious ship)
- Anti-Submarine Warfare (find a submarine)
- Flying a randomly generated amount of cargo to a randomly or user picked airfield

Airplane:
- Flight testing (do maneuver x, go to max velocity at a given altitude)


Ideally, this would all be tied into a persistent progression system for skill points and/or money that can be spent on higher difficulty missions and maintenance.

But I'm dreaming here...
Bjoern
 
Posts: 484
Joined: Fri Jan 06, 2012 11:00 pm
Location: TXL (RIP)
Version: Next
OS: ArchLinux

Re: Announcing Mission Generator Addon

Postby portreekid » Tue Sep 28, 2021 5:20 am

Bjoern wrote in Mon Sep 27, 2021 7:30 pm:Helicopter:
- Medevac (requires location data for hospital helipads and maybe roads)
But I'm dreaming here...

I came up with some overpass magic for a fguk flight Night.
https://github.com/Portree-Kid/HelipadsScotland. If the NavDB has a possibility to add HeliPads dynamically you query it on the fly.
portreekid
 
Posts: 651
Joined: Tue Jan 14, 2014 4:36 pm
Location: Leipzig
Callsign: PORTREE
Version: 2020.2.1
OS: Windows 10

Re: Announcing Mission Generator Addon

Postby benih » Tue Sep 28, 2021 8:02 am

Bjoern wrote in Mon Sep 27, 2021 7:30 pm:Ideally, this would all be tied into a persistent progression system for skill points and/or money that can be spent on higher difficulty missions and maintenance.

Maybe a good idea to keep that separated could be some sort of plugin mechanism that the mission generator provides.
This way, other plugins can register "interest" in specific events of the mission framework (like: mission completed->function of registered callable-plugins are invoked).
User avatar
benih
 
Posts: 1711
Joined: Tue Aug 15, 2017 10:34 am
Callsign: D-EBHX
Version: next
OS: Debian Linux 64bit

Re: Announcing Mission Generator Addon

Postby Hooray » Tue Sep 28, 2021 3:42 pm

addons supporting plugins might be a little far-fetched - what you described would be best achieved using something like Emesary, you'd basically have a way to register "Objectives" and receiver would subscribe to related events/messages.

https://wiki.flightgear.org/Emesary
Image
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 » Thu Sep 30, 2021 5:59 pm

scramble mission to intercept an unidentified or hostile aircraft

- charter flight persons to another airport
- express delivery of goods
- tourist trips that start and end at the same airport and will show the scenery to tourists (ie stay in the air for some time, and fly to a nearby poi/mountain/town/lake/etc)

Helicopter:
- Medevac (requires location data for hospital helipads and maybe roads)
I came up with some overpass magic for a fguk flight Night.
https://github.com/Portree-Kid/HelipadsScotland. If the NavDB has a possibility to add HeliPads dynamically you query it on the fly.
- Oil rig or ship supply missions, if you can access the locations of these objects
- Scenery object inspection flights (power lines, wind turbines, coast lines for oil spills)

Helicopter/airplane:
- Maritime surveillance (monitor suspicious ship)
- Anti-Submarine Warfare (find a submarine)
- Flying a randomly generated amount of cargo to a randomly or user picked airfield

Airplane:
- Flight testing (do maneuver x, go to max velocity at a given altitude)


I want to keep all ideas at the end of this thread so it is easy to find. I'll keep adding or deleting if adopted. Thanks for all the suggestions.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7609
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 » Mon Oct 04, 2021 3:04 am

What is the easiest way to get MP aircraft data when logged on to an MP server? I didn't see a list of MP aircraft in the property tree. I assume there is another way to get that data?

I'm looking for aircraft ID, position, speed altitude heading, etc.

Is that data available anywhere using nasal, even if I have to write calls to get it?
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7609
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 AndersG » Mon Oct 04, 2021 7:14 am

Isn't the AI aircraft information in the properly tree? /ai/models/multiplay [x] ?
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2527
Joined: Wed Nov 29, 2006 10:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: Announcing Mission Generator Addon

Postby Hooray » Mon Oct 04, 2021 9:14 am

Yes it is, Anders is right. See the wiki tutorial on processing AI traffic via Nasal
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

PreviousNext

Return to Add-ons

Who is online

Users browsing this forum: No registered users and 2 guests