Sacrificial Inferno

A procedurally generated, permadeath, hack and slash, retro 2D platformer.

Build on Linux

Sacrificial Inferno is going to target Windows, Mac and Linux for the first day of release. GameMaker supports all three platforms if you own the appropriate packages.

The Sacrificial Inferno team is comprised of Windows and Mac users (we’ll do another blog post on using GameMaker Studio on OSX in a future post).

As the ‘Linux’ person of the team, it’s my job to ensure the Linux version works throughout the development and so I’ve decided to document the process for others, as it’s quite fiddly if you’re not familiar with virtual machines or Linux. This blog will cover the following:

  1. Downloading and setting up a base Linux Virtual Machine (VM)
  2. Installing the GameMaker dependencies
  3. Hooking the Linux VM up to GameMaker Studio

Downloading and setting up a base Linux Virtual Machine (VM)

The first thing you’re going to want to do is download Ubuntu Server. Ubuntu Server is a terminal only version of Ubuntu which is the minimum we need to build, and will save on disk space and system resources over the GUI version. The latest version can be downloaded here.

download ubuntu server

For the purpose of this tutorial we’re going to use Microsoft’s Hyper-V which is a solution for creating virtual servers and comes with certain versions of Windows. If you don’t have Hyper-V, worry not! You can use Oracle VirtualBox from here. The the next few steps are for Hyper-V but the screens and setup will be very similar for VirtualBox.

Firstly, we need to tell Hyper-V about how we want it to provide networking capabilities to virtual machines. To do this, select your computer name in the left hand tree (it defaults to ‘Hyper-V Manager’) which will populate a bunch of other options throughout the form. Select ‘Virtual Switch Manager…’ and add an external virtual switch like so.

virtual switch manager 1

You will need to select a different “External network:” as the list is populated based on your computers network available network adapters.

Virtual Switch Manager 2

Now we can create the virtual machine by selecting “New >” and picking “Virtual Machine…” which will launch a setup wizard. Click “Next >” to get started.

Give your virtual machine a sensible name.

Hyper-V Setup Name

Select ‘Generation 1’. There is no need for ‘Generation 2’ for our purposes.

Hyper-V Setup Generation

I’ve given mine 1024 MB of memory, you could probably give it less but my laptop has loads to use. Make sure you disable ‘Use Dynamic Memory’ and it caused me no end of problems.

Hyper-V Setup Memory

On the ‘Configure Networking’ area, simply select the virtual switch we created earlier in the drop down.

Hyper-V Setup Networking

Give the virtual machine a reasonable amount of space. I’ve gone with 20 GB. Technically Ubuntu Server requires very little but we need to install a bunch of dependencies in order to build our game.

Hyper-V Setup Disk

Lastly, select the Ubuntu Server .iso file we downloaded earlier. Hyper-V Setup Install Options

Click finish, start and connect to your new virtual machine. A window will launch as below, this is the view into your virtual machine. We’re now going to setup Ubuntu. Each of the screenshots is setup as I’ve continued to the next section so you can pretty much follow the screenshots along. Make sure that you pick the language, keyboard type and timezone applicable to you.

Ubuntu Install 1

Ubuntu Install 2

Ubuntu Install 3

Ubuntu Install 4

Ubuntu Install 5

Ubuntu Install 6

Ubuntu Install 7

Ubuntu Install 8

Ubuntu Install 9

Ubuntu Install 10

Use whatever password you like.

Ubuntu Install 11

Ubuntu Install 12

Ubuntu Install 14

Ubuntu Install 13

Ubuntu Install 15

Ubuntu Install 16

Ubuntu Install 17

Ubuntu Install 18

Ubuntu Install 19

Ubuntu Install 20

Ubuntu Install 21

Use space to select an item and enter to accept.

Ubuntu Install 22

Ubuntu Install 23

Ubuntu Install 24

Accept the last screen and your virtual machine will reboot to a window asking for your login.

Installing the GameMaker dependencies

A slight tangent… Installing Putty

This section covers the installation of the packages required by GameMaker. Before we dive into that though lets get putty setup and installed on our windows client so that we remote into our new Linux server using a decent ssh client.

First step is to find out the IP details of the Linux VM. Log into Linux VM using the details used earlier and type…

ifconfig

…to see something like this.

ifconfig

In my case I’m after the eth0 inet addr which is 192.168.1.103. Yours will be different.

It’s worth stating that you could continue using the linux terminal that you log into. This as we alluded earlier, a bit pants – I encountered a bunch of text problems. I will be using a well-known app called Putty, which is available here (you want putty.exe). Upon launching Putty you will need to input the IP address given to your virtual machine which we found out just above.

Putty Connect

Press ‘Open’ and you’ll get this warning about a certificate which is a precaution to prevent another computer imitating the one you’re connecting to now. Accept it and login as before.

Putty Host Key

We just need to install the required packages in order to build our GameMaker game! Run the following commands in your Putty window. You can right click in the Putty window to paste.

…Back on track: Installing the GameMaker dependencies

We’re running 64bit Linux but a lot of the requirements (according to the GameMaker blog) are 32bit so let the package manager know we want 32bit stuff.

sudo dpkg --add-architecture i386

Update to the lastest list of packages and upgrade existing packages. If prompted press Y and press ‘Enter’ to accept new installs.

sudo apt-get update
sudo apt-get upgrade

These are the packages I needed to install for GameMaker to build. There are some differences from the GameMaker blog because their list did not appear to work without some additions.

sudo apt-get install openssh-client openssh-server libopenal1 libopenal1:i386 lib32z1 lib32ncurses5 libbz2-1.0:i386 libstdc++6:i386 libxxf86vm1 libssl1.0.0:i386 libglu1-mesa:i386 libxrandr-dev libxrandr2:i386 clang libc6-dev-i386 libcurl3:i386 libssl-dev:i386 fakeroot make zip

This is a workaround to a strange problem with the GameMaker Linux build process. It seems to create a file named ‘GameMaker-Studio’ when it actually wants a directory named that. We’ll force its hand by making the directory for ourself.

mkdir GameMaker-Studio

Hooking the Linux VM up to GameMaker Studio

Now we’re finally ready to build our .deb package for Linux! In the GameMaker ‘File’ menu go to ‘Preferences’ and go to the ‘Linux’ tab. Enter the IP from earlier as the ‘Linux Host Name’, the ‘Linux User Name’ and ‘Linux Password’ are the ones from earlier. I’ve set ‘/home/build’ as the ‘Application Install Dir’. Click ‘Check Linux Connection’ which will return ‘OK’ and then click the ‘OK’ button to close the form.

GameMaker Linux Settings

Annnnd, finally set the ‘Target:’ (along the top of GameMaker) to be ‘Ubuntu (Linux)’ or ‘Ubuntu (Linux) (YYC)’, in the ‘File’ menu select ‘Create Application…’ and then choose a place to store the .deb (Debian install file) to for distribution. A bunch of stuff will happen in the GameMaker console and end with ‘Create finished: hh:mm:ss’. You now have your install file for Debian based Linux distributions!