Board index FlightGear Development Aircraft

Aircraft Development Tutorial Step by Step

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

Aircraft Development Tutorial Step by Step

Postby openflight » Thu Jun 04, 2020 3:30 pm

I would like to update the documentation so far on aircraft development - for the most recent versions - how do I proceed>
I see that the aircraft 3D how to distributed with FG is still the 2002 version:

Mini-HOWTO: 3D Aircraft Models in FlightGear
11 March 2002
David Megginson

There are various articles that cover this, but I feel I can give a step by step approach for at least getting a 3D model into FG and tweaking some FDM settings.

Flight Gear documentation if you have installed Flight Gear

drive_c/Program Files (x86)/FlightGear/docs/model-howto.html
Flight Gear Wiki article
JohanG's article on Wiki
Flight Gear Forum discussion
Modelling Getting started article on Wiki

First Draft
https://sites.google.com/site/flightgearone/quickstart-for-aircraft-creation


Of course it would be a group effort.

How to proceed?
openflight
 
Posts: 454
Joined: Fri Sep 16, 2011 11:14 am
Version: 1 2 2018
OS: Linux Mint 19.3

Re: Quick Start for Aircraft Development

Postby openflight » Fri Jun 05, 2020 12:58 am

Full draft is copied and pasted here for reference so you can see where I am going with this:

Target publishing location:

    Flight Gear Wiki
    Docs folder of every Flight Gear release (with your permission)


Quickstart for aircraft creation

Introduction

You have downloaded and installed Flight Gear, and flown the aircraft. You may be wondering how to create an aircraft and add it into Flight Gear. This tutorial will help you get started.

The existing documentation for aircraft creation is somewhat varied and technical, and I will post links to it at the bottom of the page. With this tutorial you will be able to have your aircraft flying in Flight Gear in no time. Aircraft "painting" or textures will have to be covered in a separate section.

The First Step:

The first step is to find an aircraft that actually works in Flight Gear. Modifying an existing aircraft avoids many of the errors and pitfalls of the aircraft creation process.

Step 1: Download a suitable aircraft: I have chosen the Mirage 2000 created in 2006, a simple enough model that works. The main thing is it does not have too many files in it.

The aircraft can be downloaded here:

Download the aircraft and copy it to the Flight Gear aircraft folder and unzip or uncompress the file here. You will end up with a folder named m2000.

This folder contains the following files: under m2000


Under models there is a separate set of folders also.

Load and test fly the aircraft to make sure everything is working. This is an aircraft with a 2D panel, which we will correct later.

As a first step, we will change the aircraft model to that of another similar aircraft, just to check if changing the aircraft process works properly.

Go to an aircraft in the Aircraft folder, such as the T-38 and copy

the T-38 model to the model folder of the m2000. Not so much a similar aircraft but a jet nonetheless and will do for the moment.

The settings have to be changed in the model folder to refer to the new model, so open up the m2000.xml file in the model folder and change the following lines.

<path>mirage2000.ac</path>

<path>T38.ac</path>

Make sure T capital, or FG will load the previous model in FGRUN it happened to me:

You will see the T-38 m model inside the FGRN launcher with some textures missing. No matter, we will get there

Image

Take off with the aircraft and do a few rolls and loops . The landing gear is out, and cannot be retracted, ( we will get to this under animations ) and no control movements are seen. You have, however a working model in Flight Gear.


Time to create your own modle mow, even if it just simple aircraft. In fact, lets create a simple cube and then move on to another aircraft model entirely.
Last edited by openflight on Sun Jun 07, 2020 10:33 am, edited 1 time in total.
openflight
 
Posts: 454
Joined: Fri Sep 16, 2011 11:14 am
Version: 1 2 2018
OS: Linux Mint 19.3

Re: Aircraft Development Tutorial Step by Step

Postby D-ECHO » Fri Jun 05, 2020 6:47 am

In my opinion, the best location for this would be indeed the wiki. Without wanting to insult, but imo it isn't "important" enough to further increase the size of fgdata. But this is of course up for discussion and I am not a person that decides what goes in and what doesn't.

