Battlefield 2 on Linux: Notes & Tips: Difference between revisions

From Retro Media HUB
mNo edit summary
mNo edit summary
Line 55: Line 55:
You can easily install different versions with '''ProtonUp-Qt''', for Steam OS users, there is a flatpak version.
You can easily install different versions with '''ProtonUp-Qt''', for Steam OS users, there is a flatpak version.


===Setup Lutris Environment===
We need to create a new Wine environment to install the game into it. The mistake is usually to install every game on the same Wine prefix, is like having one machine with Windows and you just keep install everything on that same machine, this might work but also might not because every game might need a different version of Wine/Proton so is always recommended to create a separate environment for every game or software that you want to run on it.


===Setup Lutris Environment ===


Top-left + icon, then Add locally installed game, not going to use any scripts, all manual.
We need to create a new Wine environment to install the game. A common mistake is installing every game in the same Wine prefix. This is like having one Windows machine and installing everything on it — it might work, but often it doesn’t, because each game may require a different version of Wine or Proton. It is always recommended to create a separate environment for every game or software you want to run.
[[File:Lutris-add-games-to-lutris-screen1.png|none|thumb|Manually configure a game since we need to install it the traditional way]]


In Game Info is important to specify '''Wine''' as the '''Runner''', filling remaining fields are not required except for the Name.
==== 1. Click the '''+''' icon ====
[[File:Lutris-add-new-game-info-screen1.png|border|none|thumb|Select the Runner as Wine]]In Game options Wine prefix need to point to the location where Wine will create the environment (or prefix) specific for the game, is really important that you select a different folder for every game or software you use.
in the top-left corner, then select '''Add locally installed game'''. We won’t use any scripts; everything will be configured manually.[[File:Lutris-add-games-to-lutris-screen1.png|none|thumb|Manually configure a game since we need to install it the traditional way]]


The '''Executable''' and '''Arguments''' are used after you installed the game and you have the game folder ready, then you can set the bf2.exe executable to run the game, for now you can leave it empty. '''Prefix architecture''' you can keep it to Auto for this game (a 64bit prefix will be created).
==== 2. In '''Game Info''' ====
[[File:Lutris-add-new-game-options-screen1.png|thumb|none]]
specify '''Wine''' as the Runner. Filling in the remaining fields is optional, except for the Name.[[File:Lutris-add-new-game-info-screen1.png|none|thumb|Select the Runner as Wine]]


==== 3. In '''Game Options''' ====
set the Wine prefix to the folder where Wine will create the environment for this game. It is important to select a different folder for each game or software.


In '''Runner options''' you choose the Wine version, if you already downloaded the correct Wine version you can select it here. Don't choose random versions here, is always best to understand and take notes of the version you are using, check Install Wine section for my recommendation.
The '''Executable''' and '''Arguments''' fields are used after installation, when the game folder is ready. At that point, you can set '''bf2.exe''' as the executable. For now, leave these fields empty.
[[File:Lutris-runner-options-screen1.png|none|thumb]]
One important graphics setting is the '''DXVK version''', which can significantly improve your experience with the game. I am currently using version '''2.6.2'''. Keep an eye on updates for this graphics wrapper, as newer releases often enhance performance and fix graphical issues.


Below in the Runner options you find DLL overrides, for this game you can leave it empty, this is because we don't have any dll in the game folder that need to replace the counterpart in the Windows library folder.
Keep the '''Prefix architecture''' set to '''Auto''' (a 64-bit prefix will be created).[[File:Lutris-add-new-game-options-screen1.png|thumb|none]]


In the System options I add a few environment variables to help logging and performance.
==== 4. In '''Runner Options''' ====
choose the Wine version. If you have already downloaded the correct Wine build, select it here. Avoid choosing random versions — always take notes on which version you are using. See the ''Install Wine'' section for recommendations.[[File:Lutris-runner-options-screen1.png|none|thumb]]One important graphics setting is the '''DXVK version''', which can significantly improve performance. I currently use version '''2.6.2'''. Keep an eye on updates, as newer releases often enhance performance and fix graphical issues.


'''DXVK_FRAME_RATE''': limit the frame rate.
Leave '''DLL overrides''' empty for this game, since there are no DLLs in the game folder that need to replace Windows library counterparts.


'''DXVK_HUD:''' hud to check sys specs and fps counter.
==== 5. In '''System Options''' ====
 
