• Stars
    star
    223
  • Rank 173,236 (Top 4 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 1 year ago
  • Updated 25 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Gameimage - FlatImage 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:

  1. unionfs: Inside the appimage, writeable with unionfs. [default, recommended]
  2. readonly: Inside the appimage, read-only.
  3. 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
  1. Install the required packages
  • sudo apt install tumbler squashfs-tools thunar
  • sudo pacman -S tumbler squashfs-tools thunar
  1. 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
  1. 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.