Skip to content

Instantly share code, notes, and snippets.

@Centzilius
Last active April 23, 2024 16:18
Show Gist options
  • Save Centzilius/57892e5d1aaea51b3f389e6f1d587c97 to your computer and use it in GitHub Desktop.
Save Centzilius/57892e5d1aaea51b3f389e6f1d587c97 to your computer and use it in GitHub Desktop.
""" Game fix for FFXIV
"""
#pylint: disable=C0103
from protonfixes import util
import os
from subprocess import call
import sys
def main():
""" for FFXIV skip intro cutscene to allow game to work.
"""
util.protontricks('hidewineexports=enable')
# disable new character intro cutscene to prevent black screen loop
configpath = os.path.join(util.protonprefix(), 'drive_c/users/steamuser/Documents/My Games/FINAL FANTASY XIV - A Realm Reborn')
if not os.path.exists(configpath):
os.makedirs(configpath)
configgame = os.path.join(configpath, 'FFXIV.cfg')
if not os.path.isfile(configgame):
f = open(configgame,"w+")
f.write("<FINAL FANTASY XIV Config File>\n\n<Cutscene Settings>\nCutsceneMovieOpening 1")
f.close
configpath = os.path.join(util.protonprefix(), 'drive_c/users/steamuser/Documents/My Games/FINAL FANTASY XIV - A Realm Reborn')
if not os.path.exists(configpath):
os.makedirs(configpath)
configgame = os.path.join(configpath, 'FFXIV_BOOT.cfg')
if not os.path.isfile(configgame):
f = open(configgame,"w+")
f.write("<FINAL FANTASY XIV Boot Config File>\n\n<Version>\nBrowser 1\nStartupCompleted 1")
f.close
# Fixes the startup process.
if 'NOSTEAM' in os.environ:
util.replace_command('-issteam', '')
if 'XL_WINEONLINUX' in os.environ:
try:
util.install_dotnet('dotnet48')
except AttributeError:
util.protontricks_proton_5('dotnet48')
util.protontricks('vcrun2019')
util.replace_command('-issteam', '')
launcherpath = os.path.join(util.protonprefix(), 'drive_c/users/steamuser/AppData/Local/XIVLauncher/XIVLauncher.exe')
if not os.path.exists(launcherpath):
call(
[
"curl",
"https://kamori.goats.dev/Proxy/Update/Release/Setup.exe",
"-L",
"-o",
os.path.join(
util.get_game_install_path(),
"boot/Setup.exe"
)
]
)
util.replace_command('ffxivboot.exe', 'Setup.exe')
else:
original_launcher = os.path.join(
util.get_game_install_path(),
"boot/ffxivboot.exe"
)
util.replace_command(original_launcher, launcherpath)

Final Fantasy XIV on Steam after the Steam Account Linking incident

In order to get FFXIV to work you need to link your account first. Sadly this is (so far) the only step we can't do from linux. For everything else follow along.

Dependencies

Make sure you have curl installed. Also install Proton 5.0 from the tool section of Steam in the same gamelibrary as your Final Fantasy XIV.

Your old prefix

If you played the game earlier via steam or if you have tinkered with it in any way I recommend that you put it somewhere else. Your prefix (from steam) is usually located at

$HOME/.steam/steam/steamapps/compatdata/39210

Get GE Proton

I tested this setup with Proton-6.21-GE-2. You can get that here. TLDR:

cd $HOME/.steam/steam/compatibilitytools.d
curl -L https://github.com/GloriousEggroll/proton-ge-custom/releases/download/6.21-GE-2/Proton-6.21-GE-2.tar.gz | tar xz

Update winetricks of that Proton installation

cd $HOME/.steam/steam/compatibilitytools.d/Proton-6.21-GE-2/protonfixes
./winetricks --self-update

Patch the Proton version

This gist has another file. Replace the file located at $HOME/.steam/steam/compatibilitytools.d/Proton-6.21-GE-2/protonfixes/gamefixes/39210.py with it.

Creating a new prefix

  • Right click on ffxiv in your library
  • click on Preferences
  • Click on compatibility
  • Set the checkmark for "Force the use of a specific Steam Play compatibility tool"
  • Select "Proton 6.3-8"
  • Start the game
  • Close the defunct launcher/game

