Howto:Multiplayer: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Starting cleanup)
No edit summary
Line 3: Line 3:
Multiplay may cause extreme [[troubleshooting performance issues|framerate drops]] during the loading of aircraft models, especially heavy models such as the [[Boeing 777]]. It is suggested to fly in locations other than the default [[San Francisco International Airport]], as there are often lots of pilots in the area surrounding [[KSFO]].
Multiplay may cause extreme [[troubleshooting performance issues|framerate drops]] during the loading of aircraft models, especially heavy models such as the [[Boeing 777]]. It is suggested to fly in locations other than the default [[San Francisco International Airport]], as there are often lots of pilots in the area surrounding [[KSFO]].


== Getting online ==
== Connecting to multiplayer ==
=== In-sim dialog ===
[[File:Multiplayer settings dialog.jpg|thumb|300px|Multiplayer settings dialog]]
[[File:Multiplayer settings dialog.jpg|thumb|300px|Multiplayer settings dialog]]
As of FlightGear 2.4.0, multiplayer settings can be accessed via the in-sim Multiplayer menu. All you need to do is enter a callsign and select a server from the menu. Press Connect to go online.  
The easiest way to get online is to use the in-sim Multiplayer dialog. All you need to do is enter a callsign and select a server from the menu. Press Connect to go online.


