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.
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
The Ubuntu module is only aimed at Ubuntu 18.04.1 LTS 64bit, and as such this tutorial will focus on that operating system which you can download from here: http://releases.ubuntu.com/bionic/
NOTE: YoYo Games recommends that you have a separate computer 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 projects and running games made 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 (if you have installed 3rd party components when prompted on installing Ubuntu, you may already have the OpenAL libraries installed, but if in doubt, use the command given below to install them anyway).
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:
Within the terminal we need to use apt to get the packages which are required to compile and run games on Ubuntu this is done by using sudo apt install <packagename> where packagename is the name of the package that apt uses to download and install it. Below is a list of packages that are required for GameMaker Studio 2:
Set Up Ubuntu Devices
Back in GameMaker Studio 2, 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.
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.
Compiling Final Executables
Once you have finished your project and tested it to make sure that it works, you will likely 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 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 so it will be available once installed) following the instructions found here: