Adventure Game Studio | Forums

AGS Support => Beginners' Technical Questions => Topic started by: notarobotyet on 12 Jun 2019, 17:15

Title: Distributing Linux build of my game
Post by: notarobotyet on 12 Jun 2019, 17:15
So I'm almost embarrassed to have to ask this, but I've spent the whole day searching the forums and I haven't found anything this specific, maybe because it's such a basic question that everybody knows how to do it  :(

I've managed to figure out how to compile my game for Linux using AGS version 3.4.1 and now I have a "Linux" folder in my "Compiled" folder with files such as mygame.ags, ags32, ags64, etc. All good, or so it seems.

So what do I do now? Do I simply compress it (I guess it should be a tar.gz archive?), upload it to itch.io and that's it? Would someone who wants to play it simply run something like "ags64 mygame.ags", or do I have to include any additional instructions?

Thanks a lot in advance!
Title: Re: Distributing Linux build of my game
Post by: VampireWombat on 12 Jun 2019, 17:34
Yeah, compressing the folder and subfolders is what to do. I guess you could use tar,gz, but zip should be fine. I can't think of a time since I've been using Ubuntu that I've dealt with tar.gz.
As for additional instructions, maybe. If so you'd need to include needing to right click on the ags32 or ags64 file and changing the permission to run as a program.

(http://ags.pics/3Kba.png)
Title: Re: Distributing Linux build of my game
Post by: notarobotyet on 12 Jun 2019, 18:40
Cool, thanks!  ;-D So if they run it from the command line, they don't have to do anything special, then?
Title: Re: Distributing Linux build of my game
Post by: morganw on 12 Jun 2019, 20:56
You need to set the executable bit for ags32, ags64, and the script that is at the top level (I think it is always named after the game).
When someone wants to run the game they run the top level script.

Code: Bash
  1. ./mygame

I think the executable bit is only preserved in zip files through the use of extended attributes, and the use of these when extracting depends on the program used. You are better off using a tar archive and using compression that older tools can cope with, so gzip or bzip2 are probably the best choices.
Title: Re: Distributing Linux build of my game
Post by: notarobotyet on 12 Jun 2019, 21:14
You need to set the executable bit for ags32, ags64, and the script that is at the top level (I think it is always named after the game).

Thanks morganw, but... it doesn't look like I can do this on Windows, right? Or is this something that the user/player should do on their end after they've downloaded the game?

(I guess I should have clarified from the start, but I don't use Linux, which is why I'm completely clueless as to how this whole process should go.)
Title: Re: Distributing Linux build of my game
Post by: morganw on 12 Jun 2019, 21:38
Ideally these things are already set in the archive, the player can set them but they wouldn't necessarily know which files would be executable. If you just have Windows then it is tricky to do, it is a feature that should be handled by the Editor but unfortunately it doesn't do it at the moment (it needs to create and write into a tar archive but that isn't something .NET supports out-of-the-box).

So to sum up, at the moment you need to be using some Unix like system that supports the permissions (Linux/macOS/etc...) or have a friend who is doing so and can create the archive for you.
Title: Re: Distributing Linux build of my game
Post by: notarobotyet on 12 Jun 2019, 22:00
Oh ok, that's unfortunate, but at least now I have a much clearer picture of how the whole thing works. Thanks a lot for the help!
Title: Re: Distributing Linux build of my game
Post by: Crimson Wizard on 12 Jun 2019, 23:38
If you don't have a Lunux, you could create a Linux virtual machine and install some relatively easy linux system like Ubuntu which looks almost like Windows (https://aozoeky4dglp5sh0-zippykid.netdna-ssl.com/wp-content/uploads/2016/04/ubuntu-16.04-lts-xenial-xerus.jpg).

There are free virtual machine programs such as VMWare Player (https://www.vmware.com/products/workstation-player.html) or Virtual Box (https://www.virtualbox.org/).
And Ubuntu (https://ubuntu.com/download/desktop) is completely free.

Ofcourse it will take some time to learn how virtual machines work, but then you will be able to test your game on linux yourself.
Title: Re: Distributing Linux build of my game
Post by: VampireWombat on 13 Jun 2019, 00:00
A LiveCD (https://help.ubuntu.com/community/LiveCD) of Ubuntu should actually do what's needed. No installation or needing to learn how to use a virtual machine.
Title: Re: Distributing Linux build of my game
Post by: tzachs on 13 Jun 2019, 03:45
If you're on Windows 10, then in their latest version they've added the "Windows subsystem for linux" which saves you the need to install your own virtual machine.
You can just grab ubuntu directly from the windows store: https://www.microsoft.com/en-us/p/ubuntu/9nblggh4msv6#activetab=pivot:overviewtab
Title: Re: Distributing Linux build of my game
Post by: notarobotyet on 13 Jun 2019, 07:17
If you're on Windows 10, then in their latest version they've added the "Windows subsystem for linux" which saves you the need to install your own virtual machine.
You can just grab ubuntu directly from the windows store: https://www.microsoft.com/en-us/p/ubuntu/9nblggh4msv6#activetab=pivot:overviewtab

Tzachs, this is amazing, I had no idea!  8-0 Thanks a lot, I might end up giving it a try because, as much as I find the idea of a Live CD appealing in its simplicity, I actually don't have a CD reader in my laptop anymore. And learning to use virtual machines feels like a bit overkill for what I want :)

For the moment, and while I take a stab at doing it myself, I have included instructions on my itch.io download page (https://laurahunt.itch.io/a-room-without-you-in-it) for players to set the executable bit themselves, as per the comments I've received here. I don't think there'll be tons of downloads in any case, but hope it'll will be helpful if there are any.

Thanks all! This has been super useful, as always. What a fantastic forum this is.
Title: Re: Distributing Linux build of my game
Post by: eri0o on 13 Jun 2019, 09:31
This I have sent people in the past, if you have 7-zip installed, just copying here, magical lines for packing tar.gz on Windows, for Linux, preserving the permissions. Requires having 7z.exe on path.

Code: Windows Batch file
  1. pushd %AGS_GAME_PROJECT_DIR%\Compiled\Linux && 7z a -ttar -so archive.tar . | 7z a -si MYGAME.tar.gz && popd
  2.  
Title: Re: Distributing Linux build of my game
Post by: notarobotyet on 13 Jun 2019, 09:47
This I have sent people in the past, if you have 7-zip installed, just copying here, magical lines for packing tar.gz on Windows, for Linux, preserving the permissions. Requires having 7z.exe on path.

Code: Windows Batch file
  1. pushd %AGS_GAME_PROJECT_DIR%\Compiled\Linux && 7z a -ttar -so archive.tar . | 7z a -si MYGAME.tar.gz && popd
  2.  

Thanks a lot!
Title: Re: Distributing Linux build of my game
Post by: morganw on 13 Jun 2019, 12:44
Code: Windows Batch file
  1. pushd %AGS_GAME_PROJECT_DIR%\Compiled\Linux && 7z a -ttar -so archive.tar . | 7z a -si MYGAME.tar.gz && popd

This probably results in every file being set as executable, which probably works for people manually running it but might confuse a launcher application that is looking for something to run. So I wouldn't recommend doing this and then uploading it to itch.io, unless you are also supplying a manifest file that says which file should be used to start the game.

If you're on Windows 10, then in their latest version they've added the "Windows subsystem for linux" which saves you the need to install your own virtual machine.
You can just grab ubuntu directly from the windows store: https://www.microsoft.com/en-us/p/ubuntu/9nblggh4msv6#activetab=pivot:overviewtab

I think this would give a similar result, NTFS cannot back these permissions so everything will be mapped to something that is too permissive by default. It is probably possible by creating a tar archive using any tool and then using "Windows subsystem for Linux" to edit the permissions with Emacs (https://www.gnu.org/software/emacs/manual/html_node/emacs/File-Archives.html), but that isn't very straight-forward for someone just starting out.
Title: Re: Distributing Linux build of my game
Post by: notarobotyet on 13 Jun 2019, 13:26
ffffffffffffffffffffffffffffuuuuuu lol

ok, I guess I've bitten off more than I can chew. Thanks for all the help and the time you've taken to guide me through this, guys, I really mean it. But this is driving me crazy. I'll just leave the .zip file up on itch.io with the instructions for players to set the correct permissions themselves for ags32, ags64 and the top-level game script (again, thanks to everybody who helped with this!), and if they can figure it out, great. And if not, well, I tried. A little bit at least. ¯\_(ツ)_/¯
Title: Re: Distributing Linux build of my game
Post by: VampireWombat on 13 Jun 2019, 13:41
You should be fine with that. Most Linux users should be able to figure it out with the info you provided. Or be able to play the Windows version using Wine. I've done both the last 24 hrs and I'm far from an advanced Linux user.