This is by far the easiest way to get online, but in some cases the methods mentioned below may be preferred.
{{Note|Before starting tests, you might want to check the [[#Problems associated with specific Internet Service Providers|Problems associated with specific Internet Service Providers]] section.}}
 
'''Before starting tests''', you might want to check the section ''Problems associated with specific Internet Service Providers'' below in this page.


=== Using the launcher / FGRun ===
=== Using the launcher / FGRun ===

Revision as of 14:19, 24 March 2015

The multiplayer feature of FlightGear makes it possible to see other pilots and vice-versa. This makes it possible to fly in formation, perform mid-air refueling with tankers controlled by real people or contact real air traffic controllers to ask for landing/takeoff clearance.

Multiplay may cause extreme framerate drops during the loading of aircraft models, especially heavy models such as the Boeing 777. It is suggested to fly in locations other than the default San Francisco International Airport, as there are often lots of pilots in the area surrounding KSFO.

Connecting to multiplayer

In-sim dialog

Multiplayer settings dialog

The easiest way to get online is to use the in-sim Multiplayer dialog. All you need to do is enter a callsign and select a server from the menu. Press Connect to go online.

Note  Before starting tests, you might want to check the Problems associated with specific Internet Service Providers section.

Using the launcher / FGRun

Multiplayer options in FG Launcher
  1. Select your aircraft and starting airport as normal in FGRun.
  2. On the next screen, tick the "Multiplayer" box. Also tick the "AI models" box or you will not be able to see the other pilots' aircraft.
    • Callsign: of your choice.
    • Hostname: enter mpserverXX.flightgear.org (with XX being the server number).
    • In/Out: set both ports to 5000.
  3. Click run and you'll soon be flying with other pilots!

To confirm that it's working, you can go to the multiplayer map at; http://mpmap02.flightgear.org/ (in Hong Kong). Once FlightGear has started, you will notice chat messages that say "Hello" indicating pilots that are online and then as they join (you can change this message by editing the <chat type="string">Hello</chat> line in $FG ROOT/preferences.xml). You may wish to use a different server (i.e. "Hostname" entry).

For more advanced settings, the Advanced > Network tab can be opened. You are able to remove the in or out lines only through this method for example.

Using fgfs from the command line

First, for those who are very impatient and have a vague idea about what they're doing, the basic arguments to pass to fgfs for multiplayer are these;

--multiplay=out,10,server.ip.address,5000
--callsign=anything 

where 5000 is the port number the server is listening on (which is 5000 for the official servers).

If you for some reason need to specify which local port and/or interface FlightGear should use add the following argument:

--multiplay=in,10,your.ip.address,portnumber

where portnumber is usually 5000 and your.ip.address is the ip address of the network interface being used by FG to connect to the server - even if that's a local 192.168 type address. You can also leave your.ip.address blank. FlightGear will then listen on all network interfaces:

--multiplay=in,10,,5000
Tip  For a local setup between two fgfs instances without any fgms/multiplayer server being involved, you merely need to map each I/O port to the corresponding port of the other instance:
fgfs --multiplay=out,10,127.0.0.1,5000 --multiplay=in,10,127.0.0.1,5001 --callsign=one &
fgfs --multiplay=out,10,127.0.0.1,5001 --multiplay=in,10,127.0.0.1,5000 --callsign=two &

You can use this kind of setup to test multiplayer related features or troubleshoot multiplayer related bug reports that may be otherwise hard to reproduce over MP, because you don't normally see what other people are doing in terms of configuring MP/fgfs. Screen shots demonstrating a "peer-to-peer" setup between two fgfs instances running on the same machine via localhost/loopback (127.0.0.1) without any fgms/multiplayer server being involved You can add an arbitrary number of channels to mirror your flight onto other servers, e.g. to a private fgms server using --multiplay=out,10,my.private.server.ip,5000.

Additionally, the "in"-argument above tells FG to listen only on the loopback/local interface - it will not receive packets arriving on the other network interface(s). If you want to also bind to other interfaces, just omit the IP address by using --multiplay=in,10,,5000.


If you are using fgrun, please note that fgrun expects you to enter a valid (non-loopback, i.e. not 127.0.0.1) IP address or hostname for the local network interface.

Check this page to see whether your callsign is already in use or not. Do not pick a callsign that is already used, as that will create problems!

Now, going more slowly for those who are completely lost...

Try the above first, and if it doesn't work, read on.

First of all, you need to know the IP address of the network interface you'll be using for multiplayer FG. If your Internet connection is via an ADSL modem that plugs directly into your computer with a USB connection, you should be able to find your IP address by visiting http://www.whatismyip.com . Please note that your ISP might not give you the same IP address each time - if MP stops working, check this first.

Otherwise, your connection is likely via some kind of router that connects to your computer via an RJ-45, or "Ethernet" connector (similar shape to most Western telephone plugs), or by a wireless link. You need to find the IP address of that network interface.

  • Under Linux, this can be found by logging in as root and typing "ifconfig". You may find more than one interface listed, beginning with "lo" - ignore that one. You should have something like "eth0" or "wlan0" also listed - look through this block of text for "inet addr". This will be followed directly by the number you're looking for, e.g. "inet addr:192.168.0.150"
  • Under Windows XP or later, click start, run, and type "cmd". In the terminal window which appears, type "ipconfig" This should show you your IP address - write it down.
  • With Windows 98, click start, run, and type "winipcfg" to get information about your IP address.

This section _ought_ to be unnecessary now with recent versions of the FG server. If you have problems though, it won't hurt to follow through.

Now, all (!) that remains is to configure your router to forward UDP port 5000 to the IP address you've just found. This is not something that can be described in step-by-step detail, because each manufacturer's configuration interfaces differ greatly. Some tips are given here - if you get stuck, ask nicely on the FlightGear IRC channel for help (details on the flightgear website).

You should know how to log on to your router's configuration page, usually via a web browser. You are looking for settings pertaining to "port forwarding" "virtual server" "Forwarding Rules" or similar. When you have found the relevant settings, you need to add a rule that forwards port 5000 to the IP address you discovered earlier. If there is a choice given, ensure it is UDP ports that are forwarded. If there is no choice, you may assume that both TCP and UDP are being forwarded. Save your configuration, and most routers will probably then need to be rebooted to apply the changes.

Note: (for BSD users) If you are using a ADSL modem, you might have to put the port forward command into the ppp.conf file rather than firewall. This is because the firewall script will only run each time the machine is booted rather than the ppp line coming back online.

Finally, start FG using the command line given right at the start (if you're using the windows launcher you will find entry boxes for Multiplayer arguments - insert the relevant details there). You will end up with something like this;

fgfs --callsign=test --multiplay=in,10,192.168.0.2,5000 --multiplay=out,10,mpserver05.flightgear.org,5000 \
--airport=KSFO --runway=28R --aircraft=hunter 

Choose your own callsign - this is currently limited to seven characters. Check this page to see whether your callsign is already in use or not. Do not pick a callsign that is already used, as that will create problems!

Once you have started FG, you should, if others are flying, see messages in the terminal from which FG was started, similar to the following;

Initialising john51a using 'Aircraft/ufo/Models/ufo.xml'  
FGMultiplayRxMgr::ProcessRxData - Add new player. IP: 10.0.0.36,  
Call: john51a,model: Aircraft/ufo/Models/ufo.xml 

You MUST give your local, behind-the-router IP address for MultiPlayer to work. Trust me on this one!

You should check that your firewall is not causing problems - either turn it off _temporarily_ or add an exception to allow incoming connections on port 5000.

If it's still just not working for you, ask nicely on the FlightGear IRC channel and someone should be able to assist.

Multiple connections per computer

It is possible to run multiple FlightGear instances on a single computer and connect them all to the multiplayer network. However, this requires some extras to keep in mind:

  • both instances use the same out-port.
  • one instance uses in port=5001, the other port 5002.
  • and of course should both instances have unique callsigns.

Multiplayer chat

1rightarrow.png See Chat Menu for the main article about this subject.

Note  Multiplayer chat is not supported by FlightGear 0.9.10 or older.

To chat with other pilots, go to the "Network" menu and select "Chat" or "Chat Menu" at the bottom of the menu. Note that the other pilots may not have their chat box open nor chat messages enabled, so they may not see your messages.

The shortcut for chatting is "_" (underscore) and it brings up a small window where you can type. By default, other people's messages are displayed at the top of Flightgear's window for a few seconds, but it will appear for a much longer time in the window at Network > Chat. So if you think you have missed anything, go check there.

Coping with abusive behaviour

Should you become victim of abusive or annoying behaviour by any pilot you have option to ignore him or her. To activate the ignore function open the Multiplayer > Pilot list dialog and click the ignore button next to the pilot's call sign. As of FlightGear 2.0.0 this will prevent chat messages from the ignored pilot from appearing and in FlightGear 2.4.0 and later it will additionally prevent his aircraft from appearing.

Multiplayer map

MPMap screenshot

1rightarrow.png See MPMap for the main article about this subject.

There is a very nice online map which displays the location of online pilots at mpmap01 and/or mpmap02. You will also find this useful to check that you are successfully connecting to the server.

Servers

Note  The multiplayer servers are interconnected. With few exceptions you do not need to connect to a specific server in order to see other pilots who are on that server. For best performance, you should connect to the server that is geographically closest to you, has the lowest latency (ping time) or is the least busy.
Tip  Use this, this or this link to check if the MP servers are online. As of FlightGear 2.10.0, the in-sim dialog only displays servers that are available.
Server Location Tracked Maintainer IRC Name Forum Name Comments
fg.noahbuscher.com US No Noah Buscher Noah Noah May be merged with main servers in the near future.
mpserver01.flightgear.org Germany mpserver15 Oliver Schroeder os
mpserver02.flightgear.org Los Angeles, USA mpserver15 Lloyd Stevens ls4680 ls4680
mpserver03.flightgear.org Germany mpserver15 Hergen
mpserver04.flightgear.org UK No Jon Stockill Nav JonS
mpserver05.flightgear.org Chicago, USA mpserver15 Brant IonCannon218
mpserver06.flightgear.org Berlin, Germany mpserver15 Sven Teichmann D-SAMI Unlimited traffic
mpserver07.flightgear.org Wisconsin, USA N/A Tom Betka TB Offline
mpserver08.flightgear.org Frankfurt am Main, Germany No Roland Quix0r Quix0r 10 TByte traffic, mostly short pings
mpserver09.flightgear.org Köln, Germany N/A Daniel Vigano Fauchi95 Offline
mpserver10.flightgear.org Montpellier, France mpserver15 Alexis Bory xiii xiii
mpserver11.flightgear.org Vilnius, Lithuania No Darius ffg
mpserver12.flightgear.org Amsterdam, the Netherlands mpserver12 Rob evilslut evilslut
mpserver13.flightgear.org Grenoble, France No Charles Ingels charles cbz-026
mpserver14.flightgear.org Zurich, Switzerland mpserver15 Yves Sablonier gral gral
mpserver15.flightgear.org North Point, Hong Kong N/A Hazuki Amamiya Hazuki Hazuki This is FGTracker, not a multiplayer server
mpserver16.flightgear.org Kansas City, Missouri, USA mpserver15 Rob Dosogne truthsolo truthsolo
mpserver17.flightgear.org Cluj, Romania N/A Marius tuxum tuxum Offline
mpserver18.flightgear.org Germany mpserver15

Information as at 2014-01-04

Geographic locations of the servers are also available at Google Maps.

If you are interested in hosting your own multiplayer server, you may want to check out Howto: Set up a multiplayer server.

Problems associated with specific Internet Service Providers

Fibertel Argentina

It has been reported December 2014 that UDP connection through port 5000 is not possible. Fibertel Argentina users do not have full access to the modem configuration at the moment, they have to pass through a very limited interface on the Fibertel web site, only aimed at allowing operations like switching on/off the wifi radio or switching between NAT router mode and bridge mode (and at the moment a bug made users unable to submit any configuration changes). After various hours of tests by the user with and without Fibertel staff at the phone with the modem in NAT router mode and in bridge mode, after a supervisor decided to remotely flash the modem (Motorola) with a recent firmware and yet noticed strange behaviour and sent tech staff to replace the modem with a simpler one (another Motorola model with no wifi), after testing with it in bridge mode with tech staff at the phone, the user sought for help in the forum and finally a temporary standalone instance of the Multiplayer server software (located in Canada) was activated and the user was able to connect normally through all the tested ports (5001, 5002, 5003, 5507) but not through port 5000 which is the only available port in any FlightGear Multiplayer server at the moment. Through another Internet Service Provider (Speedy ADSL) the user could connect with no problems to port 5000 of any Multiplayer server.

Facing this evidence, Fibertel Argentina technical staff finally admitted: "It's not the modem, it's the network, our network uses port 5000 for setup purposes, it should be open for the user but it might not be fully functional". This is reported here to avoid other users a similar 60-70 hours time loss. The users reports he asked them with energy to stop filtering port 5000, the answer was that because of the implications that was not an option.

Port 5000 is unofficially associated both with FlightGear and the UPnP protocol. However, it has been observed (discussion of issue 1617) that the fact that Fibertel Argentina is using port 5000 for network setup purposes shouldn't imply that they are filtering packets: "it should really only be when the packet has reached its destination that the port number has any meaning at all".

Forum thread full link: http://forum.flightgear.org/viewtopic.php?f=27&t=24754&p=226034#p226034).

Reported issue 1617 full link: https://code.google.com/p/flightgear-bugs/issues/detail?id=1617&q=-Type%3DFeatureRequest%20-status%3ATesting&sort=-id&colspec=ID%20Type%20Status%20Priority%20Summary%20Aircraft%20Milestone

Besides investigating about possible workarounds(?) (port forwarding through UDP bidirectional tunnelling) which might or might not add too much network latency or CPU load or constitute a misuse of special purposes networks, the user suggested diversification of port numbers ("offering two possible port numbers could mean offering twice the chances to connect to the Multiplayer network and would constitute a reasonable prevention measure of part of the possible connection problems of FlightGear users over the internet").

However, coding work on the server software is not priority at the moment, and any change to servers might turn out to be a "nightmare on the server admins side to implement [...]", not to mention "[...] the fact that most if not all of them are volunteering time and machines for this".

The simplest workaround would just be a new server offering a different port number.

Related content