Ruffle is an Adobe Flash Player emulator written in the Rust programming language. The Linux version can be used in conjunction with libTAS to make tool-assisted speedruns of Flash games.
Table of contents
What you'll need
- libTAS (1.4.3 or newer).
- Remember that the run must sync on an official emulator version or it will not be accepted.
- A nightly build of Ruffle. Currently there are no official releases of Ruffle.
- Builds since 2024-01-17 fail to be properly hooked by libTAS 1.4.5 or older. Use the latest version of libTAS.
- Your Flash game! This will be in the
.swf
format.- Thousands of Flash games are archived in BlueMaxima's Flashpoint project.
- A lot of official game sources are listed at the bottom of https://ruffle.rs/ as Diamond Sponsors.
- If the game is embedded in a website and there is no download link, you may have to look at the page's source code to find the link to it. If it's run via Ruffle, you can Copy Debug Info via rightclick and find SWF URL there.
Test your game natively in Ruffle before you try TASing it! Ruffle is a work in progress and some games are incompatible. If you get a popup message about unsupported features, the game won't work yet and you'll have to try Ruffle again later. If your game runs but has some glitches that don't occur in the regular Adobe Flash Player, post a well-written, detailed issue on how to reproduce it and hope for the best.
Using with libTAS
Thankfully, setting it up with libTAS is not very complicated.
- Set the executable path to the Ruffle build you downloaded.
- Set the command line options to
/path/to/yourgame.swf
, substituting the path of your game. This will default to Vulkan graphics. Optionally add-g gl
to use OpenGL. - If you are using build 2023-08-03 or newer, you can add
--no-gui
to remove the menu bar. - If you have an AS3 game and are using 2023-07-22 or older, add
--dont-warn-on-unsupported-content
.
If libTAS fails to hook with Ruffle
If you are using GNOME or similar GUI and libTAS fails to hook to Ruffle, you may have a problem with your
Wayland
display protocol (e.g., you only have X11 installed). A possible error message you might see is:
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
To fix this problem, you may edit your GNOME config file
/etc/gdm3/custom.conf
and set WaylandEnable=false
and restart. Another possible solution is to disable Wayland in the environment variables: export WAYLAND_DISPLAY=""
Framerate
Set the frames per second to the proper frame rate for your Flash game.
Setting it too low will incorrectly speed up the game, squander viable input frames, and reduce the encode quality. And setting it too high will cause Ruffle to freeze - although if for some reason you need the higher framerate, Ruffle may still work with Runtime -> Time tracking -> clock_gettime() checked.
Since Nightly 2023-02-25, Ruffle can print SWF info to the terminal if you launch libTAS with the following command:
RUST_LOG=ruffle_core=info libTAS | grep "Loaded SWF version"
For ealier Ruffle releases (though the new releases are mostly sync compatible with the old ones), you can open up a terminal and install
exiftool
first with this command:
sudo apt install libimage-exiftool-perl
And then use this command:
exiftool /path/to/yourgame.swf
This will list information about the
.swf
, including the frame rate.
Yet another way to see the game's internal framerate is opening it in JPEXS.
Domain locking
Some Flash games are domain locked, meaning that you can only run them on specific websites. To get these games to work on the desktop version of Ruffle, you can trick the game into thinking it's on the correct website. As of nightly-2022-10-23, you can use the command-line parameter
--spoof-url http://example.yoururlhere
to feed the game any URL you want.
Nvidia drivers
If Ruffle is not working with Nvidia drivers, run the following commands and reboot your PC:
sudo apt install ubuntu-drivers-common
sudo apt install nvidia-driver-535 && nvidia-cuda-toolkit
sudo apt install ubuntu-restricted-extras && sudo apt install ubuntu-restricted-addons
Now Ruffle should run under libTAS, just make sure to have the Force software rendering option checked.
If Ruffle fails to launch natively when using OpenGL, run
export LIBGL_ALWAYS_SOFTWARE=1
and then run it in the same terminal window.
OpenGL
If Ruffle does not work with
-g gl
you can try the following command in the terminal:
sudo apt install libx11-dev
Movie submissions
We allow submissions using Ruffle with libTAS. Please follow these guidelines to ensure your movie is acceptable and can be synced:
- Follow all rules already in place for submitting libTAS movies.
- Keep in mind our rules on emulation accuracy. Ruffle is incomplete and may not run games perfectly. If your movie has severe emulation problems or uses glitches not present in Adobe Flash Player, your submission may be rejected.
- Make sure your movie starts with no save data! Having your own save data present may cause desyncs when other people try to run your movie. To delete your save data, go to
~/.local/share/ruffle/SharedObjects/localhost/
followed by the path of your.swf
- e.g. if your.swf
is in/path/to/yourgame.swf
, the save data will be in~/.local/share/ruffle/SharedObjects/localhost/path/to/yourgame.swf/
. Delete any.sol
files in this folder (if this folder does not even exist, you're already all set).
- It is recommended (though not mandatory) to use the
--no-gui
argument when launching Ruffle, to prevent the top menu bar from showing. This alleviates the need to trim it out during the publishing process.
- When making a libTAS movie that you plan to submit to TASVideos or upload it to userfiles, put
Platform: Flash
at the very start of the.ltm
annotations, that way the site will recognize your platform properly.- This can be done within libTAS by opening Movie -> Annotations while recording a movie.
- In the submission or movie annotations, please provide the following:
- libTAS version
- The nightly Ruffle build you used
- Filename and MD5 hash of your
.swf
(usemd5sum yourgame.swf
in a terminal)
Tools
- JPEXS Free Flash Decompiler - You can use this to look at the code for any
.swf
. Extremely useful for figuring out how your game works as well as exploiting game environments and restrictions.