clementgallet / libTAS

GNU/Linux software to (hopefully) give TAS tools to games
GNU General Public License v3.0
476 stars 56 forks source link

libTAS

Discord Website

GNU/Linux software to give TAS tools to games. Code originates from SuperMeatBoyTaser. It requires a GNU/Linux system with a recent kernel (at least 3.17 for the memfd_create syscall). Supported archs are x86_64 and x86. You will need the Mesa llvm OpenGL driver to support savestates for games using OpenGL.

Discord server: https://discord.gg/3MBVAzU

Website: https://clementgallet.github.io/libTAS/ (still in progress)

Additional documentation on tasvideos.org: https://tasvideos.org/EmulatorResources/LibTAS

Supported Games

Initial work was done to support games using the SDL library (which is the case of many indie games), but other engines are supported now.

By default, you should look for a drm-free version of the game. Games installed through Steam may or may not work. Some Steam games are in fact drm-free, they work without Steam running, or they just need some simple operations. For the other games, there is a "Virtual Steam client" setting in libTAS which implements a dummy Steam client, but it doesn't support every game. Of course, all of this only applies to games that don't have any active protection measure. For more details, check the Game Compatibility page.

There is also initial support for Windows games through wine. Details are given below.

Non-Linux users

If you don't have a Linux system beforehand, there are several options that you can choose:

Install

You can download the latest stable version of the software in the Releases page. The current dependencies are:

Installing with the debian package will install all the required packages as well.

There is also an automated build available for the last interim version, 64-bit with dual-arch.

Building

An PKGBUILD is available for Arch Linux on the AUR.

Dependencies

You will need to download and install the following to build libTAS:

Cloning

git clone https://github.com/clementgallet/libTAS.git
cd libTAS

Building

./build.sh

autoconf will detect the presence of these libraries and disable the corresponding features if necessary. If you want to manually enable/disable a feature, you must add at the end of the build.sh command:

Be careful that you must compile your code in the same arch as the game. If you have an amd64 system and you only have access to a i386 game, you can cross-compile the code to i386 (see below).

Install

cd build
sudo make install

Dual-arch

If you have an amd64 system and you want to run both i386 or amd64 games, you can install libTAS 32-bit library together with the amd64 build. To do that, you can build using ./build.sh --with-i386, which will produce an additional libtas32.so (32-bit) library together with amd64 builds of libTAS GUI and libtas.so library.

You will need the 32-bit version of libraries libX11, libX11-xcb, libasound, libavutil, libswresample, the 32-bit version of the headers for libavutil, libswresample. You will also need your compiler to be able to cross-compile, by installing g++-multilib if using g++ compiler. When running a game, libTAS will choose automatically the right libtas.so library based on the game arch.

Run

To run this program, you can use the program shortcut in your system menu, or open a terminal and enter:

libTAS [game_executable_path [game_cmdline_arguments]]

You can type libTAS -h to have a description of the program options.

The program prompts a graphical user interface where you can start the game or change several options. Details of the different options are available here

There are a few things to take care before being able to run a game. You might want to look at the software usage.

Here are the default controls when the game has started:

Note: the game starts up paused.

Run Windows games through Wine

This is still experimental. To launch Windows games through Wine, you first need to install Wine on your system (it must be located somewhere in $PATH).

To get audio correctly handled, you need to open winetricks, then select "Select the default wineprefix", "Change settings" and check "sound=alsa".

In the game executable field, you must set the Windows .exe executable (both 32-bit and 64-bit are supported, given that you have the wine version for it). It will detect a Windows executable and launch Wine with the right options.

There are still a lot of issues to fix:

Run on Windows using Docker

One option if you have a Windows system is to run a Linux distribution inside a Docker container. This has the advantage of automating package installation and libTAS compilation. On Windows there are currently two possibilities for using Docker: Docker for Windows and Docker Toolbox. There are some requirements for the former (Windows 10 64-bit Pro, Enterprise, or Education), so I will describe the installation process for the later (both should be really close, but I can't test the former).

Install

Run

docker run -ti --rm -e DISPLAY="<ip>:0.0" -v /c/Users/path/to/shared/folder:/root/games libtas

You need to use the Unix syntax again for your shared folder path. Relative paths don't work here.

This should open a terminal in your container. You can then enter libTAS to launch the program. If everything goes right, you should see the libtas window appear. If it complains about not been able to open the display, check again your ipv4 field. You can also access to your shared files located inside /root/games path. Because of how Docker works, everything that is modified outside of /root/games will not be preserved on later instances of the container, so be sure to install and save everything inside that directory.

TODO: Figure out how to use Mesa OpenGL.

Run on Linux using Docker

Install

Run

docker run --net=host -ti --rm -v /tmp/.X11-unix:/tmp/.X11-unix -v "$XAUTHORITY:/root/.Xauthority:rw" -e DISPLAY libtas

This should open a terminal in your container. You can then enter libTAS to launch the program. If everything goes right, you should see the libtas window appear. If you want to access to your local files, you can add -v $HOME:/home in the command options to map your $HOME directory to /home. Because of how Docker works, everything that is modified outside of this directory will not be preserved on later instances of the container.

Logo

Made by brunovalads.

License

libTAS is distributed under the terms of the GNU General Public License v3.

Copyright (C) 2016-2024 clementgallet
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>