Board index FlightGear Development New features

plugins

Discussion and requests for new features. Please note that FlightGear developers are volunteers and may or may not be able to consider these requests.

plugins

Postby Mike4Linux » Mon Mar 15, 2010 10:25 pm

Hi
can i program C++ plugins like in X-Plane? This is very handy for a lot of things...
Thanks
Michael
Mike4Linux
 
Posts: 79
Joined: Sat Mar 13, 2010 8:48 am

Re: plugins

Postby AndersG » Mon Mar 15, 2010 10:32 pm

Mike4Linux wrote:Hi
can i program C++ plugins like in X-Plane? This is very handy for a lot of things...


There is no system for object code plugins (and I don't think we need one). FlightGear is free software and you are welcome to join the development. For many types of aircraft specific modelling FlightGear supports a scripting language called Nasal and you can really do a lot there without needing to touch the C++ side.

Cheers,

Anders
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: 2465
Joined: Wed Nov 29, 2006 9:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: plugins

Postby HHS » Mon Mar 15, 2010 10:41 pm

Mike4Linux wrote:Hi
can i program C++ plugins like in X-Plane? This is very handy for a lot of things...
Thanks
Michael


As AndersG already said a lot of things done per plugin for X-Plane can be made per Nasal script in FGFS. We say that everything is possible with a bit time and a nasal script.

As an example: X-Plane has a something like a "3d-manipulator" for knobs , handles etc. The aircraft author of the b1900d scripted something very similar with nasal for a manual which can pushed around weith the mouse in the cockpit. It can be quite easily aplied to other objects and aircrafts and be used for controlling anything. Just take a look into the b1900d and select "manual" from the b1900d menu.
Up, up and away
User avatar
HHS
Retired
 
Posts: 3615
Joined: Thu Jul 19, 2007 8:09 am
Version: GIT

Re: plugins

Postby Mike4Linux » Tue Mar 16, 2010 6:21 am

ok I never heard of nasal but I'll have a look.
Well I want to do something payware and I wonder how i could protect my work. In x-plane simple DRM can be achieved via plugin,
could I integrate DRM somehow in fgfs?
Thanks
Mike4Linux
 
Posts: 79
Joined: Sat Mar 13, 2010 8:48 am

Re: plugins

Postby SkyWlf77 » Tue Mar 16, 2010 4:43 pm

Mike4Linux wrote:Well I want to do something payware{...}


I'm not sure you'll find a whole lot of support here for this. FlightGear's entire concept is around being made available for free as an alternative to the horrifying costs associated with MSFS and X-Plane. Producing payware add-ons to FlightGear would damage that concept and hurt FlightGear's reputation overall.

-Jason
SkyWlf77
 
Posts: 624
Joined: Sun Jan 10, 2010 12:19 am
Location: Central Illinois
Callsign: SkyWlf77
Version: 2
OS: Windows 7 64-bit

Re: plugins

Postby martin » Tue Mar 16, 2010 4:55 pm

SkyWlf77 wrote:
Mike4Linux wrote:Well I want to do something payware{...}


I'm not sure you'll find a whole lot of support here for this.


Additionally, I'd recommend to read the GPLv2 license text quite thoroughly before building a business onto a project that requires to "link" payware into the FlightGear program executable,

Martin.
FlightGear Scenery Release Manager
martin
 
Posts: 666
Joined: Thu Feb 15, 2007 9:03 am
Location: EDLN

Re: plugins

Postby AndersG » Tue Mar 16, 2010 5:08 pm

On the other hand I don't think there is anything that prevents the creation of none-redistributable payware content for FlightGear but it would have to be protected using legal rather than technical means.

Cheers,

Anders
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: 2465
Joined: Wed Nov 29, 2006 9:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: plugins

Postby Mike4Linux » Wed Mar 17, 2010 6:33 am

martin wrote:commend to read the GPLv2 license text quite thoroughly before building a business onto a project that requires to "link" payware into the FlightGear program executable,
Martin.


I don't see any problems...am i wrong?

AndersG wrote:t it would have to be protected using legal rather than technical means.
Anders


Putting on a copyright?

Without knowing nasal I suppose C++ to be much more powerful. I doubt for ex. g2xpl etc. could be done in nasal?
Wheter open or closed source....I think this limits this sim.
Mike4Linux
 
Posts: 79
Joined: Sat Mar 13, 2010 8:48 am

Re: plugins

Postby DFaber » Wed Mar 17, 2010 7:07 am

Mike4Linux wrote:Without knowing nasal I suppose C++ to be much more powerful. I doubt for ex. g2xpl etc. could be done in nasal?
Wheter open or closed source....I think this limits this sim.


and who will port your c++ libraries to all platforms FG runs on?

Features which only run on certain OSes limit the sim.


Greetings
Detlef Faber
FlightGear Development:
http://flightgear-de.net

my 3D-Art:
https://www.sol2500.net
DFaber
 
Posts: 706
Joined: Fri Dec 01, 2006 7:51 pm
Location: Aachen, Germany
Version: GIT
OS: Linux

Re: plugins

Postby Mike4Linux » Wed Mar 17, 2010 7:24 am

Me... :D I'm running Vista64, Linux and Darwin on my PC.
Mike4Linux
 
Posts: 79
Joined: Sat Mar 13, 2010 8:48 am

Re: plugins

Postby Hooray » Wed Mar 17, 2010 12:00 pm

can i program C++ plugins like in X-Plane? This is very handy for a lot of things...


FlightGear doesn't have support for binary plugins, while adding such support is possible and not even that complicated, it would be a pretty bad idea:

FlightGear supports a fairly powerful (and high level) scripting language to provide extensibility - dynamically linking to binary plugins (DSOs, DLLs) however is highly platform specific stuff and has also many other disadvantages (e.g. mutual library dependencies and versioning requirements).
Not to mention, that plugin developers need to be able to build/compile their modules before using them.
Nasal scripts on the other hand "just work" by dropping them into the base package folder.

Instead, FlightGear is usually extended by either using its support for Nasal scripting or by adding C++ code to the source tree, or a combination of both approaches.

On the other hand, it is only since fairly recently, that there are discussions going on in the Xplane community to also add scripting means to their simulator, ironically by the use of a python plugin specifically for scripting: ;-)

What we need is a scripting system. The scripting system would provide a relatively simple text-file syntax to do simple scripting of systems and instruments for airplanes.
http://xplanescenery.blogspot.com/2009/ ... -sand.html


Now look at that decision: They have like how many years experience working with binary plugins? How come they still intend to support scripting, probably because it's the better solution!

So, in this aspect, FlightGear is really years ahead of the other two large flight simulators, both of which provide fairly limited scriptability.

Also, you cannot circumvent the requirements of the GPL 2, so any binary modules (plugins) linked into GPL'ed software, need to be GPL'ed too - which requires the corresponding source code to be also distributed along with any binary releases.

If you want to add new features to FlightGear, the usual way is to add a new subsystem - for an example of how this is done, you may want to search these forums for the discussion on "ridge lift" that took place about a year ago, which shows how the fellow forum member "WooT" implemented support for ridge lift by adding a new subsystem to FlightGear, see these threads for details:

viewtopic.php?f=6&t=3377
viewtopic.php?f=6&t=4706

Of course, all such modifications to FlightGear will also need to be GPL'ed - this applies also to any other libraries that you may want to link into FlightGear. This does have the added advantage that your code will eventually be added and maintained in the official CVS version of FlightGear.
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: 12166
Joined: Tue Mar 25, 2008 8:40 am

Re: plugins

Postby Mike4Linux » Wed Mar 17, 2010 4:56 pm

Hooray wrote:Also, you cannot circumvent the requirements of the GPL 2, so any binary modules (plugins) linked into GPL'ed software, need to be GPL'ed too - which requires the corresponding source code to be also distributed along with any binary releases.


but I can make a copyrighted, payware aircraft however? In fact what formats could I use in Blender? Any formats with no
importers to any 3D applications? Any limitations on the formats?
Thanks
Mike4Linux
 
Posts: 79
Joined: Sat Mar 13, 2010 8:48 am

Re: plugins

Postby Gijs » Wed Mar 17, 2010 5:07 pm

Mike4Linux wrote:Any formats with no importers to any 3D applications? Any limitations on the formats?

I don't believe FlightGear supports such formats, but hey, it's opensource, so you can add support for it!
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9374
Joined: Tue Jul 03, 2007 2:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: plugins

Postby Tuxklok » Wed Mar 17, 2010 5:36 pm

Mike4Linux wrote:but I can make a copyrighted, payware aircraft however? In fact what formats could I use in Blender? Any formats with no
importers to any 3D applications? Any limitations on the formats?
Thanks

In theory you can use any format OSG supports, how well that works in practice is another question though. If you are thinking about using some obscure format to somehow protect your work then you are believing in a false sense of security however. No matter what format, no matter how obscure you make things, no matter how many loops you jump through, it can and will be gotten if somebody wants it. Security by obscurity is not security at all...just a waste of time and effort.

cheers
The Austria Scenery Project - more info
fg-scenery-tools - gitorious | videos
fgcomgui - Open source, cross platform, gui front end for fgcom. more info

More random musings and doings can be found on my personal site. (work in progress)
User avatar
Tuxklok
 
Posts: 1321
Joined: Tue Apr 21, 2009 6:04 pm
Location: Orlando, FL
Callsign: Tuxklok / N1292P
OS: GNU/Linux

Re: plugins

Postby Hooray » Wed Mar 17, 2010 5:43 pm

ok I never heard of nasal but I'll have a look.


You will want to check out the wiki:

http://wiki.flightgear.org/index.php/Na ... g_language

Well I want to do something payware and I wonder how i could protect my work. In x-plane simple DRM can be achieved via plugin
could I integrate DRM somehow in fgfs?


LOL, normally I would advise you to check back with the developers mailing list for development related questions, but this question would become a great flamewar :-)

DRM in FlightGear, this idea will be frowned upon, and rightly so.

FlightGear in its current form is a product of numerous people working voluntarily on a joint effort to create an open and extensible flight simulator platform. Your very idea of introducing DRM, is against all principles of open source in general.

Adding support for DRM to FlightGear is not going to happen - Nasal scripts are provided in plain text format by default (similar to JavaScript), while obfuscation is of course possible - it doesn't make any sense in the context of FlightGear as an open source project.

Also, scripts can be easily shared and run by users just by exchanging or copying them.

Even if you were to dump intermediate Nasal bytecode to an object file and execute this using the Nasal VM, there would be no way of enforcing DRM.

Of course, FlightGear being open source, you could also just add support for DSOs/plugins to a fork of FlightGear and base all your work on this fork - on the other hand, your modifications would still need to be made available.

I also recommend to really check out the GPL v2 FAQ, because you don't seem to be familiar with the relevant details and restrictions.

but I can make a copyrighted, payware aircraft however? In fact what formats could I use in Blender? Any formats with no
importers to any 3D applications? Any limitations on the formats?


I am not sure if you actually know what you are talking about: how exactly do you intend to create a 3D model of an aircraft without the ability to import, edit and save it??
Are you planning to hardcode the aircraft in C++ and dump the scenegraph??
I still don't get it. And once a 3d model can be loaded into FlightGear, it can also easily be further processed.

Apart from that there is nothing that keeps you from creating payware aircraft for FlightGear, as long as you are not importing GPL'ed code (i.e. Nasal modules).

Good luck with that
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: 12166
Joined: Tue Mar 25, 2008 8:40 am

Next

Return to New features

Who is online

Users browsing this forum: No registered users and 1 guest