http://wiki.flightgear.org/Howto:Make_an_aircraft this article touches the topic very well, imo. You could decide to try and improve this article, or, if you want it to be going into another direction (e.g. focus on the step-by-step approach), I'd say it's best to create a new article, e.g. Howto:Aircraft development step by step (or so).
User avatar
D-ECHO
 
Posts: 2058
Joined: Sat May 09, 2015 12:31 pm

Re: Aircraft Development Tutorial Step by Step

Postby openflight » Fri Jun 05, 2020 7:12 am

Thanks, appreciate the comments. Not much of a size increase, if it is an HTML file.

Also have to look at communications path > new user > wants to create aircraft > where does he go ? Google ? Docs?
openflight
 
Posts: 454
Joined: Fri Sep 16, 2011 11:14 am
Version: 1 2 2018
OS: Linux Mint 19.3

Re: Aircraft Development Tutorial Step by Step

Postby D-ECHO » Fri Jun 05, 2020 11:18 am

I'd say a new user would probably come either to google or the forum, normally. From both of these, he can be pointed to the wiki.
User avatar
D-ECHO
 
Posts: 2058
Joined: Sat May 09, 2015 12:31 pm

Re: Aircraft Development Tutorial Step by Step

Postby Octal450 » Fri Jun 05, 2020 2:14 pm

Why is this suggesting taking other planes and models and merging? That's not how to make aircraft, that's how to merge aircraft. (Which I don't suggest as it's unrealistic)

Kind Regards,
Josh
What I do: Flight Dynamics, Systems, Canvas Displays, Autoflight, FlyByWire, Cockpit Animations
Aircraft I currently develop: MD-11 (Mainly), A320-family, Secret (Quality over Quantity)

My GitHub|MD-11 and ITAF Dev Discord|Airbus Dev Discord
User avatar
Octal450
 
Posts: 4635
Joined: Tue Oct 06, 2015 12:51 pm
Callsign: WTF411/Octal
Version: next
OS: Windows 10 x64

Re: Aircraft Development Tutorial Step by Step

Postby openflight » Sun Jun 07, 2020 9:49 am

Originally I planned to write about how to create an aircraft starting from one file, the 3D model, upwards. Add the FDM, the animations and so on. There are two problems with this approach:

1. There is a chance the model would not work at all, due to an error in a line here or there.
With working model, if it does not work after a change, it is down to the last change that was made.

I have had several years of trying and the above approach works the best, has the best chance of success.

2. It is easier to modify code that already exists - for example making landing gear retract, again with fewer errors - than adding the code from nothing.

Merging was used as an example - my future example would cover merging a new 3D model and then changing the settings,
openflight
 
Posts: 454
Joined: Fri Sep 16, 2011 11:14 am
Version: 1 2 2018
OS: Linux Mint 19.3

Re: Aircraft Development Tutorial Step by Step the FDM

Postby openflight » Sun Jun 07, 2020 10:25 am

The Flight Model

You may have heard about the flight model for a flight simulator. In Flight gear on any other simulator, it is the file that stores information on how the plane is to behave, how to respond to controls, throttle input, and so on. Any plane will roll left or right or go up and down when the control yoke is moved left or right or backwards and forwards, but how much it does is something that is configured in the flight model file. The flight dynamics file or FDM consists of settings such as the mass of the aircraft and the wing area and many other parameters that are used by the flight simulator program to come up with a reasonable behaviour for the aircraft.

In our Mirage 2000 model, have a look at the files in the root folder: there is one innocuously named 'mirage2000.xml'. This model file has all the settings needed for the aircraft to fly. There are no dependencies on what the model actually looks like, in fact, I have flown a cube in flight gear. There may with JBSIM an engine file separately that s all.

You could, in principal, replace the FDM configuration file for the Mirage2000 with one of the Cessna 172. You would have to change this line in the -set file. Or, as I did successfully, make the Mirage 2000 fly like a Mirage 5 with this change:

<flight-model>jsb</flight-model>

<aero>mirage2000</aero>

to

<flight-model>yasim</flight-model>

<aero>mirage5-yasim</aero>

Copy the mirage5-yasim file to the mirage2000 folder and you are done.

