Tthecreator
Your Creator!
GM Version: GMS2.2.2.413 (Runtime: v2.2.2.326)
Target Platform: Ubuntu 19.04 (Other Linux versions may work as well)
Download: N/A
Links:
Ubuntu 19.04
Ubuntu 19.10
Linux Mint 19.1
Elementary 5.1.2
Summary:
This tutorial tells you how to get GameMakerStudio2 to install, the IDE to run and get it to compile games.
This is accomplished using wine and some fiddling around with .NET.
Requirements:
64x bit install of Ubuntu 19.04
gms2 installer file: GameMakerStudio-Installer-2.2.2.413.exe (others may work as well)
Todo:
Fix GLX errors. (Wine openGL to X window manager doesn’t work correctly)
Test Android support.
OS images with all dependencies needed:
If you don't have Linux installed yet, you can use this ISO image by @Samuel Venable to get gms2 running quickly:
https://forum.yoyogames.com/index.php?threads/run-the-gms2-ide-on-ubuntu-19-04.64330/#post-405199
It is based on Ubuntu with KDE Neon. Check out his post for more details.
Tutorial:
First install the latest version of wine using these commands:
You need wine 4.10, earlier wine versions (like 4.2) will NOT work.
Next up, we want to install q4wine. This is a usefull tool to manage prefixes, manage running processes and load up .exe files correctly.
We need to setup a wine prefix in q4wine:
Run the following command to initiate the prefix: (We're also going to uninstall mono)
We need to install .NET now. use the following commands:
Install gms2:
GMS2 IDE should now open automatically. (or it may not) If it does, close it.
If you want to start it manually execute the following command:
In the IDE, login to your account and wait for the runtime to install.
Start a new test project, make a room, an object and add a hello world message.
Click run. Your game should now start.
Compile a native linux executable:
Make a launcher shortcut
Compile for android:
Sources:
http://ubuntuhandbook.org/index.php/2019/05/nstall-wine-4-8-ubuntu-19-04-18-04/
https://wiki.winehq.org/Mono
https://www.yoyogames.com/blog/107/how-to-compile-to-linux-ubuntu
https://forum.winehq.org/viewtopic.php?f=8&t=14285
https://linuxconfig.org/how-to-crea...ncher-on-ubuntu-18-10-cosmic-cuttlefish-linux
https://www.omgubuntu.co.uk/2018/02/app-menu-editor-for-ubuntu-appeditor
https://github.com/donadigo/appeditor
https://stackoverflow.com/questions...d-to-notify-project-evaluation-listener-error
https://developer.android.com/studio/build/building-cmdline
https://stackoverflow.com/questions/4567904/how-to-start-an-application-using-android-adb-tools
https://stackoverflow.com/questions...se-agreements-of-the-following-sdk-components
https://github.com/oblador/react-native-vector-icons/issues/527
https://www.guru99.com/how-to-install-java-on-ubuntu.html
http://tipsonubuntu.com/2016/07/31/install-oracle-java-8-9-ubuntu-16-04-linux-mint-18/
https://askubuntu.com/questions/620888/installing-jdk-with-wine
https://stackoverflow.com/questions/37691070/cannot-install-jdk-8-on-wine-ubuntu
https://help.yoyogames.com/hc/en-us/articles/216753498-GameMaker-Studio-Android-SDK-and-NDK-setup-
special thanks to:
The winehq team (For not making an emulator)
@tijeseffff (For fixing a problem where the IDE was unable to start Igor.exe)
@XSonicRU (For suggesting testing this with Android)
@canoi (For testing Linux Mint 19.1)
@Spectre216 (For fixing a problem where the IDE was unable to start Igor.exe)
@Yal (For hiding terminals)
@Binsk (For proposing a solution to some font issues)
@Samuel Venable (For providing an easy to install distro with all required dependencies)
@benway (For finding a bug where GMS2 can't be uninstalled or updated)
@Pir Jacques (For finding a bug where GMS2 spits out errors)
@❤️×1 (For testing GMS2 on elementary OS)
@IceExplosive (For reporting an issue where the IDE is quite slow at times)
Target Platform: Ubuntu 19.04 (Other Linux versions may work as well)
Download: N/A
Links:
- https://dl.winehq.org/wine-builds/winehq.key
- https://dl.winehq.org/wine-builds/ubuntu/ disco main
https://www.yoyogames.com/blog/107/how-to-compile-to-linux-ubuntu- https://help.yoyogames.com/hc/en-us/articles/235186168
- https://www.yoyogames.com/images/gms2_logo_512.png
Ubuntu 19.04
Ubuntu 19.10
Linux Mint 19.1
Elementary 5.1.2
Summary:
This tutorial tells you how to get GameMakerStudio2 to install, the IDE to run and get it to compile games.
This is accomplished using wine and some fiddling around with .NET.
Requirements:
64x bit install of Ubuntu 19.04
gms2 installer file: GameMakerStudio-Installer-2.2.2.413.exe (others may work as well)
Todo:
Fix GLX errors. (Wine openGL to X window manager doesn’t work correctly)
Test Android support.
OS images with all dependencies needed:
If you don't have Linux installed yet, you can use this ISO image by @Samuel Venable to get gms2 running quickly:
https://forum.yoyogames.com/index.php?threads/run-the-gms2-ide-on-ubuntu-19-04.64330/#post-405199
It is based on Ubuntu with KDE Neon. Check out his post for more details.
Tutorial:
First install the latest version of wine using these commands:
You need wine 4.10, earlier wine versions (like 4.2) will NOT work.
add wine repo key:
wget -nc https://dl.winehq.org/wine-builds/winehq.key && sudo apt-key add winehq.key
add wine repository:
sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ disco main'
note: If you are on any other distribution, you might need use a different link.
On Ubuntu 18.04 or Linux Mint 19.1 this is: (Thanks to @canoi)
sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'
add repo for unmet dependency libfaudio0:
sudo add-apt-repository ppa:cybermax-dexter/sdl2-backport
update available packages:
sudo apt update
install wine:
sudo apt install --install-recommends winehq-devel
If everything went correctly "wine --version" should return "wine-4.10¨Next up, we want to install q4wine. This is a usefull tool to manage prefixes, manage running processes and load up .exe files correctly.
install q4wine:
sudo apt install q4wine
install winetricks:
sudo apt install winetricks
We need to setup a wine prefix in q4wine:
- Create a new gms2 folder in your home folder.
- Open q4wine.
- Run trough the q4wine setup process. (you can mostly click next)
- Create a new prefix under 'prefixes'.
- Name the prefix 'gms2'
- Set the prefixpath to the previously created gms2 folder.
- Set the arch to 64 bit.
- Save the prefix
Run the following command to initiate the prefix: (We're also going to uninstall mono)
(if you chose a different wine prefix folder, don't forget to change it in these commands)
run uninstaller and init the prefix:
WINEPREFIX=~/gms2 WINEARCH="win64" wine64 uninstaller
If you are asked to install wine mono click 'install'. Do the same for gecko.
A wine GUI should open now. Select Mono and click uninstall. Both mono entries should have been deleted.
We need to install .NET now. use the following commands:
Install .NET 4.5.2:
WINEPREFIX=~/gms2/ winetricks dotnet452
Run trough the installers.
If you are given a warning about the windows update server, just continue.
You don't have to restart your computer.
Install gms2:
Now you want to download the gms2 installer .exe file.
Open it with q4wine (right click the file and select 'open with other application' if q4wine is not the default)
In q4wine select the gms2 prefix.
Install gms2.
If you see a "Turn Windows features on or off" message click okay.
If a .NET 3.5 installer opens, cancel the installation.
If a .NET 2.5.4 repair window opens, close it by going into Q4Wine into the processing tab and terminating "Setup.exe"
GMS2 IDE should now open automatically. (or it may not) If it does, close it.
If you want to start it manually execute the following command:
WINEPREFIX=~/gms2 WINEARCH="win64" wine64 "C:\Program Files\GameMaker Studio 2\GameMakerStudio.exe"
(thanks to @tijeseffff )In the IDE, login to your account and wait for the runtime to install.
Start a new test project, make a room, an object and add a hello world message.
Click run. Your game should now start.
Compile a native linux executable:
To compile for linux we are going to follow this guide:
For your ip, you can fill in localhost or '127.0.0.1'
If that doesn't work you can try:
There will be an extensive list of packages to install. However, not all of these packages are available anymore. This can be fixed by using:
sudo apt-get install libssl1.1
sudo apt-get install libbz2
and then 'hacking' libssl to look like libssl1.0.0:
sudo cp /usr/lib/x86_64-linux-gnu/libssl.so.1.1 /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0
sudo cp /usr/lib/x86_64-linux-gnu/libssl.so.1.1 /usr/lib/libssl.so.1.0.0
sudo cp /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
sudo cp /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 /usr/lib/libcrypto.so.1.0.0
Now follow the guide setting up your host to accept ssh connections.
Eventually you should see a native Linux app running on your pc.
Make a launcher shortcut
Download and build AppEditor:
sudo apt install valac libgranite-dev meson
cd ~/
git clone https://github.com/donadigo/appeditor.git
cd appeditor
Build AppEditor:
meson build
cd build
meson configure -Dprefix=/usr
ninja
sudo ninja install
Create startup script:
cd ~/
nano launchGMS2.sh
Insert the following text:
WINEPREFIX="/home/YOUR_USER_NAME_HERE/gms2" WINEARCH="win64" wine64 "C:\Program Files\GameMaker Studio 2\GameMakerStudio.exe"
Press CNTRL+X to close nano. Type 'Y' to save.
Launch AppEditor:
cd ~/appeditor/build
com.github.donadigo.appeditor
GMS2/wine itself should have already made a launcher icon. We are going to edit that.
Find it and:
- set 'Show in Launcher' to true.
- set the 'Category' to Programming
- set 'Command Line' to /home/YOUR_USER_NAME_HERE/launchGMS2.sh
- enable 'Launch in Terminal'
Now save and try the launch entry. (close any open IDE's beforehand)
Compile for android:
Download latest jdk8 for Windows x64, and the latest jdk8 for Linux (.tar.gz):
If you don't have an account you can make one with a temporary email service: https://temp-mail.org/en/view/3586d8b76358d93eabd0f0d53207bfc4
note: I used jdk-8u211.
Launch jdk-8u***-windows-x64.exe with q4wine in gms2 prefix.
Some UI elements of the install will be broken.
Check the box and press the left button.
Click Next
On the next broken screen press the left button again
If the same message keeps popping up, click the right button.
Go to your GMS2 android platform settings and set the JDK to: C:\Program Files\Java\jdk1.8.0_XXX (your directory may be different)
(These steps are kind of vague, they may need to be written down more clearly. These were my notes and I didn't have enough time to walk trough the process again on my tutorial VM.)
Download android studio for windows 64 bit:
Run the installer in the correct prefix using q4wine.
After the installation execute:
WINEPREFIX=~/gms2 WINEARCH="win64" wine64 "C:\Program Files\Android\Android Studio\bin\studio64.exe"
Don't send usage statistics.
Do a custom install.
Set SDK path to C:\Android\SDK
Don't install Intel HAXM
Follow trough with the install. Android studio will start to download components.
When you see the Android Studio welcome screen, click configure and then 'SDK Manager'
Install the correct SDK platforms and the SDK tools. Use this tutorial as reference:
Again, make sure not to install anything to do with HAXM.
Install the components and accept all license agreements.
Install android studio on your host machine with the exact same settings. On Ubuntu you can install android studio trough the Software center. When setting up android studio use linux kernel hardware acceleration module instead of HAXM. (This should be done by default)
Open a terminal and do:
Cd ~/Android/Sdk/platform-tools/
./adb --version
This should yield:
Android Debug Bridge version 1.0.41
Version 29.0.1-5644136
Installed as /home/YOUR_USERNAME/Android/Sdk/platform-tools/adb
Open a second terminal and do:
WINEPREFIX=~/gms2 WINEARCH="win64" wine64 cmd
This will open a windows cmd prompt. Here you can execute:
C:
cd C:\Android\SDK\platform-tools
adb --version
You should see something among the lines of:
Android Debug Bridge version 1.0.41
Version 29.0.1-5644136
Installed as C:\Android\SDK\platform-tools\adb.exe
It is okay if the version numbers between your setup and my setup differ, as long as the Windows and Linux Android Debug Bridge versions are the same.
Luckily for us the ADB uses a separated client interface connected do a daemon server. We can actually run the server on Linux and the client on Windows.
To do this, on your host execute: (In the same folder as last time)
./adb start-server
adb devices
If you had your phone connected to your computer, you should see it identified by adb. If not, connect your phone or troubleshoot your usb connection.
On cmd execute:
adb devices
Your adb devices should show up in Windows.
In GMS, go to the android device editor (open the targets menu, click Android and click on the pencil under devices). Click 'Detect Device'. Your device should show up.
Go back to your android platform settings and generate (or import) a keystore file. This keystore file has to be in the root of your windows system. For example: C:\testProject.keystore. Keeping the keystore file in the root directory makes our life easier down the road and prevents our filename from having any spaces.
Find out what the API level of your phone is and select that in GMS.
Select the processor architecture of your phone. (I had to enable ARM64)
Extract your java-8u***-linux-x64.tar.gz file into your home directory.
Edit your /etc/profile file to set your java home correctly:
sudo nano /etc/profile
Add the following four lines:
JAVA_HOME=/home/thomas/jdk1.8.0_211
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export PATH
Let Ubuntu know where our java is:
sudo update-alternatives --install "/usr/bin/java" "java" "<Directory where JAVA has been extracted>/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "<Directory where JAVA has been extracted>/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "<Directory where JAVA has been extracted>/bin/javaws" 1
sudo update-alternatives --set java <Directory where JAVA has been extracted>/bin/java
sudo update-alternatives --set javac <Directory where JAVA has been extracted>/bin/javac
sudo update-alternatives --set javaws <Directory where JAVA has been extracted>/bin/javaws
java -version should now return:
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
If you see something along the lines of OpenJDK 11, your gradle will not work.
install gradle:
sudo apt install gradle
Create a new android build folder somewhere on your computer.
Add a copy of your keystore to this folder and call it 'project.keystore'.
Add the following python script called launchGMS2AndroidBuild.py:
#launchGMS2AndroidBuild.py
#Author TTheCreator https://forum.yoyogames.com/index.php?members/tthecreator.233/
#This script looks for changes in GMS's cached android build output and will compile and run your android app when GM is done with it's business.
import sys
import time
import logging
import re
import shutil
import os
from watchdog.observers import Observer
from watchdog.events import LoggingEventHandler
import distutils.dir_util
windows_gms2CachePath = "/home/YOUR_USERNAME/gms2/drive_c/users/YOUR_USERNAME/Application Data/GameMakerStudio2/Cache/GMS2CACHE/testProjec_BCCB0FB7_367ADB89"
host_gradleVersion = "2.3.3"
host_sdkDir = "/home/thomas/Android/Sdk/"#Where your android sdk is located
host_keyStore = os.getcwd() + "project.keystore" #The location of your keyfile on your host machine
android_packageName = "com.company.game"#The packagename of your game
host_cacheFile = "gms2cache"#The local folder on your host that is used to hold and manipulate the gms2 android compile cache
last_changed_build_file_pattern = re.compile(".*build.sample") #What file game maker edits last when compiling for android.
def cleanUp():
print("cleaning up...")
if(os.path.isdir(host_cacheFile)):
shutil.rmtree(host_cacheFile)
def copyCacheToHost():
print("copying cache to host")
distutils.dir_util._path_created = {}
distutils.dir_util.copy_tree(windows_gms2CachePath, host_cacheFile)
def changeProjectFileForHostCompatibility():
setHostGradleVersion()
setSdkSrcDir()
setKeystoreFile()
def setHostGradleVersion():
#make sure we are using the correct gradleVersion
print("Setting gradle version to:"+host_gradleVersion)
with open (host_cacheFile+"/Android/default/build.gradle", 'r') as f:
content = f.read()
content_new = re.sub("gradle:.*'", "gradle:"+host_gradleVersion+"'", content)
with open (host_cacheFile+"/Android/default/build.gradle", 'w') as f:
f.write(content_new)
def setKeystoreFile():
#make sure we are using the correct gradleVersion
print("Setting keystore file to:"+host_keyStore)
with open (host_cacheFile+"/Android/default/"+android_packageName+"/build.gradle", 'r') as f:
content = f.read()
content_new = re.sub("C:/.*.keystore", host_keyStore, content)
with open (host_cacheFile+"/Android/default/"+android_packageName+"/build.gradle", 'w') as f:
f.write(content_new)
def setSdkSrcDir():
print("Setting sdk source directory to:"+host_sdkDir)
with open (host_cacheFile+"/Android/default/local.properties", 'w') as f:
f.write("sdk.dir="+host_sdkDir)
def gradleCompile():
print("Using Gradle to compile in:"+host_cacheFile+"/Android/default")
os.system("cd "+host_cacheFile+"/Android/default && gradle installDebug && cd ../../../")
def runOnDevice():
print("Using adb to run the app on a device")
os.system(host_sdkDir+"platform-tools/adb shell monkey -p "+android_packageName+" 1")
class GMSEventHandler(LoggingEventHandler):
def on_any_event(self, event):
print("HI!")
#print(event)
print(event.src_path)
if (last_changed_build_file_pattern.match(event.src_path)):
print("build sample file has been edited")
copyCacheToHost()
changeProjectFileForHostCompatibility()
gradleCompile()
runOnDevice()
cleanUp()
if __name__ == "__main__":
print("Started looking for changes to: "+windows_gms2CachePath)
cleanUp()
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
event_handler = GMSEventHandler()
observer = Observer()
observer.schedule(event_handler, windows_gms2CachePath, recursive=True)
observer.start()
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
observer.stop()
observer.join()
cleanUp()
You will need to edit this python file to make sure it runs on your machine. On the top of the files there are a bunch of settings you can change. This script only supports full system paths. '~/' is invalid and will not work. That's why you may need to inject your username into the script.
To start the script open a terminal in the folder you created and execute:
python3 launchGMS2AndroidBuild.py
You might need to install the watchdog python module:
pip3 install watchdog
If you don't have python installed:
sudo apt install python3
sudo apt install python3-pip
To stop the script press CNTRL+Z
From this point on my python script should take care of everything for you. Once it detects that build.sample has been updated, it will copy over the GMS2 android compile cache, change some settings and finally run gradle. Gradle will install the app for you on your phone after which the python script will launch it.
Known problems without solutions:When GameMaker runs through this method it spits out never-ending 'Changes made to project file' errors.
There is no fix for this yet.
Thanks to @Pir Jacques for reporting this issue
GameMaker can run very slow at times for unknown reasons
Thanks to @IceExplosive for reporting this issue
Known problems with solutions:Igor.exe invalid parameter:
Make sure to launch GMS2 from the right prefix and from the terminal.
Use a command like this:
Code:
[/INDENT][/INDENT][/INDENT][/INDENT]
[INDENT][INDENT][INDENT][INDENT]Exec=gnome-terminal -- bash -c 'WINEPREFIX="/home/user/gms2" WINEARCH="win64" wine64 "C:\Program Files\GameMaker Studio 2\GameMakerStudio.exe"'[/INDENT][/INDENT][/INDENT][/INDENT]
[INDENT][INDENT][INDENT][INDENT]
Try adding --geometry 1x1+9999+9999 (COLUMNS x ROWS + X + Y) to the gnome-terminal command and it should make the window small and offscreen.
Thanks to @Spectre216 and @Yal for this issue!
Font problems:
Install fonts in wine:
Code:
[/INDENT][/INDENT][/INDENT][/INDENT]
[INDENT][INDENT][INDENT][INDENT]WINEPREFIX=~/gms2 winetricks allfonts[/INDENT][/INDENT][/INDENT][/INDENT]
[INDENT][INDENT][INDENT][INDENT]
Thanks to @Binsk for this issue!
GLX Errors:
If you see any of the following in your terminal while running GMS:
- wine X Error of failed request: BadValue
- Any error saying something with GLX
Do the following:
- restart your pc
- upgrade or reinstall your video drivers.
'This program encountered an error':
In some cases wine might throw an error saying the program cannot be booted. When this happens is somewhat random and you might need to try launching GMS2 a few times before it finally works.
Wine screws up audio:
In some specific configurations starting a wine program may cause your sound to become higher or lower. To fix this execute:
pulseaudio --kill
Running gradle gives you a license error:
open android studio on your host. Open the sdk manager and install the corresponding package. You may need to check 'Show Package Details'.
Make sure you can compile an app (just an empty test project) in android studio on your host using the same build tools version and sdk version. You can change this in file>project structure
Go into your android sdk directory on your host:
cd ~/Android/Sdk/tools/bin
and:
./sdkmanager --licenses
say 'y' to all
adb server version (41) doesn't match this client (39); killing...
This error occurs when you are using multiple adb versions. Make sure the adb version of your host machine is the same as on your windows machine.
Make sure you have your adb daemon running on your Linux host.
On your host, make sure you are running the program adb in the platform-tools folder.
Cd into this folder and use './adb'. The ./ is important.
Make sure the package 'android-tools-adb' is NOT installed. Uninstall it with:
sudo apt purge android-tools-adb
GameMAkerStudio.exe is running. Please close it first.
This message may appear when updating/uninstalling GMS2.
Unfortunately, this problem has not been solved.
For now, you will have to start all over by creating a new prefix.
Sources:
http://ubuntuhandbook.org/index.php/2019/05/nstall-wine-4-8-ubuntu-19-04-18-04/
https://wiki.winehq.org/Mono
https://www.yoyogames.com/blog/107/how-to-compile-to-linux-ubuntu
https://forum.winehq.org/viewtopic.php?f=8&t=14285
https://linuxconfig.org/how-to-crea...ncher-on-ubuntu-18-10-cosmic-cuttlefish-linux
https://www.omgubuntu.co.uk/2018/02/app-menu-editor-for-ubuntu-appeditor
https://github.com/donadigo/appeditor
https://stackoverflow.com/questions...d-to-notify-project-evaluation-listener-error
https://developer.android.com/studio/build/building-cmdline
https://stackoverflow.com/questions/4567904/how-to-start-an-application-using-android-adb-tools
https://stackoverflow.com/questions...se-agreements-of-the-following-sdk-components
https://github.com/oblador/react-native-vector-icons/issues/527
https://www.guru99.com/how-to-install-java-on-ubuntu.html
http://tipsonubuntu.com/2016/07/31/install-oracle-java-8-9-ubuntu-16-04-linux-mint-18/
https://askubuntu.com/questions/620888/installing-jdk-with-wine
https://stackoverflow.com/questions/37691070/cannot-install-jdk-8-on-wine-ubuntu
https://help.yoyogames.com/hc/en-us/articles/216753498-GameMaker-Studio-Android-SDK-and-NDK-setup-
special thanks to:
The winehq team (For not making an emulator)
@tijeseffff (For fixing a problem where the IDE was unable to start Igor.exe)
@XSonicRU (For suggesting testing this with Android)
@canoi (For testing Linux Mint 19.1)
@Spectre216 (For fixing a problem where the IDE was unable to start Igor.exe)
@Yal (For hiding terminals)
@Binsk (For proposing a solution to some font issues)
@Samuel Venable (For providing an easy to install distro with all required dependencies)
@benway (For finding a bug where GMS2 can't be uninstalled or updated)
@Pir Jacques (For finding a bug where GMS2 spits out errors)
@❤️×1 (For testing GMS2 on elementary OS)
@IceExplosive (For reporting an issue where the IDE is quite slow at times)
Last edited: