Recently, YoYoGames added the YoYo Compiler to the Linux (Ubuntu) target platform, and so we are going to take this opportunity to explain how to set up this module correctly so that you can easily port your games to Linux. Before going any further however, it is worth noting that due to the many different possible configurations of a Linux system, the GameMaker:Studio Linux module is only aimed at Ubuntu OS version 14.04 LTS to ensure that it works correctly for everyone. As such this tutorial will focus on that operating system.
Obviously you first have to install Ubuntu on a machine (this can be a regular desktop installation, a dual boot instalation, or a Virtual Machine, which we explain in this article from the helpdesk). Once yo have your version of Ubuntu installed, you will need to make sure that your current install has the OpenSSH server installed - this is a powerful collection of tools for the transfer of data between networked computers, which GameMaker:Studio will use to communicate with the remote computer - and you will also need to confirm that you have the correct set of OpenAL libraries, as without them your games will not run correctly.
To do this you should open Terminal, which can be found by clicking on the Dashboard icon and then simply searching for the "Terminal" application. Click on it to open it and you should see a command prompt like the one shown below:
From this command line, you should then type the following lines one at a time, hitting enter in between so the packages can be retrieved/checked, just to confirm that these packages are already installed on your machine and install them if not:
sudo apt-get update
sudo apt-get install openssh-client
sudo apt-get install openssh-server
sudo apt-get install libopenal1
sudo apt-get install libopenal1:i386
sudo apt-get install lib32z1
sudo apt-get install lib32ncurses5
sudo apt-get install lib32bz2-1.0
sudo apt-get install libstdc++6:i386
sudo apt-get install libxxf86vm1
sudo apt-get install libssl1.0.0:i386
sudo apt-get install libglu1:i386
sudo apt-get install libxrandr-dev
sudo apt-get install libxrandr2:i386
These are the minimum libraries needed to run the Linux (Ubuntu) target from GameMaker: Studio, so if you do not require the YYC target, then you can continue on to read about how to set up GameMaker: Studio (below) and start testing your game. If you do want to use the YYC Linux target (and why wouldn't you given the benefits?) then read on...
Apart from the essential libraries listed above, if you wish to use the Linux (YYC) target then you will need to install these additional libraries:
sudo apt-get install clang
sudo apt-get install libc6-dev-i386
sudo apt-get install libcurl3:i386
sudo apt-get install libssl-dev:i386
Once you have installed all these, it is also a good idea to call the following:
sudo apt-get update
This will make sure that everything is up to date, and you can now compile your games using the Linux (YYC) target module.
Now to connect your copy of GameMaker:Studio on your PC to the Linux (Ubuntu) system via the File > Preferences > Linux section in the main GameMaker:Studio IDE. Put in the address of your Linux computer, then the username you used and finally the password.
The top field, Linux Host Name is the IP address or Device Name of the Ubuntu system on the network that is to host the game, and the Linux User Name and Linux Password sections should contain the details of the account that will be used for testing/creating your game. Finally, you can specify the Linux Install Directory which is where GameMaker: Studio will install the necessary components from GameMaker required to run your game.
At the bottom of the form you can also choose to have GameMaker install your game on the Ubuntu OS when you choose to create a final application, as well as supply a location where you want the app to be installed on the Linux machine.
With that done you can then click the "Check Linux Connection" button, and if you have installed all the required packages and the Linux machine is visible over the network then it should say "Connection OK!".
NOTE: The username in most versions of Ubuntu is not the same as the display name, and usually contains no capital letters.
To get the IP address of the Linux system (whether a physical machine or a virtual machine) you simply have to go to the Settings menu click on the Network icon. You can see the IP address of the Linux system there. The Device Name is shown on Settings > Details.
NOTE: If you have previously had a connection with another Linux machine or a Linux VM, then you may get SSH errors which can be resolved by clicking the "Clear SSH Keys" button.
Once you have set up both GameMaker: Studio and your Linux system, all you have to do is select "Linux" (or "Linux (YYC)" if you have set up that too) as the target for your game, and then press either the green "Play" button, the orange "Debug" button, or the "Create Executable" button and your game will be compiled to the specified computer. it's a bit fiddly to set up all the required libraries, but once you've done it, then actually compiling and testing is easy, and you can now offer your games on that platform too.