What was it like to use the new configuration file? There were no problems or errors at all from the Flight Gear Software at all. The Mirage took much more time to accelerate to take off speed, and was not so prone to speed up when full throttle was engaged. The pronounced nose up attitude typical of a delta aircraft was very noticeable, unlike the previous jbsim flight model, which was a welcome change. It seemed that the YASIM FDM was more suitable to this aircraft, so I thought I would keep it with a few modifications. This is the advantage of having a flight configuration file separately from the simulator.

Image

The mirage2000 folder as it appears in my computer. The mirage2000-set.xml is the main settings file, which specifies the path to the model files and also the FDM. The aforementioned FDM is simply named mirage2000.xml. Ideally it should be named mirage2000_FDM_jbsim.xml to avoid confusion. There are some extra files that will be explained later.
openflight
 
Posts: 454
Joined: Fri Sep 16, 2011 11:14 am
Version: 1 2 2018
OS: Linux Mint 19.3

Re: Aircraft Development Tutorial Step by Step

Postby Hooray » Sun Jun 07, 2020 10:46 am

Actually, $FG_ROOT/Docs is the right place - and always has been the right place. Let's keep in in mind that this is where all documentation used to be stored. Compared to said file, both the forum, the wiki and even the "manual" are fairly recent additions.

These days, the wiki would obviously not be a bad idea.

But also keep in mind that should the forum or the wiki ever suffer from data loss (think corrupted database), that what's in git is backed up in a distributed fashion, i.e. across every single machine where fg/sg/fgdata were ever cloned to. This scenario may admittedly seem far-fetched, but let's also keep in mind what happened during the time of the mapserver debacle, which also was a central, server-based, setup to store important data - thus, keeping things in fgdata really isn't such a bad idea - if you still want to use formatting/images, you can obviously use HTML or use LaTex instead - in fact, we ended up using plaint text files and simply created a LaTex file that included those to generate a PDF automatically.


That kind of setup would also work for such a tutorial.

Again, this may seem inflexible at first - but "size" really is not an issue, and these README files have been part of CVS almost since day one.

The mere fact that someone steps up to volunteer updating and maintaining a tutorial that was contributed 18+ years ago, is a testimony to the approach taken here, i.e. keeping important/useful documentation WITH the sources, rather than using separate hosting forms (hundreds of which have disappeared over the years)
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: 11791
Joined: Tue Mar 25, 2008 8:40 am

Re: Aircraft Development Tutorial Step by Step

Postby D-ECHO » Sun Jun 07, 2020 11:19 am

While I agree with your points, again without wanting to degrade you here, openflight, imho this tutorial-style and more prosa than technical write-up, coupled with the fact that the approach mentioned here is discussable and that many statements are very simplified (not necessarily a bad thing), it would more constitute a howto than an official documentation, which I'd expect to be concise, technical and exact. But that's just my opinion/approach.
User avatar
D-ECHO
 
Posts: 2058
Joined: Sat May 09, 2015 12:31 pm

Re: Aircraft Development Tutorial Step by Step

Postby Hooray » Sun Jun 07, 2020 11:27 am

these days, there are obviously many options - for instance, a few screen shots, animations or even a youtube video can go a long way - and it's really easy to take an outdated tutorial and bring it up to scratch by using "new" features/aircraft - especially in conjunction with google's/youtube's support to automatically translate videos into different languages, people can have a much a greater impact this way
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: 11791
Joined: Tue Mar 25, 2008 8:40 am

Re: Aircraft Development Tutorial Step by Step

Postby openflight » Mon Jun 08, 2020 4:02 am

D-ECHO wrote in Sun Jun 07, 2020 11:19 am:While I agree with your points, again without wanting to degrade you here, openflight, imho this tutorial-style and more prosa than technical write-up, coupled with the fact that the approach mentioned here is discussable and that many statements are very simplified (not necessarily a bad thing), it would more constitute a howto than an official documentation, which I'd expect to be concise, technical and exact. But that's just my opinion/approach.


Hello. Yes it is written in a simpler more conversational style, speaking as someone who comes to this from a non-hard core C++ development background or similar ( I am not saying you all are) I am targeting the absolute beginner who has no coding background, even XML. It is possible, due to the modular approach taken by Flight Gear, for a beginner who can copy and paste files and edit text to actually create or modify a new aircraft.

