Distributing Linux build of my game

Started by Laura Hunt, Wed 12/06/2019 17:15:23

Previous topic - Next topic

Laura Hunt

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!

VampireWombat

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.


Laura Hunt

Cool, thanks!  ;-D So if they run it from the command line, they don't have to do anything special, then?

morganw

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
./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.

Laura Hunt

Quote from: morganw on Wed 12/06/2019 20:56:52
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.)

morganw

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.

Laura Hunt

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!

Crimson Wizard

#7
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.

There are free virtual machine programs such as VMWare Player or Virtual Box.
And Ubuntu 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.

VampireWombat

A LiveCD of Ubuntu should actually do what's needed. No installation or needing to learn how to use a virtual machine.

tzachs

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

Laura Hunt

Quote from: tzachs on Thu 13/06/2019 03:45:16
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 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.

eri0o

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: batch

pushd %AGS_GAME_PROJECT_DIR%\Compiled\Linux && 7z a -ttar -so archive.tar . | 7z a -si MYGAME.tar.gz && popd


Laura Hunt

Quote from: eri0o on Thu 13/06/2019 09:31:08
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: batch

pushd %AGS_GAME_PROJECT_DIR%\Compiled\Linux && 7z a -ttar -so archive.tar . | 7z a -si MYGAME.tar.gz && popd


Thanks a lot!

morganw

Quote from: eri0o on Thu 13/06/2019 09:31:08
Code: batch
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.

Quote from: tzachs on Thu 13/06/2019 03:45:16
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, but that isn't very straight-forward for someone just starting out.

Laura Hunt

#14
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. ¯\_(ãÆ'„)_/¯

VampireWombat

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.

morganw

#16
Here is a native way to to create a tar distribution and get the correct permissions set using only what is built into the later versions of Windows 10. I've had this partially completed for some time but I am struggling for free time at the moment to convince myself it is definitely 100% correct, but it works in all the cases I've tested with.

https://github.com/morganwillcock/ags-tar
https://git.sr.ht/~mew/ags-tar

SMF spam blocked by CleanTalk