you can add environment variables to help with logging and performance:#<code>DXVK_FRAME_RATE</code> – limits the frame rate
'''ALSOFT_LOGFILE''' and '''ALSOFT_LOGLEVEL''' are for logging the OpenAL Soft library.
#<code>DXVK_HUD</code> – displays system specs and an FPS counter
[[File:Lutris-sys-options-envvar-screen1.png|none|thumb]]
#<code>ALSOFT_LOGFILE</code> and <code>ALSOFT_LOGLEVEL</code> – enable logging for the OpenAL Soft library
After you finish just click Save and you creating the game profile, now to create the actual prefix you need to trigger the Wine executable to do the job, in order to do so you can click on the arrow icon at the bottom of the application and then click '''Wine configuration'''. After a few seconds the Wine configuration will open, no need to do anything here, just close it. The wine prefix folder has been created and you can check all the files inside. Is like having a portable Windows OS where you are going to install the game on it.
After saving, you will have created the game profile. To generate the actual Wine prefix, trigger the Wine executable by clicking the arrow icon at the bottom of the application and selecting '''Wine configuration'''. After a few seconds, the Wine configuration window will open. You don’t need to change anything here, just close it. The Wine prefix folder will now be created, containing all necessary files. Think of it as a portable Windows installation where you can install the game.
 
===Install Battlefield 2 ===
===Install Battlefield 2===
My instructions here a limited to the vanilla experience, if you want to install mods, you should be able to do it following the same steps you did to install the game.
My instructions here a limited to the vanilla experience, if you want to install mods, you should be able to do it following the same steps you did to install the game.


Line 96: Line 94:




=== Restore EAX with OpenAL Soft ===
===Restore EAX with OpenAL Soft===


