Skip to content

Instantly share code, notes, and snippets.

@derrod
Last active April 18, 2024 06:31
Show Gist options
  • Save derrod/333fb5218002347435b7f31d532cbd01 to your computer and use it in GitHub Desktop.
Save derrod/333fb5218002347435b7f31d532cbd01 to your computer and use it in GitHub Desktop.
Star Wars Battlefront II on Linux via Legendary

Installing Star Wars: Battlefront II with Legendary

The game is not installed or downloaded via Epic, instead the Epic Games Launcher launches Origin to link your account to install the game. This can be done manually to still be able to install and download the game without the Epic Games Launcher.

Installing Origin

Origin needs to be installed and working for this, please consult https://github.com/lutris/docs/blob/master/Origin.md for how to get it running on Linux via Lutris.

On Windows Origin just needs to be installed and ideally updated to the current version.

Linking your account & installing the game

In order to link your account you need something called an "exchange code", this can be obtained via legendary by copying the parameters used to launch a game, which in turn can be easily obtained via --dry-run.

Tip: If you do not have any games installed obtain Spotify from the Epic Games Store website, it is only around 80 Megabytes in size and quickly downloaded.

Note: The code is only valid for a few minutes, so if you have issues try again with a fresh one. It can also help to have Origin already running.

When launching a game with the --dry-run option you will get a command line something like this:

wine Game.exe -AUTH_LOGIN=unused -AUTH_PASSWORD=000102030405060708090a0b0c0d0e0f -AUTH_TYPE=exchangecode -epicapp=AppName -epicenv=Prod -EpicPortal -epicusername=Name -epicuserid=0f0e0d0c0b0a09080706050403020100 -epiclocale=en

To link the account, copy the AUTH_PASSWORD, epicusername and epicuserid into the following command, then run it from within a cmd (in your Origin WINE prefix):

start "" "link2ea://launchgame/MtMassive?AUTH_PASSWORD=<AUTH_PASSWORD>&AUTH_TYPE=exchangecode&epicusername=<epicusername>&epicuserid=<epicuserid>&epiclocale=en&theme=sws&platform=epic&Hotfix=go"

Based on the example above the final command should look something like this (with your credentials instead, obviously):

start "" "link2ea://launchgame/MtMassive?AUTH_PASSWORD=000102030405060708090a0b0c0d0e0f&AUTH_TYPE=exchangecode&epicusername=Name&epicuserid=0f0e0d0c0b0a09080706050403020100&epiclocale=en&theme=sws&platform=epic&Hotfix=go"

This should open a Window from Origin asking you to link your Origin and Epic accounts, afterwards the game should start installing via Origin (if the game is not installable, try restarting Origin).

Note: You may get a prompt asking you to register a product code, simply dismiss this as the game will already be registered to your account at that point and will be downloadable from your Origin library.

Launching the game

Attempting to launch the game via Origin directly will attempt to launch the Epic Launcher, instead you will have to use a similar command to the one above to run the game:

start "" "link2ea://launchgame/MtMassive?AUTH_PASSWORD=0&AUTH_TYPE=exchangecode&epicusername=&epicuserid=&epiclocale=en&theme=sws&platform=epic&Hotfix=go"

Note that only the password parameter here cannot be empty, but it does not need to be valid. Origin will launch the game afterwards.

@bndlfm
Copy link

bndlfm commented Jan 21, 2021

@bndlfm Set nvapi64 to disabled in the libraries tab of winecfg or by exporting WINEDLLOVERRIDES="nvapi64=d".

I can get the game to run on wine-tkg (Tk's official build from the github releases page) on Arch and multiplayer works fine, but if somebody sends me a party invite it just freezes origin (the game continues to work, though). I can invite my Windows friends and get them into a party with me that way but I haven't found a solution to party up with another Linux user, which is quite frustrating.

If anyone knows of a way to join a party without using Origin or a fix for that issue, I'd greatly appreciate it.

I haven't tried this yet because I just saw your message but I read somewhere that you need to set up a virtual desktop in wine and the use alt + enter to go into windowed mode and use that to accept invites. You might accept them through the origin client but I've read so much about this stuff in the past 4 days that it's hard to even say anymore. I def remember virtual desktop; alt + enter to go to windowed.

I've been having problems with origin hanging my xserver so I understand why you don't want to use it.

I'll let you know when I get a chance to test it myself if you don't see this before then.

@beau11627
Copy link

Alright I got the game installed and I can get it to run but the problem is the crash rate. Only about 5% of the time can I play the game and that's only for about 5 minutes at a time. Something keeps making it crash (I verified the game files already). Terminal outputs this before every crash.
warn: D3D11Texture2D::QueryInterface: Unknown interface query
warn: f8fb5c27-c6b3-4f75-a4c8-439af2ef564c
warn: D3D11Texture2D::QueryInterface: Unknown interface query
warn: f8fb5c27-c6b3-4f75-a4c8-439af2ef564c
warn: D3D11Texture2D::QueryInterface: Unknown interface query

any ideas what this could be or how to fix it?

@bndlfm
Copy link

bndlfm commented Jan 23, 2021

Alright I got the game installed and I can get it to run but the problem is the crash rate. Only about 5% of the time can I play the game and that's only for about 5 minutes at a time. Something keeps making it crash (I verified the game files already). Terminal outputs this before every crash.

how did you install it?

i got it running but there was a dxvk issue with characters and terrain being really dark/black so you couldn't see anything. for some reason origin wasn't connecting to the internet either. By coincidence I saw ea play on steam had a $0.99 trial and then it's pretty cheap for a whole year so I just subbed to that and it works perfect through steam play lol

If I stop my sub i plan on using the proton pfx to run my epic version

@FabioSedia
Copy link

i tried running the game, but i get the "AMD Driver version UNKNOWN: use at least driver version 18.xxxx at amd.com"
I'm using an AMD card, and other games with the same engine like bf1 works fine

@Kiwii
Copy link

Kiwii commented Jan 27, 2021

@FabioSedia Install DXVK to the wine prefix if you haven't and set nvapi and nvapi64 to disabled in winecfg. DXVK should fake an nvidia GPU for the game by default, but if it doesn't for some reason, make a dxvk.conf file in the game's install folder with the content:

dxgi.customDeviceId = 1C81
dxgi.customVendorId = 10DE

@gat02
Copy link

gat02 commented Jan 31, 2021

Does anyone get this error?

"The title is installed in a language that you are not entitled to play, please reinstall the title or sign in with an entitled user."

@TabulateJarl8
Copy link

TabulateJarl8 commented Mar 12, 2021

Does anyone get this error?

"The title is installed in a language that you are not entitled to play, please reinstall the title or sign in with an entitled user."

I got this, not entirely sure how to go about fixing it. Once I hit "Ok", it opens a window titled "Frostbite" which then quickly changes to "Star Wars Battlefront II" and then the window closes. This is my wine output after printing fixme:d3d_shader:shader_glsl_dump_program_source followed by code thousands of times: https://pastebin.com/AxpAEpkr

@ibrokemypie
Copy link

When launching for me origin launches, then the game freezes on a black screen (Title is Star Wars Battlefront II) before crashing a minute or so after with no error I can find. Running the game exe directly works, though launches epic games store and origin which is what I am aiming to avoid

@LeonMusCoden
Copy link

This works surprisingly well. However, I would highly recommend to install DXVK manually after installing Origin.
Simply download the script from the release page and run it in the origin preset: WINEPREFIX=path/to/prefix ./setup_dxvk.sh

@italoghost
Copy link

Does anyone know how is possible to automate the command

start "" "link2ea://launchgame/MtMassive?AUTH_PASSWORD=0&AUTH_TYPE=exchangecode&epicusername=&epicuserid=&epiclocale=en&theme=sws&platform=epic&Hotfix=go"

on Lutris?

I am trying to make Origin as the executable and adding this command to the arguments. Although it starts as an application launched through another launcher, I can't open the game: pressing the play button does nothing.

I can launch the game by running the command on wine cmd, but I loose all the Lutris configurations.

Can someone help me?

@Hadrianneue
Copy link

if anyone is having trouble try the following: (prefix must have origin installed on it)

WINEDLLOVERRIDES="nvapi, nvapi64=d" WINEPREFIX="/mnt/gamedisk/EGS/Origin/" wine64 "/mnt/gamedisk/EGS/Origin/drive_c/Program Files (x86)/Origin/EALink.exe" "link2ea://launchgame/MtMassive?AUTH_PASSWORD=0&AUTH_TYPE=exchangecode&epicusername=myusername&epicuserid=myepicuserid&epiclocale=en&theme=sws&platform=epic&Hotfix=go"

The env WINEDLLOVERRIDES="nvapi, nvapi64=d" is useful If game fails to launch with message "outdated nvidia drivers...".

also i've omitted but i'm using wine-ge.

@italoghost maybe useful to you :)

@italoghost
Copy link

if anyone is having trouble try the following: (prefix must have origin installed on it)

WINEDLLOVERRIDES="nvapi, nvapi64=d" WINEPREFIX="/mnt/gamedisk/EGS/Origin/" wine64 "/mnt/gamedisk/EGS/Origin/drive_c/Program Files (x86)/Origin/EALink.exe" "link2ea://launchgame/MtMassive?AUTH_PASSWORD=0&AUTH_TYPE=exchangecode&epicusername=myusername&epicuserid=myepicuserid&epiclocale=en&theme=sws&platform=epic&Hotfix=go"

The env WINEDLLOVERRIDES="nvapi, nvapi64=d" is useful If game fails to launch with message "outdated nvidia drivers...".

also i've omitted but i'm using wine-ge.

@italoghost maybe useful to you :)

THANK YOU! I could never have imagined that I had to use the "EALink.exe" instead of the "Origin.exe". Using it opened the game just fine!

I will create an tutorial for those who are trying to launch the game on Lutris.

@neexistuji
Copy link

For some reason I have a problem launching the game (installation is successful). At the end of the instructions it is stated that AUTH=PASSWORD does not have to be valid, the main thing is that it is not empty (as far as I understand). But in my case, the game simply does not start - an empty EA authorization window appears. The only way to run the game is to enter the current AUTH=PASSWORD, which I get with the spotify command launch --dry-run, but the problem is that it is updated every time after starting the game... So, every time before starting the game I need to get an up-to-date authentication password?

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