/agape

Agape - AppImage Game Packer

Primary LanguageShellApache License 2.0Apache-2.0

Agape - AppImage Game Packer

[[TOC]]

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

Supported applications for packaging

Todo

  • Open yad GUI, when no arguments are passed

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

Install

Download the appimage in the releases page.

Usage

Agape requires a directory set-up with the required files for the target platform, ./agape.AppImage displays the following example:

-- Usage:
  main.sh --platform="target-platform" --name="game name" --dir=src-directory
  - "platform": [retroarch,pcsx2,rpcs3,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]

Configuration

Consider an AppImage named my-cool-game.AppImage:

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

Include an extra . in the extension:

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:

agape.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:

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

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

agape-yuzu-example

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:

./agape.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 required dotnet45


Video tutorial

agape-wine-example


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:

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


Showcase

Files displayed on the thunar file manager.

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