GameImage - AppImage Game Packer
- GameImage - AppImage Game Packer
Game emulation is on the rise, with years of contribution from the community and
now with Valve's portable handheld, the steam deck
. The fragmentation with
several platform emulators is daunting, especially since it requires repetitive
configuration for the first time or if the config files go missing. GameImage is
a tool to pack a runner (such as an emulator), a game, and it's configs in a
single appimage
package.
Advantages:
- Simplicity:
- No need to install an emulator or wine to run your games, they are downloaded as appimages and packaged with the game.
- Each game config/saves are in the same folder as the appimage by default (it can be changed to use global ~/.config). Which simplifies backups.
- Usability: get your game running with a double click on a fresh linux install, no dependencies required.
- Storage: Smaller file sizes than loose files, since appimage uses squashfs.
Not.Aidan.mp4
Also watch it on youtube, thanks Not Aidan.
Supported applications for packaging
Showcase
Files displayed on the thunar
file manager.
Graphical User Interface (GUI)
Build Dependencies
Required packages to build:
For arch-based systems:
sudo pacman -S p7zip
For debian-based systems:
sudo add-apt-repository universe
sudo apt update
sudo apt install p7zip-full p7zip-rar
For Fedora:
sudo dnf install p7zip
sudo dnf install glibc.i686
For Vanilla OS:
sudo abroot exec apt install p7zip-full p7zip-rar libc6-i386
Install
Download the appimage in the releases page.
Usage (Command Line)
Gameimage requires a directory set-up with the required files for the target
platform, ./gameimage.AppImage
displays the following example:
-- Usage:
main.sh --platform="target-platform" --name="game name" --dir=src-directory
- "platform": [retroarch,pcsx2,rpcs3,yuzu,wine]
- "name": The name of the game.
- "dir": The directory with the bios, rom, etc. May be absolute or relative.
The source directory must have this structure (files can have any name):
src-directory
ββrom
β ββrom-disc-1.[bin,cue,wbfs,...]
β ββrom-disc-2.[bin,cue,wbfs,...]
β ββ...
β ββrom-disc-n.[bin,cue,wbfs,...]
ββcore # for retroarch
β ββcore.so
ββbios # for retroarch (psone), pcsx2, rpcs3
β ββbios.[bin,PUP]
ββicon
ββicon.[png,svg,jpg]
-- Usage:
main.sh --version # Prints version and exits
Configuration
Consider an AppImage named my-cool-game.AppImage
for the examples below.
Global
Additional search paths (besides rom)
export GIMG_DIR_ROM_EXTRA="/path/to/dir1 /path/to/dir2"
If the path has spaces:
export GIMG_DIR_ROM_EXTRA="\"/path/to my/dir 1\" \"/path/to my/dir 2\""
Wine Specific
Launch Command
It is possible to set the default launch command with --gameimage-cmd
, this is
saved in .my-cool-game.AppImage/config.yml
. Avaliable aliases are:
{wine}
: Path to wine binary included inside the appimage{exec}
: Basename of the default executable{here}
: Directory from which the appimage is launched.{appd}
: AppImage AppDir.
Examples:
# Default command, sets wine to launch main application executable
./my-cool-game.AppImage --gameimage-cmd='{wine} {exec}'
# Use wine to run other executable in the current working directory
./my-cool-game.AppImage --gameimage-cmd='{wine} {here}/other-exec.exe'
# Run winetricks, included in the wine appimage
./my-cool-game.AppImage --gameimage-cmd='{appd}/usr/bin/winetricks'
# Use FSR (gamescope must be installed separately)
./my-cool-game.AppImage --gameimage-cmd='gamescope -U {wine} {exec}'
Select type of packaging
The GIMG_PKG_TYPE
option defines the packaging method, options are:
unionfs
: Inside the appimage, writeable with unionfs.[default, recommended]
readonly
: Inside the appimage, read-only.prefix
: Outside the AppImage (in a hidden folder called.my-game.AppImage.config
).
[1]
Packs everything inside the appimage, the game can write to its own
directory with unionfs.
[2]
Packs everything inside the appimage, read-only (might not work for some
games).
[3]
The software is moved to .my-game.AppImage.config
, the appimage acts
as a launcher.
Example:
export GIMG_PKG_TYPE=prefix
Select Wine Distribution
Default distribution is wine-ge. Available are:
- staging
- caffe
- vaniglia
- soda
To change it, export the variable before running the appimage, e.g:
export GIMG_WINE_DIST=soda
Emulator Specific
Configure the emulator bundled inside the appimage
my-cool-game.AppImage --config
Change the global
settings, and it will only apply to the game in the
.AppImage
.
In the case of wine if you pass any parameters, they'll be executed as
wine args...
Make the AppImage use the global configuration directory
Include an extra .
in the extension to use ~/.config
:
From my-cool-game.AppImage
to my-cool-game..AppImage
Test the emulator inside the appimage
You can also pass any arguments to the emulator directly:
my-cool-game.AppImage -L "/path/to/my/core.so" "my-other-cool-rom"
Examples
rpcs3 example
For rpcs3
you can set up:
my-game-dir
βββ bios
βΒ Β βββ bios.PUP
βββ icon
βΒ Β βββ my-game-cover.png
βββ rom
βββ PS3_DISC.SFB
βββ PS3_GAME
and run:
gameimage.AppImage --platform=rpcs3 --name="My cool game" --dir=./my-game-dir
pcsx2 example
Similarly for pcsx2
:
my-game-dir
βββ bios
βΒ Β βββ my-ripped-bios.bin
βββ icon
βΒ Β βββ my-game-cover.jpg
βββ rom
βββ my-game.iso
and run:
./gameimage.AppImage --platform=pcsx2 --name="My cool game" --dir=./my-game-dir
retroarch example
For retroarch
:
my-game-dir
βββ bios
βΒ Β βββ my-ripped-bios.bin
βββ core
βΒ Β βββ swanstation_libretro.so
βββ icon
βΒ Β βββ my-game-cover.png
βββ rom
βββ my-game-disc-1.bin
βββ my-game-disc-1.cue
βββ my-game-disc-2.bin
βββ my-game-disc-2.cue
βββ my-game-disc-3.bin
βββ my-game-disc-3.cue
βββ my-game-disc-4.bin
βββ my-game-disc-4.cue
and run:
./gameimage.AppImage --platform=retroarch --name="My cool game" --dir=./my-game-dir
This defaults the disc 1 to start with the appimage, you can open retroarch
interface with F1
or other key you configured it with. And change discs in
there. Remove the bios
folder for platforms that do not require it.
yuzu example with video
Video tutorial:
yuzu.mp4
For yuzu
:
my-game-dir
βββ bios
βΒ Β βββ my-firmware.[zip,7z]
βββ keys
βΒ Β βββ my-keys.[zip,7z]
βββ icon
βΒ Β βββ my-game-cover.png
βββ rom
βΒ Β βββ my-game.nsp
βββ update # This folder is optional
Β Β βββ my-dlc-1.nsp
Β Β βββ my-dlc-2.nsp
Β Β βββ my-update.nsp
and run:
./gameimage.AppImage --platform=yuzu --name="My cool game" --dir=./my-game-dir
During the install, yuzu will open to install the updates in the update
folder.
wine example with video
Since version 0.2.0
the wine module works across several linux distros.
In the winetricks
stage, some applications might require dotnet45
Video tutorial
wine.mp4
Directory structure:
my-game-dir
βββ icon
βΒ Β βββ my-game-cover.png
βββ rom
βββ my-game-installer-1.bin
βββ my-game-installer-2.bin
βββ my-game-installer-3.bin
βββ my-game-installer.exe
and run:
./gameimage.AppImage --platform=wine --name="My cool game" --dir=./my-game-dir
During the installation, you will select the architecture (32 or 64) bit, and
use wine to install the desired game from it's gog's .exe
, in the rom folder.
Tutorial on how to show icons for generated AppImages
The following methods use thunar, other supported file managers are listed
here. Note that the appimage
must be set as executable for the thumbnail generation.
Automatic Method
Execute the install script:curl https://gitlab.com/formigoni/gameimage/-/raw/master/thumbnailer/install.sh | bash
Manual Method
- Install the required packages
sudo apt install tumbler squashfs-tools thunar
sudo pacman -S tumbler squashfs-tools thunar
- Copy the thumbnailer files
sudo curl --output /usr/bin/thumbnailer-appimage https://gitlab.com/formigoni/gameimage/-/raw/master/thumbnailer/thumbnailer-appimage
sudo chmod +x /usr/bin/thumbnailer-appimage
mkdir -p ~/.local/share/thumbnailers
curl --output ~/.local/share/thumbnailers/appimage.thumbnailer https://gitlab.com/formigoni/gameimage/-/raw/master/thumbnailer/appimage.thumbnailer
- Allow icons on files over 2GB
mkdir -p ~/.config/tumbler
cp /etc/xdg/tumbler/tumbler.rc ~/.config/tumbler/
awk -i inplace '/\[DesktopThumbnailer\]/,/MaxFileSize=(.*)/ { sub("MaxFileSize=.*", "MaxFileSize="); } 1' ~/.config/tumbler/tumbler.rc
Disclaimer: This project does not endorse piracy, buy your games and console to use this software.