I am fine putting this out as a how to , and I would be very pleased for my How -to to be included in the root folder of docs.

Much of what is written here is the culmination of years of work, aircraft not loading, aircraft flying in strange ways, and numerous failed attempts to modify and create aircraft. It is only now that I have got the dependencies worked out (a dependency diagram is in the works) and the non-standard folder structures do not help, for example the FDM and model files are both given the same name, and the header does not give an indication of what file it is, further confusing the user.

I hope my tutorial will help new users create their own aircraft or maybe more to the point, develop existing aircraft - for example I downloaded the SAAB Draken recently and it had no instrument panel.

I am very impressed and pleased with the entire FG project, I have tried other sims, one for example where the aircraft was climbing at 600mph in idle. Flight Gear has a nice feel to it, at least the aircraft, and a great community. In a word, FG suffers from the following:

    Incomplete aircraft
    Incompatible aircraft
    Outdated or incomplete documentation that is too technical

I hope I can help solve these problems.
openflight
 
Posts: 454
Joined: Fri Sep 16, 2011 11:14 am
Version: 1 2 2018
OS: Linux Mint 19.3

Re: Aircraft Development Tutorial Step by Step

Postby openflight » Wed Jun 10, 2020 11:59 am

There is a Chapter List that got somehow lost:

Chapter 1 - Intro to Flight Gear
Chapter 2: First Flight and features
Chapter 3: Examining a working model and folder structure
Chapter 4: Other features - animations, scripting, help files
Chapter 5: Modifying the aircraft flight characteristics
Chapter 6: Modifying the 3D file
Chapter 7: Loading a new 3D mode
Chapter 8: Create your own 3D model
Chapter 9: Fine turning
Chapter 10: Coloring
Chapter 11: Textures
Chapter 12: Review
Chapter 13: Versions..
openflight
 
Posts: 454
Joined: Fri Sep 16, 2011 11:14 am
Version: 1 2 2018
OS: Linux Mint 19.3

Re: Aircraft Development Tutorial Step by Step

Postby Hooray » Wed Jun 10, 2020 12:52 pm

Since you mentioned your focus on beginners, I'd suggest to also target more of the basics - for instance, you mention 3D modeling, but you don't have a single topic that covers "images" per se - of course, you do mention textures, but you only mention those well after 3D modeling.

Personally, I think that most people would start out with simple texturing first.

For instance, one of the first things that newcomers can actually do EASILY is to take screen shots and turn those into splash screens: http://wiki.flightgear.org/Splash_screen

This kind of thing can be easily documented in various forms, and it could also be turned into a youtube tutorial.
It could cover different tools/platforms (think GIMP) so that people can get started contributing splash screens or updating/maintaining existing ones.

And then, there's the built-in "help" system - which is also XML based, that, too is easy to add too.
Then, we have checklists and tutorials.

Either of these provide for a much lower barrier to entry than walking people right away through the whole process of creating an aircraft from scratch - in fact, for the latter, it would kinda make sense to use a template based wizard instead, where people can specify an aribitrary -set.xml file to serve as a template for creating a new -set.xml - this could be done for different parts of the structure (fdm, 3d model, nasal, systems etc)

Which is to say, I'd tell people how to use $FG_ROOT/Docs and the wiki.
Next, introduce key configuration files and formats (PropertyList/XML).

And then, take it from there by showing them how they can change splash screens or other textures.

With that sort of background knowledge, it will become much more straightforward to tackle some of the other topics
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: 11791
Joined: Tue Mar 25, 2008 8:40 am

Re: Aircraft Development Tutorial Step by Step

Postby openflight » Thu Jun 11, 2020 12:13 am

Which is to say, I'd tell people how to use $FG_ROOT/Docs and the wiki.


Key point, yes maybe some info about sources of help as well, been some time since I was a computer newbie.

1984 to be exact.

Will look at all the other points...
openflight
 
Posts: 454
Joined: Fri Sep 16, 2011 11:14 am
Version: 1 2 2018
OS: Linux Mint 19.3

Next

Return to Aircraft

Who is online

Users browsing this forum: No registered users and 1 guest