GameMaker Studio 2 Desktop comes with three export platforms: Windows, Mac and Ubuntu. In this article we give the required steps to get the Ubuntu platform up and running in both the Windows and Mac IDEs.
Please see the Ubuntu section of our Required SDKs FAQ for current information on which version(s) of Ubuntu you should be using when making your game builds, as this can vary according to the version of GMS2 you're using. We do not recommend trying to use newer versions of Ubuntu than we claim support for.
You can download the current version of Ubuntu from https://ubuntu.com/download/desktop
Should you need Ubuntu 18 you can download that from https://releases.ubuntu.com/18.04.5/
After installing and running GameMaker Studio 2 on your PC or Mac you can specifically target building for Ubuntu using the Target Manager window opened by clicking the target button in the top right of the main window:
For the Ubuntu 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.
Set Up Ubuntu
You should install this on a separate physical computer for use when building your game projects. You can compile with Ubuntu running on a Virtual Machine, but this is not officially supported and may not give great performance anyway, so if you have any issues you will need to investigate your setup yourself.
NOTE: Other distros can be used for building projects and running games made with GameMaker Studio 2, but, again, this is not officially supported.
Once you have a Ubuntu installation ready, you will need to install the development libraries/tools required during builds. 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:
Then we need to use the command apt to get the packages which are required to compile and run games.
First, you should update the records of the repositories so you will get access to the latest versions of the packages.
This is done by using:
sudo apt-get update
Following this, you can now install the packages listed by the following command:
sudo apt-get install <packagename>
where you replace <packagename> with each of the following individually and keep running apt until you have installed all of them:
Please note that GMS2 2.2.3 and above also require the "nproc" package to be installed. This is installed by default in Ubuntu 18, but might not be there if you have customised your install (or may not be installed by default in other distros), so be aware you might need to install this manually also.
Similarly, if you had selected "3rd Party Components" when prompted during installing Ubuntu itself, you may already have the OpenAL libraries installed.
Set Up Your Devices
Back in GameMaker, in Target Manager 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 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.
It is worth noting that - as of GMS 2.3.1 - you can connect Linux devices with 32bit ARM processors and also compile/test games on those devices as long as they are correctly setup as per this guide. GameMaker Studio 2 will detect what kind of processor the device is using (ARM or x64) and create the required executable automatically.
Testing Your Projects
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.
Once you have everything working and a game ready to publish, you'll want to compile and distribute it to other Ubuntu users. This is covered in the following article: