Howto:Start core development

From FlightGear wiki
Revision as of 15:46, 3 January 2012 by Hooray (talk | contribs) (→‎Finally)
Jump to navigation Jump to search
This article is a stub. You can help the wiki by expanding it.
WIP.png Work in progress
This article or section will be worked on in the upcoming hours or days.
See history for the latest developments.

I have taken my forum response and copied/pasted it here. Everybody is invited to contribute. While we do have a Volunteer page, we don't currently have a page dedicated to people wanting to contribute to the C++ source code, so this is an attempt to get something like this started.

Welcome to FlightGear

Hi & welcome

Often, implementing new ideas and features doesn't necessarily require C++ knowledge, FlightGear has become so flexible and powerful that it is increasingly configurable even without touching the C++ source code.

This isn't to say that C++ / programming knowledge wouldn't be useful though. And if that's where your interests are, you are certainly invited to contribute to the C++ code, too.

For non coding-related ideas on how to to start contributing, there's a dedicated article here: http://wiki.flightgear.org/Volunteer

Initial advice

Our advice would be: Start small, start simple, communicate a lot

  • start making tiny modifications to existing stuff (aircraft, scenery, source code etc)
  • read the documentation (wiki, $FG_ROOT/Docs)
  • if you know you want to contribute to the source code, make sure that you are actually able to build FG from source, you can get help using the forum, the mailing list or the issue tracker
  • try to get to grips with how git works
  • register an account at gitorious
  • browse the issue tracker for bug reports/feature requests, help triage problems, maybe provide patches too?
  • subscribe to the developers mailing list, ask for advice/projects there
  • check out the wiki for ideas to get started
  • coordinate your effort with others, i.e. communicate your intentions and ask for advice
  • release early and often
  • don't get frustrated :-)

The source code

FlightGear itself uses the decentralized source code management system "git": http://wiki.flightgear.org/Git

If you know for sure that you'd like to fiddle with the core source code, you'll inevitably need to be able build FG from source, this is also documented in our wiki, a more recent article is to be found here: http://wiki.flightgear.org/Howto:_Build_FlightGear_with_NetBeans_using_CMake

You can find tutorials for different platforms/OS at the end of the article.

Patches

Regarding patches, please see: http://wiki.flightgear.org/Submitting_Patches Note that this is somewhat depreciated and these days using gitorious (and filing merge requests) is pretty much encouraged.

In general, gitorious is the entry point here: http://gitorious.org/fg/

Issue tracking

Ideas (feature requests actually) and bug reports are ideally reported using the issue tracker here: http://flightgear-bugs.googlecode.com/

This is also an excellent place to get started helping and contributing to FG, i.e. by triaging bug reports, discussing feature requests, posting patches or finding new ideas to work on. This is also a very good place to get in touch with other core developers.

Talking to fellow FlightGear developers

Most core development related discussions are handled using the developers mailing list: http://www.flightgear.org/mail.html

There's a fully searchable archive available here: http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/

Fiddling with flight dynamics

Improving the flight dynamics often doesn't require any C++ changes, FlightGear provides a powerful FDM interface and different FDM engines (namely JSBSim and YaSim), both of which are entirely configurable by using XML files.

For JSBSim, please see: http://jsbsim.sourceforge.net/

Important docs

There's a wealth of documentation to get you started available in $FG_ROOT/Docs


Even more documentation can be found in our wiki, here: http://wiki.flightgear.org/ The wiki is partioned into different "portals", you'll probably be interested in the developers portal here: http://wiki.flightgear.org/Portal:Developer

Project architecture

FlightGear itself consists of a number of different projects and dependencies (libraries), please refer to gitorious for details. Most of FlightGear's supporting code is increasingly getting moved to the "SimGear" project.

FlightGear

In many parts, the FlightGear code base is still somewhat archaic and not very modern, so you won't find too many occurrences of really advanced C++ concepts, in many places you'll just find simple "C with classes" uses, some STL and inheritance. But complex C++ features (such as advanced templates or meta-programming are not too common actually).

Programming resources

The wiki has plenty of programming resources of stuff to get you started though: http://wiki.flightgear.org/Resources

SimGear

The SimGear code base is somewhat less archaic and more modern actually. And if you are interested in contributing to the OpenGL/SceneGraph department, you'll inevitably need to look into OpenSceneGraph (OSG), too - which really is "modern C++".

Non C++ components

If you'd just like to get started quickly, there are also certain FG components that are strictly (largely) pure C, the Nasal interpreter is just one example (Nasal is FlightGear's built in scripting language): http://wiki.flightgear.org/Nasal_scripting_language

The Nasal interpreter is part of the SimGear project, and can be found in $SG_SRC/nasal

Getting started

Once you have found something you are interested in, you can search the wiki, archives (mailing list and forums) or the issue tracker to find suitable projects to work on, for example: http://code.google.com/p/flightgear-bugs/issues/list?can=2&q=nasal&colspec=ID+Type+Status+Priority+Summary+Aircraft+Milestone&cells=tiles

Talk about your plans

Before you start any serious efforts, please make sure to get in touch with other contributors. Ideally, using the developers mailing list or the forum. This is to ensure that others know about your plans, i.e. to avoid duplicate work, but also conflicting approaches.

Often, FlightGear developers have certain ideas and plans for their projects, so it's good to coordinate your ideas with fellow contributors. In addition, you can get valuable feedback from experienced contributors this way.

Nasal related

For Nasal in particular, we have also a page detailing it's most annoying issues here: http://wiki.flightgear.org/Improving_Nasal

If you are interested in fiddling with Nasal itself, i.e. by adding a handful of new commands to the scripting engine, this is documented here: http://wiki.flightgear.org/Howto:Extending_Nasal

None of this requires any C++ knowledge!

Adding new subsystems

If you are interested in adding new subsystems to FG, you may want to check out this: http://wiki.flightgear.org/Howto:Creating_new_Subsystems

The property tree

The FlightGear property tree is documented here: http://wiki.flightgear.org/Howto:Working_with_the_Property_Tree_API

Do you need to know C++ ?

Well, many new ideas or features won't require any modifications to the C++ source code at all. You could probably get started and implement many ideas without even touching an IDE or a compiler.

That might actually be the easiest route for you to proceed. Programming knowledge would obviously still be useful. The "Nasal" programming language built into FG is syntactically very close to C and C++ - so you could run your own code inside FG without having to build FG from source, no need for compilers or IDE. FlightGear IS the run time environment for Nasal code.

If you are looking for immediate results, Nasal is probably the most promising route - simply because you don't need to look into all the tedious, non-coding related issues.

The tutorial system built into FG is entirely implemented in scripting space, and fully XML-configurable: http://wiki.flightgear.org/Tutorials

This means that you can create/modify and improve tutorials just by editing plain text files.

There are many more things possible using Nasal, just see the wiki. And if you find something not being possible in scripting space, you could either fire up your IDE and extend the interpreter or ask another contributor to provide a corresponding patch.

Finally

...please don't get discouraged if you shouldn't get too much feedback in the beginning, probably many contributors are busy preparing the next release: http://wiki.flightgear.org/Release_plan