Showing posts with label Flight gear. Show all posts
Showing posts with label Flight gear. Show all posts

Friday, January 27, 2012

Complete step-by-step guide to installing flightgear 2.4 in Ubuntu(Update 2.6 is available now)


If you follow the guide completely you will be able to run the latest version of FlightGear (2.4) with a graphical user interface to select the aircraft, location of start, resolution of the program etc in Ubuntu.

Why a guide?

The version of FlightGear available from the Ubuntu repository is 2.0.0-4. This version is old, by about 2 yrs. Further more, FlightGear launch control, a GUI front end to FlightGear  which is used to customize the program start, is not available in the official Ubuntu repository. 


You can definitely install FlightGear from the source file but it creates a lot of blocks in the form of unfilled dependencies. Also if you install flight gear alone, simple tasks such as changing airplane, scenery or resolution becomes a daunting task. This is because without the Launch Control, you have to enter the customization commands manually to the terminal and a single spelling or syntax mistake will fail the opening of the program.

Below is a sample command I would have to enter if I want to fly a F-14 from runway 28R of San Fransisco International Airport at dawn, with a resolution of 1280*800 pixels to match my screen resolution.

fgfs --airport=KSFO --runway=28R --aircraft=f-14b --geometry=1280x800 --timeofday=dawn

If you make a single spelling or syntax mistake in any of these, the system will show an error and flight gear won't run.


Lanch Control simplifies this by entering these customizing commands to the terminal for you. You just need to select your preference from the Launch Control window and it will add a corresponding parameter to the terminal.


This tutorial to install flightgear 2.4 in Ubuntu was made out of an installation in Ubuntu 11.10 Oneiric Ocelot. But the same tutorial applies to Ubuntu 11.04 (Natty Narwhal) also. Guys with 10.10 and below are out of luck here as the PlayDeb only provides FlightGear 2.0 to you.

Ok enough of the introduction, Lets cut to the chase. 


1. Add PlayDeb Repository

Playdeb offers .deb files for Flightgear 2.4 and FlightGear Launch Control. Butyou have to add Playdeb repository to your trusted vendors to install them.



Steps to add playdeb repository

You can Add PlayDeb Repository to your trusted software vendor's list by one of the two methods below
 

Semi-Automatic way:

Install Playdeb package - use this link or go to the PlayDeb.net Page

You will be asked whether to save the file or not. Save it and then double click on it to install.

Installing the Playdeb package will add the address of the repository and the GPG key automatically.

Manual way : 


Go to Software Sources - Either Select Software sources from the programs list or open Ubuntu Software Center and Select Edit >> Software sources.
Select the Tab 'Other Software' and click on 'add' button
in the small window like the one below add 

deb http://archive.getdeb.net/Ubuntu oneiric-getdeb games


click on 'Add Source'. Now the archive is added.


now we have to add the GPG key. GPG keys are used to encrypt the transfer and to ensure that y
ou are downloading from playdeb itself.

Open up a terminal, paste the following command to the prompt and hit enter

wget -q -O- http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -
That hyphen in the end is necessary.

Note: If you clicked the 'Install' button from PlayDeb's FlightGear page, without adding the PlayDeb repository to your software sources list first, a software center will open but you will see a page to install FlightGear 2.0 only.

The video below has two sections showing different behavior of Ubuntu Software center before and after the addition of playdeb repository. First when Playdeb was not added the software center just got pointed to FlightGear 2.0 only. Later when the repository was added, the software center got pointed to the newest version available, ie, FlightGear 2.4





2. Update (Synchronize) the repositories and install FlightGear

Open up Update Manager and selet 'Check' button to update the repositories. This is to add files from the newly added playdeb repository to the software center.


After successful completion of the update, you can install FlightGear from either the Ubnutu software center. Now that the playdeb's programs are added to the list of available softwares, you will see FlightGear 2.4 instead of the previous 2.0.


Its a 480Mb download so will take some time to download install. But you don't have to download that much at a single stretch. As Ubuntu software center supports resuming, you can resume the download at anytime.


3. Install FlightGear Launch Control

When the download is completed, you can straightaway start playing FlightGear by selecing it from the games list. But you will be limited to only one plane, one location and one resolution.


If you want to change the plane, location or resolution, you need to do it as commands like I mentioned earlier. Here comes the use of FlightGear Launch Control (Equivalent to Flightgear wizard in windows).



FlightGear launch control can also be installed from the Software center. But the term you have to search is 'fgrun', not 'Launch control' or anything. Even searching for 'FlightGear' won't show up the launch control in the results

Tip: You may also install FlightGear Launch control( Search for fgrun in the search window) first. As the base FlightGear program is a dependancy to the launch control, it will also be installed. This way you don't have to install them separately. 


4. Configure FlightGear launch Control

You have to enter the locations of root folder and the flightgear executable manually when you first run the launch control. Here is the way of doing that.


Open FlightGear Launch Control you will be presented with a window like the below screenshot.




You only need to fill up the first two text boxes. If you get those correctly, rest will be filled up automatically.

Box 1 Labeled 'Executable' - Enter full path of FligtGear executable
Enter 

/usr/games/fgfs
in that box. 

Box 2 Labeled 'FG_ROOT' - Enter the path to the FlightGear root file ( equivalent to the program files in windows)


Enter 

/usr/share/games/flightgear 
in the box. Or you can use the folder icon on the right side of these text boxes to navigate to the mentioned folders yourself.


Update: The completed screen look like the screenshot below ( in Ubuntu12.04)


In the next screen you can select the aircraft of your choice


The select the location from the next screen



On the last screen you can select the display resolution display effects



You can see in the lower half, the commands that are going to be fed to the terminal to bring out the customizations.

Once you have selected your variables, hit Run. If everything was entered correctly, you will run the setting of choice in flight gear


Next time when you run FlightGear launch control, you will start with the page to select the aircraft. You don't need to enter the path details again.


Note: If you feel that the mouse button is too sensitive while in yoke mode (cross), Check out Change the Mouse Sensitivity in FlightGear.


UPDATE: Flightgear 2.6 is out and it has already made its way to the PlayDeb repository. This means that you can install FlightGear 2.6 using the same method described above.
If you have already installed 2.4 you just need to run a system update.

Thursday, January 26, 2012

Change the sensitivity of mouse when used as a yoke in FlightGear in Ubuntu

When you start with any flight simulator it is natural to have an unstable, mostly swinging plane. In case of FlightGear, this might not entirely be your lack of skill or experience. It might also due to the high sensitivity of the mouse in yoke mode.

The default mouse sensitivity in flightgear is  bit on the higher side. This makes the experience frustrating as you need effort just to level out the plane.

Fortunately we can change the sensititvity settings but unfortunately you have to edit some files(here 'mice.xml) manually to make those changes. I am trying to walk you through this unfortunate situation here.

For enabling users to do in-depth customization, fligthgear uses human readable configuration files to control the behavior of input devices. All of these configuration files are located in the file system partition.

To edit a file in the file system partition, with the exception of home folder, you need root access. Without the root access you won't be able to save the changes.
What you need to do here is to navigate to the location of mice.xml, open the file with root permissions and make the necessary changes.

This can be done entirely using terminal but it is a bit complicated for the beginners. We will try here the GUI way.

Step 1 : Open the mice.xml with root permissions. We will be doing this with the help of a file browser with root permissions. For that, open the terminal and type
sudo nautilus
Here nautilus is the file manager in ubuntu linux. You will be prompted for administrator password. Enter it. A file browser with root permissions will be opened. Then navigate to
/usr/share/games/flightgear
You will see a file 'mice.xml' among others in the flightgear folder. Copy the file and save it somewhere else in the hard disk. Creating a back up copy of the file helps to restore the previous state even if you mess the file up.

Rightclick the mice.xml file and open it with the text editor.

Note: If you double click the file, it will be opened in your default web browser instead of text editor.

Step 2 : Navigate to the section similar to the screenshot below

Look for this line in the section
<factor type="double">4.0</factor>
Change the number 4.0 to a lower number (2.0 would be fine) and save the file.
Next time when you open flightgear you will notice a decrease in sensitivity of the aileron and hopefully some better control.

The behavior of mouse in FlightGear is completely controlled by this mice.xml file. You can do other adjustments like changing the sensitivity of rudder, control the throttle with mouse wheel etc by editing this file.

For getting a better control changing the aileron control is enough so it is fine leave the rest as such.