Everything needs to be perfect, including audio. The game supports EAX, and to enable the audio hardware capabilities we can use the '''OpenAL Soft''' library. The setup is straightforward and works well with many games, not only ''Battlefield 2''. The first step is to determine whether the game uses the '''dsound''' or '''openal''' audio library. In the game folder, you will find a library called '''BF2OpenAL.dll'''. From the name alone, you can tell that the game supports OpenAL, so we will use OpenAL Soft to replace it and enable EAX support.
Everything needs to be perfect, including audio. The game supports EAX, and to enable the audio hardware capabilities we can use the '''OpenAL Soft''' library. The setup is straightforward and works well with many games, not only ''Battlefield 2''. The first step is to determine whether the game uses the '''dsound''' or '''openal''' audio library. In the game folder, you will find a library called '''BF2OpenAL.dll'''. From the name alone, you can tell that the game supports OpenAL, so we will use OpenAL Soft to replace it and enable EAX support.
Line 102: Line 100:
Download OpenAL Soft from the [https://github.com/kcat/openal-soft/releases/tag/1.23.1 GitHub release page]. The version I currently use for this game is '''1.23.1''', which I recommend for this tutorial. After extracting the archive, you will need two files:
Download OpenAL Soft from the [https://github.com/kcat/openal-soft/releases/tag/1.23.1 GitHub release page]. The version I currently use for this game is '''1.23.1''', which I recommend for this tutorial. After extracting the archive, you will need two files:


* From the '''router/Win32''' folder, take '''OpenAL32.dll'''. Rename this file to '''BF2OpenAL.dll''' and replace the existing one in the game folder.
*From the '''router/Win32''' folder, take '''OpenAL32.dll'''. Rename this file to '''BF2OpenAL.dll''' and replace the existing one in the game folder.
* From the '''bin/Win32''' folder, copy '''soft_oal.dll''' into the game folder.
*From the '''bin/Win32''' folder, copy '''soft_oal.dll''' into the game folder.


Next, download the [https://github.com/main-exe/UT2004-OpenAL OpenAL configuration for UT2004] from GitHub. We will use part of its content. Specifically, you need the file '''OpenAL-44100Hz.zip''', which contains '''alsoft.ini''' and a folder with HRTF profiles for 3D spatial sound. Extract the archive and place both '''alsoft.ini''' and the '''OpenAL''' folder into the '''AppData/Roaming''' directory of your prefix.
Next, download the [https://github.com/main-exe/UT2004-OpenAL OpenAL configuration for UT2004] from GitHub. We will use part of its content. Specifically, you need the file '''OpenAL-44100Hz.zip''', which contains '''alsoft.ini''' and a folder with HRTF profiles for 3D spatial sound. Extract the archive and place both '''alsoft.ini''' and the '''OpenAL''' folder into the '''AppData/Roaming''' directory of your prefix.
Line 139: Line 137:
*'''Multiplayer problems:''' Verify PunkBuster setup.
*'''Multiplayer problems:''' Verify PunkBuster setup.


== Downloads ==
==Downloads==


* [https://github.com/kcat/openal-soft/releases/tag/1.23.1 OpenAL Soft v1.23.1]
*[https://github.com/kcat/openal-soft/releases/tag/1.23.1 OpenAL Soft v1.23.1]
* [https://github.com/main-exe/UT2004-OpenAL UT2004 OpenAL configuration (OpenAL-44100Hz.zip)]
*[https://github.com/main-exe/UT2004-OpenAL UT2004 OpenAL configuration (OpenAL-44100Hz.zip)]
* [https://github.com/main-exe/UT2004-OpenAL/releases/download/2023-11-08/RightMark3DSound.zip RightMark3DSound software]
*[https://github.com/main-exe/UT2004-OpenAL/releases/download/2023-11-08/RightMark3DSound.zip RightMark3DSound software]
* [https://github.com/Kron4ek/Wine-Builds/releases/tag/proton-9.0-1 Wine Proton 9.0-1 build]
*[https://github.com/Kron4ek/Wine-Builds/releases/tag/proton-9.0-1 Wine Proton 9.0-1 build]
* [https://github.com/main-exe/UT2004-OpenAL/releases/tag/2023-11-08 UT2004 OpenAL release (2023-11-08)]
*[https://github.com/main-exe/UT2004-OpenAL/releases/tag/2023-11-08 UT2004 OpenAL release (2023-11-08)]





Revision as of 00:43, 15 November 2025

20503242-battlefield-2-windows-front-cover.jpg
Game Information
Title Battlefield 2
Year 2005
Developer DICE
Graphics API
Audio API


Introduction

These are my notes and tips to run Battlefield 2 on Linux using Wine/Proton.

My personal choice to launch games on Linux is to use Lutris, this is a launcher where you can organize all your games, with different wine or proton version, graphic wrappers and so on, I highly recommend it because it doesn't automate most of the things instead it leaves you the choise of what libraries you want to use for a specific game or software.

General Tips
  • Lutris is highly recommended because it gives you flexibility in choosing libraries and configurations for each game.
  • Don’t expect everything to work out-of-the-box — some trial and error is normal.
  • Document your setup choices (Wine/Proton version, DXVK settings, etc.) so you can replicate or troubleshoot later.


I might takes some stuff for granted, because otherwise it would be impossible to complete a single page on this wiki. With time I might iterate over and add more helpfull documentation for specific tool and such.

Tools & Setup

To keep information organized I will start with listing the few tools and libraries that are required

  • Wine/Proton: Essential for running Windows-based games on Linux.
  • Lutris: A versatile game launcher that allows you to:
    • Organize all your games in one place.
    • Choose specific Wine or Proton versions per game.
    • Apply different graphics wrappers and libraries.
    • Maintain control over configurations rather than relying on automation.
  • DXVK: A graphics wrapper that translates DirectX calls to Vulkan, improving performance on Linux.
  • OpenAL Soft: An open-source implementation of the OpenAL 3D audio API.
    • Provides better audio compatibility for older games.
    • Often required to fix missing or distorted sound.

You need a copy of the game of course, the game is abandonware so you can find it easily on Internet

Installation Steps

WIP

Install Lutris

There are several ways to install Lutris. Visit the official download page and choose the package that best fits your system.

In my case, I use the Flatpak version on the Steam Deck. Always keep Lutris itself updated, but avoid blindly updating other libraries (such as DXVK) unless you encounter issues. Each game or software setup may require specific versions of these libraries, so it’s best to leave working configurations untouched.

If you experience problems, try newer versions of Wine/Proton or DXVK, but remember: stability is more important than always having the latest release.

To not clutter this tutorial I will move tips and extra setup for Lutris on a different page

Lutris: Notes & Tips

Install Wine

There are many variations of Wine (Proton is a specific version of Wine for Steam games), you can install multiple versions on your system so feel free to try the one that works for you.

The ones I use are built from Kron4ek and you find them on his GitHub page.

The one version I tested that works well for Battlefield 2 is the wine-proton-9.0-1-amd64.

You can easily install different versions with ProtonUp-Qt, for Steam OS users, there is a flatpak version.


Setup Lutris Environment

We need to create a new Wine environment to install the game. A common mistake is installing every game in the same Wine prefix. This is like having one Windows machine and installing everything on it — it might work, but often it doesn’t, because each game may require a different version of Wine or Proton. It is always recommended to create a separate environment for every game or software you want to run.

1. Click the + icon

in the top-left corner, then select Add locally installed game. We won’t use any scripts; everything will be configured manually.

Manually configure a game since we need to install it the traditional way

2. In Game Info

specify Wine as the Runner. Filling in the remaining fields is optional, except for the Name.

Select the Runner as Wine

3. In Game Options

set the Wine prefix to the folder where Wine will create the environment for this game. It is important to select a different folder for each game or software.

The Executable and Arguments fields are used after installation, when the game folder is ready. At that point, you can set bf2.exe as the executable. For now, leave these fields empty.

Keep the Prefix architecture set to Auto (a 64-bit prefix will be created).

Lutris-add-new-game-options-screen1.png

4. In Runner Options

choose the Wine version. If you have already downloaded the correct Wine build, select it here. Avoid choosing random versions — always take notes on which version you are using. See the Install Wine section for recommendations.

Lutris-runner-options-screen1.png

One important graphics setting is the DXVK version, which can significantly improve performance. I currently use version 2.6.2. Keep an eye on updates, as newer releases often enhance performance and fix graphical issues.

Leave DLL overrides empty for this game, since there are no DLLs in the game folder that need to replace Windows library counterparts.

5. In System Options

you can add environment variables to help with logging and performance:#DXVK_FRAME_RATE – limits the frame rate

  1. DXVK_HUD – displays system specs and an FPS counter
  2. ALSOFT_LOGFILE and ALSOFT_LOGLEVEL – enable logging for the OpenAL Soft library

After saving, you will have created the game profile. To generate the actual Wine prefix, trigger the Wine executable by clicking the arrow icon at the bottom of the application and selecting Wine configuration. After a few seconds, the Wine configuration window will open. You don’t need to change anything here, just close it. The Wine prefix folder will now be created, containing all necessary files. Think of it as a portable Windows installation where you can install the game.

Install Battlefield 2

My instructions here a limited to the vanilla experience, if you want to install mods, you should be able to do it following the same steps you did to install the game.

Find a copy of the game, the Complete Collection with all the expansions is the recommended version to use.

After mounting the disk of the game (search mount on Internet), you can run the setup by clicking Run EXE inside Wine prefix.

Lutris-run-exe-inside-win-screen1.png

The setup should complete with no issues, next step is to update the game with the few patches released. You need two patches, BF2_Patch_1.41.exe and BF2_Patch_1.50.exe. Install them following the same process you did with the game setup.

If you don't have your own copy of the game you can use random CD keys to install the game and expansion, by using a neat application BF2KeyMan.exe you can generate keys for the game and apply them to the Windows registry with a few clicks.

Bf2keyman1.png


Restore EAX with OpenAL Soft

Everything needs to be perfect, including audio. The game supports EAX, and to enable the audio hardware capabilities we can use the OpenAL Soft library. The setup is straightforward and works well with many games, not only Battlefield 2. The first step is to determine whether the game uses the dsound or openal audio library. In the game folder, you will find a library called BF2OpenAL.dll. From the name alone, you can tell that the game supports OpenAL, so we will use OpenAL Soft to replace it and enable EAX support.

Download OpenAL Soft from the GitHub release page. The version I currently use for this game is 1.23.1, which I recommend for this tutorial. After extracting the archive, you will need two files:

  • From the router/Win32 folder, take OpenAL32.dll. Rename this file to BF2OpenAL.dll and replace the existing one in the game folder.
  • From the bin/Win32 folder, copy soft_oal.dll into the game folder.

Next, download the OpenAL configuration for UT2004 from GitHub. We will use part of its content. Specifically, you need the file OpenAL-44100Hz.zip, which contains alsoft.ini and a folder with HRTF profiles for 3D spatial sound. Extract the archive and place both alsoft.ini and the OpenAL folder into the AppData/Roaming directory of your prefix.

The default configuration should work fine, but if you want to change the profile, you can edit the alsoft.ini file and modify the default-hrtf property. You can experiment with different profiles and see which works best for you by using the RightMark3DSound software. After placing the profiles in the Roaming folder, simply edit alsoft.ini and run the software to test how the audio sounds in your setup.

Setup Punkbuster

You need Punkbuster the anti-cheat software used back in the days to play on specific servers, you need to have the same version used on the server. You can follow the instructions on the website I link below, this is an archived version on archive.org so hopefully will not disappear.

Instructions to update Punkbuster for Battlefield 2 but also valid for other games of the series

Tips

How to enable VSYNC

Created a file dxvk.conf in the game folder with the following content:

d3d9.presentInterval = 1

How to limit FPS

To limit FPS, set the environment variable:

DXVK_FRAME_RATE=60

(Replace `60` with your preferred frame rate.)

Game start arguments

I use the following arguments to start the game:

+fullscreen 1 +szx 1024 +szy 768 +menu 1 +modPath mods/AIX2

with modPath you tell the game to start a specific mod or just the vanilla game, the value is the exact folder name inside the mods folder.

Troubleshooting

  • Game won’t launch: Try switching Proton versions.
  • Graphics issues: Check DXVK logs.
  • Multiplayer problems: Verify PunkBuster setup.

Downloads


Notes

This page is a work in progress. More detailed documentation will be added over time.