• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Ubuntu run and builds are hit and miss

space_sauce

Member
Hello!
I recently followed a tutorial on how to set up Ubuntu for creating builds.
I'm running Ubuntu as a VM on my Windows machine.
GameMaker does connect to the Ubuntu machine with the "test connection" every single time I click it. ✅

When target the device for a run or build, it seems to be a 1 in 10 chance it will work. 🎲
I have no compile errors.
I see these errors all over the place though 'WARNING: Unable to connect to remote client: ssh command' / WARNING: Unable to connect to remote client: No such host is known
One run click will fail, then next will work.

Any thoughts on what is causing this?
 

space_sauce

Member
So after it does work, I try again a bit later I get this error:

Permission Error : Unable to obtain permission to execute

Permission? For what? It was just working. Permissions are the same. o_O
 

peardox

Member
As I remember a clean Ubuntu install doesn't include the SSH Server (I've got loads of similar setups and the first thing I do is install the SSH Server)

Try this...

Open a terminal in your VM
type...

sudo apt-get update
sudo apt-get install openssh-server

That should automatically get everything working

Note that you'll also need the required SDK libraries as per the documentation

I've got this running on one Ubuntu desktop and two Rasperry Pis (a 3 and a 4) - all deploy and run fairly well

Having said that I've also had a few situations where it appeared to install but then didn't run. This was usually resolved by removing the target install directory which is ~/GameMakerStudio2

Think I'll go try a VM as well just to see what happens
 

peardox

Member
Downloading Ubuntu.... Just had a look at the required SDK pages which includes openssh-server so it sounds like you ain't done that bit.

The instructions are a bit linux-newbie unfriendly so for clarity you should type this in terminal

sudo apt-get update
sudo apt-get install build-essential openssh-server clang libssl-dev libxrandr-dev libxxf86vm-dev libopenal-dev libgl1-mesa-dev libglu1-mesa-dev zlib1g-dev libcurl4-openssl-dev
Yep - that second line is a LONG one :)
 

space_sauce

Member

peardox

Member
OK - those were the most obvious things that sprang to mind.

Installing Ubuntu in a VM was a worthwhile exercise as it's just highlighted a more worrying problem. I've now got a clean Ubuntu installed with the bare minimum of additions (the ssh server so I can transfer files to it the normal way)

Anyway I packaged the game I'm working on and copied it to the clean machine, unzipped it and tried running it...

> error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory
This means that if you distribute a finished game for Ubuntu then there's a (fairly good) chance it won't work

If you install the SDK requirements that includes the missing libcurl but then again you don't want to get the end-user installing everything in that list as a lot of it is dev stuff they don't need

I'll have to go thru one by one installing libs until test project works to discover what the end user needs....
 

peardox

Member
And libcurl4-openssl-dev was the only dependency... Installed that and it worked fine.

I presume that this is owing to the fact that I use sprite_add quite a lot - it's only going to working_directory tho...

It would be beneficial if a list of deps was included with the resulting package as I can see situations where other libs may be optionally required
 

chamaeleon

Member
Anyway I packaged the game I'm working on and copied it to the clean machine
Define "packaged". In the Linux world this would typically mean creating a deb, rpm, etc. Is this what you mean, or do you mean a zip file with whatever GMS spits out, which is not sufficient to guarantee being able to run a program?

Maybe people interested in supporting Linux version may find @Samuel Venable's AppImager tutorial useful.

For a more hands-on approach I cobbled this together a while back:

Given the following in an executable file I call gms2-deb, and a zip file containing the exported game from GMS
Code:
#!/bin/bash

zipfile=$1
echo Processing ${zipfile}

directory=${zipfile%.zip}
debiandir=${directory}/DEBIAN
installdir=$directory/usr/local/$directory

echo Creating Debian package directory structure in ${directory}

mkdir -p $debiandir
mkdir -p $installdir

echo Extracting zip file content
unzip -q -o -d $installdir $zipfile

echo Creating control file
cat > $debiandir/control << EOF
Package: $directory
Version: 1.0
Section: games
Priority: optional
Architecture: amd64
Essential: no
Installed-Size: 1024
Maintainer: CHANGE ME
Description: CHANGE ME
Dependencies: libcurl4, libopenal1
EOF

echo Building Debian package
dpkg-deb --build $directory

# Cleanup
echo Removing directory ${directory}
rm -rf ${directory}
Create the deb file and try installing it
Code:
> ./gms2-deb mygame.zip
Processing mygame.zip
Creating Debian package directory structure in mygame
Extracting zip file content
Creating control file
Building Debian package
dpkg-deb: building package 'mygame' in 'mygame.deb'.
Removing directory mygame
> sudo apt install ./mygame.deb
This was just an experiment on my part, clearly to make it more general purpose one might want to change how to deal with things that would be per-game, so that the script does not need to be modified (in other words, a bit of command line argument processing and probably do some installed size estimation).
 

peardox

Member
I rather think Yoyo should output proper deb / rpm packages at a minimum. I mean the button's labeled Create Installer after all...

With a little luck SteamDeck will provide some standardisation and hopefully not reliant on giving Steam $100
 
Top