GameMaker Studio 2 Desktop comes with three export platforms: Windows, Mac and Ubuntu (Linux). In this article we give the required steps to get the Ubuntu (Linux) platform up and running.
After installing and running GameMaker Studio 2 on your PC you should be able to create and test projects immediately using the "Test" target option on your Windows machine, however you can specifically target Ubuntu (Linux) from the IDE using the Platform Target window, located in the top right of the main GameMaker Studio 2 workspace:
For the Ubuntu (Linux) target platform you can see that there are two output options:
- VM - This will build your game using interpreted code.
- YYC - This will build you game using compiled native code.
The VM option will build your game and use interpreted code within a special YoYo Runner. The performance of this target is less optimised than YYC, but it is faster to compile and offers the ability to run in debug mode (when using YYC the debugger will not start). The YYC target however, gives a much greater optimisation (and corresponding performance boost) especially with logic-heavy games, but large projects can take some time to compile.
To compile your game using either the VM or YYC however, you will first need to set up your Devices so that GameMaker Studio 2 can communicate with your Ubuntu machine.
Due to the different possible configurations of a Linux system, the GameMaker Studio 2 Ubuntu (Linux) module is only aimed at Ubuntu OS version 14.04 LTS, and as such this tutorial will focus on that operating system which you can download from here: http://releases.ubuntu.com/trusty/
NOTE: YoYo Games recommends that you have a separate PC with an Ubuntu installation for building your game projects. You can compile with Ubuntu running on a Virtual Machine, but this is not officially supported. Also note that other distros can be used for building and running packages with GameMaker Studio 2, but, again, this is not officially supported.
You will need to make sure that your current install of Ubuntu has the OpenSSH server installed. This is a powerful collection of tools for the transfer of data between networked computers, which GameMaker Studio 2 will use to communicate remotely with the main build computer. You will also need to confirm you have the correctly 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 something 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:
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 (if this package is unavailable use: libbz2-1.0:i386)
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 need to run the Ubuntu (Linux) target from GameMaker Studio 2 using the VM output, so if you do not require the YYC output, then you can continue on to read about the rest of the setup process further down this page and start testing your projects. If you do want to use the YYC Ubuntu (Linux) target then you will also need to install a few extra packages:
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 of 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 Ubuntu (Linux) YYC output option as well as the VM.
Setup GameMaker Studio 2 Devices
Back to your GameMaker Studio 2 machine, and in the Targets Window you can see that there is a section marked Devices with a small "pencil" icon beside it:
Clicking this will open up the Ubuntu Device Manager where you can add one or more Ubuntu machines to target when running and building your projects for the Ubuntu (linux) platform. Here you should click the Add New Device button to create a new Device and then fill out the details (below you can see an image with an example of the information required):
The top field, Display Name is simply a name that you can give to the device so that it is easy to identify in the devices list. After filling that out you need to give the Host Name - the IP address or Device Name of the Ubuntu system on the network that is to host the game - and the User Name and Password of the Ubuntu user account that will be used for testing/creating your game. To get the IP address of the Ubuntu system (whether a physical machine or a virtual machine) you simply have to go to the Settings menu and click on the Network icon and you can see the IP address there. Finally, you can specify the Install Folder which is where GameMaker Studio 2 will install the necessary components required to run your game.
NOTE: The username in most versions of Ubuntu is not the same as the display name, and usually contains no capital letters.
With that done you can then click the Test 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 Successful!" (this may take a few moments to show up):
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.
Test Your Project
You are now ready to test your projects using the either the VM or YYC output target, so select whichever one you require from the Platform Targets window and then press the Play button. If all has gone correctly your project should now run on the Ubuntu machine.
Note that you can also test play your game using the "Debug" option at the top of the IDE. When clicked using the VM output it will run the game and enable the Debug Module to run too (this may require some extra permissions from the OS). This module permits you to see in detail how your game is performing as well as set breakpoints and check for issues or bugs. For more information, see the manual.
Compile Final Executable
Once you have finished your project and tested it to make sure that it works, you may want to distribute it as an executable package. To create this package for distribution is a case of simply hitting the Create Executable button at the top of the IDE and then give a save location and name for the package to be created.
The Ubuntu (Linux) target will create a ZIP file that contains the main executable and folder with the required assets in it. This ZIP should be extracted to where the user wants and can then be run. It's important to note that the executable will use the standard Ubuntu EXE icon, since it is impossible for an icon to be added automatically and work on all possible versions and distros. However you can create your own desktop icon (the icon image is supplied as part of the Assets folder within the compiled ZIP) following the instructions found here: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles