Difference between revisions of "Multiplayer developer guide"

From FreeSpace Wiki
Jump to: navigation, search
(Created page with "= Multiplayer FSO Development = Developing FSO's multiplayer is filled with challenges. This is meant to be a partial guide to help SCP members set up a testing environment....")
(No difference)

Revision as of 20:15, 2 March 2021

Multiplayer FSO Development

Developing FSO's multiplayer is filled with challenges. This is meant to be a partial guide to help SCP members set up a testing environment. This guide assumes that the developer is using Knossos, but the same results can be achieved with the command line. Also, a single computer can be used for multiple instances of FSO.

There is no known network-based hard limit on the number of instances that can connect on a single computer: just make sure that the instances are all using different ports.



PXO

It is recommended to use PXO since it cuts out the guess work of copying the IP address correctly into FSO settings. To register, go to https://pxo.nottheeye.com/ and create an account. Verify your email. If your verification email does not show up, please contact Taylor, the PXO admin.

Once your email is verified, you can copy and paste the username and password from the PXO profile page into the multi tab of your FSO settings.

    • Note: this is not the user name and password you use to log into the PXO website, but the login given to you by the PXO server on your PXO profile. Double check that PXO is enabled and then go to the ready room in multi mode. You should be able to get to mulitplayer.


Setting Up a Server And Port Forwarding

In order for your game to be visible to others, your chosen port must be forwarded. Prior to FSO 21.0, FSO could only connect to the server if it was on port 7808. Otherwise it would just not be visible to any clients, but any port selected through knossos can now be used.

FSO now has the ability to attempt to forward ports automatically, although it often fails. To check if your game is visible to clients, a PXO enabled game server will show up on the PXO server list, accessible by PXO admins. An in-game indicator of game visibility is planned but not yet implemented.

If you look up the instructions for forwarding a port on your router, it should be a simple set of changes. Again, port 7808 is no longer required, but that is the default port.


Issues with NAT

If you have unexplained issues getting a server to show up, check to see if your ISP uses carrier grade NAT. If your ISP uses it, your ports cannot be properly forwarded, and you need to reach out to an SCP developer who runs standalones to set up a server.


Setting up instances

As previously mentioned more than one instance of FSO multiplayer can run on a machine. In order to accomplish this, open your knossos settings and set your port to the forwarded port. Don't forget to hit save. Run your chosen mod, and then go to the pilots multiplayer mode in the pilot select screen. Then go to the ready room.

You should see the PXO chat screen. On the bottom right, you can press continue and then on the next screen start a server. You may want to add a password in case the testing should not be interrupted, but I have never had a problem with other players entering my servers.

Now, go to knossos settings again and select a different port. This port does not have to be forwarded. Every once in a while, knossos may ignore your changes, and you may get an error message when trying to connect your second instance. Please repeat this step until that bug no longer occurs. This should not happen more than once, and the likelihood of the bug goes down when you explicitly type the port number instead of relying on the knossos/FSO default.

Open the same mod, but select a different pilot. (there is a bug involving the mission log if there are pilots with duplicate names, it is being worked on) Once you are past the PXO screen, you should see your server up and running.

Select and server and join, and enjoy your round of testing!