Edit the launch arguments on steam

  • Right click on ffxiv in your library
  • click on Preferences
  • Click on compatibility
  • Select "Proton-6.21-GE-2"
  • put the following string into the launch arguments XL_NO_SPACE_REQUIREMENTS=true XL_WINEONLINUX=true DSSENH=n %command%

Launch the game

The first launch will take forever and there will be one pop up that something is not working. Click on no and soon after XIVLauncher Setup should start.

Play the game

Troubleshooting

  • I was not able to test this setup on every possible combination of things. My latest changes to this guide was after doing it on a clean Ubuntu 20.04 LTS installation with steam installed via the Ubuntu Software Center and I selected to install 3rd party drivers in the Ubuntu installation. (Not that I recommend Ubuntu personally... I was just testing something that is different to my personal setup).
  • You might also want to have a look at this page: https://github.com/GloriousEggroll/proton-ge-custom/tree/6.21-GE-2#installation .
  • In order to get some logs it helps starting steam in a terminal. It is also helpful to execute the following command which will result in a log file being written in $HOME/steam-39210.log.
cp $HOME/.steam/steam/compatibilitytools.d/Proton-6.21-GE-2/user_settings.sample.py $HOME/.steam/steam/compatibilitytools.d/Proton-6.21-GE-2/user_settings.py
  • Starting over and trying again is "as simple as" deleting your prefix and starting the guide from "Creating a new Prefix"

"I get a write free space error when trying to get XIVLauncher to download FFXIV"

  • Please add XL_NO_SPACE_REQUIREMENTS=true to your launcher arguments in Steam to disable XIVLauncher's disk space checks.
    **NOTE:**You will be responsible for ensuring you have enough space on your own.
@aizakow
Copy link

aizakow commented Apr 16, 2022

Good thought, unfortunately navigating to the SD card via the Linux path behaves exactly the same, with or without that launch argument

@aizakow
Copy link

aizakow commented Apr 16, 2022

I'm a bit of a Linux idiot but I think whatever fix would have to be implemented in the python script itself so that the SD card is established as a valid path at setup time

@TiffanyNeat
Copy link

TiffanyNeat commented Apr 16, 2022

Yeah, I would totes need this myself haha as my base Steam Deck is 64GB, and with Endwalker present it now just barely exceeds 64GB on it's own within the prefix. A way to reliably install it (/work in general) on an SD Card would be great. I have my configs for controller ready and everything lol

@Centzilius
Copy link
Author

Have you checked the XIVLauncher settings for the patch download path and the game path that they are pointing to your micro sd?

@aizakow
Copy link

aizakow commented Apr 16, 2022

Yeah, that's what is a bit odd. In the initial setup I navigate to my sd card directory where the game is installed, and it lets me proceed. If I go into the settings, it shows my SD card directory. However, when I click run integrity check, it claims the game is not installed there, even though it can see the boot and data folders. Again, it lets me proceed even though it claims the directory doesn't have the game there. Then, if I start the patch process, it just ignores all of this and starts installing to the prefix c drive anyway

@aizakow
Copy link

aizakow commented Apr 19, 2022

I figured out how to get this running on Steam Deck off an SD card. It adds a couple extra steps, but it's not too bad from a setup perspective, other than one big caveat, which I'll get into below.

I wrote a guide, will post here:

Complete this process, making sure that you initially install FFXIV to the SD card, up through the part where you get the error message and click “No” to close the window. We’re going to add a couple steps before you start the custom launcher for the first time. You need to be in desktop mode for this.

The issue we’re fixing is that for whatever reason, XIVLauncher will ignore any attempts to make it use the SD card for the game directory, and install to the prefix C: drive that SteamOS creates for it. What we’re going to do is create symlinks (basically, tunnels that redirect from one directory to another) from the install directories to the SD card as a workaround.

Link the game folders

  1. Navigate to the pfx for FFXIV. Same as above, /home/.steam/steam/steamapps/compatdata/pfx/39210/
    a. Once you’re there, you are in a recognizable windows C drive. Navigate to C:\Program Files (x86)
    b. Create a new folder, called “SquareEnix.” Navigate into that folder
  2. Open a new Dolphin window. Navigate to your SD card, and find the steamapps/common/ folder. If you have installed the game, there should be a folder called “Final Fantasy XIV Online”
  3. Drag the FFXIV Online folder to the SquareEnix folder you created. A small menu should appear, with options to move, copy, or create a link. Click the third option, create link.

Link the installer cache folders

  1. In the SquareEnix folder, go up one level to Program Files (x86).
  2. In your SD card, navigate up to your root directory. Create a new folder, and call it “cache”
  3. Drag the cache folder from your SD card to the Program Files (x86) folder, and create a link again

Set up XIVLauncher

  1. Launch FFXIV via steam. Thanks to this script, XIVLauncher will start.
  2. In the initial setup wizard, you will be asked for the game directory. By default, it should be C:\Program Files (x86)\SquareEnix\Final Fantasy XIV – A Realm Reborn. Delete the last bit, changing a “ - Realm Reborn” to “Online”. When you’re done the path should be C:\Program Files (x86)\SquareEnix\Final Fantasy XIV Online.
  3. Check the box for a Steam account
  4. Click next through the rest of setup.
  5. Do not login. Instead, click the Gear icon. In the settings screen, find the tab labeled “patches”
  6. On that screen, there will be a text field to specify a special folder where XIVLauncher will download temporary patch files. Input C:\Program Files (x86)\cache
  7. Optionally, uncheck the box for asking you before downloading updates. This way it will just download updates if there are any rather than giving you a pointless dialog box to confirm.

That’s it! Now you can login and the download will begin. Here’s the big catch: this process is extremely slow. We’re talking on the order of 8 hours, even on my gigabit fiber. XIVLauncher works by downloading multiple patch files in parallel to one another and applying the patches while others are still downloading, which is faster than the official launcher under normal circumstances, but which seems to absolutely murder SD cards. It also will look like it’s frozen for stretches at a time, because the patcher is bottlenecked by the SD card moving files in the background, so downloads have to wait. If you have the game already installed and updated on another machine, I would strongly recommend finding a way to copy those files over rather than do this process. Just copy the files to the FFXIV directory on your SD card as you would any other game, and the next time you start the game XIVLauncher should see that you’re up to date and just go.

If you have a 256gb or 512gb model but want to run the game off the SD card anyway, I suspect that foregoing the second step of creating a cache folder and linking it would yield faster results. The process would temporarily use up space equivalent to the size of FFXIV, but it would be freed up after it was done.

@TiffanyNeat
Copy link

TiffanyNeat commented Apr 19, 2022

You are a god. Thank you sfm.
So, if i were to have FFXIV installed on my Arch (btw) Linux computer, using this whole script and stuff, can I just copy over the installed folder inside SquareEnix to the SD card and it'll detect it as the real deal, even if it's not entirely up to date? as long as I rename it from A Realm Reborn to just Online? Like, will it install the latest patches to it like it's some new stuff it just installed itself after having detected it in the folder it'd normally be in this way?

EDIT: Also, do i have to add the NoSpaceRequirements=true thing to my launch arguments?

@TiffanyNeat
Copy link

I tried it with the prefix backup I had on me already, and on my Linux pc it works transferring the folder over. So, I need to just create the links onto the Steam Deck? Very cool. Be looking forward to this on my Deck.

@bonesmoses
Copy link

This doesn't appear to work anymore. Either something in Steam updated, or there is some other issue, but now it doesn't look like Steam is even using the protonfixes/gamefixes/39210.py script anymore. Like, you can fill it with complete gibberish, and it will always launch the normal game launcher now.

@Centzilius
Copy link
Author

@bonesmoses Have you selected the correct compatibilitytool for ffxiv?

@bonesmoses
Copy link

Yes. In fact, I never changed it. It's still using, and has always used Proton-6.21-GE-2. Just to make sure, I blew up the existing prefix and started from scratch by using 6.3.8, letting it build a new prefix, switching to 6.21-GE-2 and adding the new launch command, and now it won't even install FFXIVLauncher at all anymore, it just goes straight to the "new" broken launcher.

I figured it was related to either patch 6.1 or some Steam update, since it worked last week and I didn't change anything.

@bonesmoses
Copy link

Alright, I can't explain this since I made sure everything running under 'steam' or 'Steam' via ps auwx was killed, but rebooting magically fixed this. I retract, but if someone else notices this issue, rebooting may fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment