Eternal Fighter Zero/Linux Support

From Mizuumi Wiki
Jump to navigation Jump to search
EFZ FeedbackImage.png Give feedback EFZ FeedbackImage.png

Although EFZ (and Revival) only supports Windows officially, it's possible to use Wine to play it on other operating systems, including full netplay support. The setup process for full compatibility is fairly complicated, so this page is here to provide a guide.

Some important notes before you start:

  • Any recent version (4.0+) of Wine should work for basic play, so you can skip #Wine versions for now to get started, and revisit it later if needed.
  • This guide is mostly adaptable to Mac as well, the only Linux-specific parts are #Building Wine and some of the tweaks in #Troubleshooting. This guide used to be adaptable to Mac, but after the drop of 32-bit application support in MacOS, it may no longer be possible.
  • This guide hasn't been updated for Ubuntu 20.04 yet. The LXC method for compiling Wine no longer works there, but it should actually be easier now since the dependencies can be installed directly. Detailed instructions coming in the future.


Introduction

This guide assumes you are comfortable with using a terminal, have a basic understanding of environment variables and are already somewhat familiar with using and configuring Wine for your needs, including setting up custom wineprefixes to avoid causing issues for your other games. You'll need to be able to compile Wine yourself, though this guide has step-by-step instructions for 64-bit Ubuntu 18.04. If you use a different distribution, the steps are slightly different but should be adaptable.

In this tutorial, EFZ and the manually compiled Wine will be installed under under the directory

/home/<username>/EFZ

You may of course install it wherever you wish, but make sure to change the paths used accordingly.

Wine versions

New versions of Wine bring many improvements, but occasionally they come with regressions as well. One regression that causes netplay desynchronization with EFZ Revival was introduced in Wine 1.7.55, and is still present in newer versions (4.2 is the newest version at the time of writing this). It's therefore recommended to stick with a known working version for EFZ, rather than using the one supplied by your distribution. The best options are:

  • Wine 4.0 with a custom patch
  • Wine 1.7.54 (not recommended due to text rendering issues)

This guide will help you set up Wine 4.0, which requires you to compile it yourself. If you'd rather use an older version to avoid compiling, you can use eg. PlayOnLinux to download and install it.

  • Note that if you're only intending to play locally, any recent version should work and this step can be skipped, or done later if you wish to start playing online.

Building Wine

There is a detailed guide to compiling Wine on Ubuntu on the WineHQ wiki. However, since you won't need this build for anything besides EFZ and we don't need 64-bit support for that, things are a bit simpler. We also don't want to install it system-wide as is described there, because our patch could cause issues for other games.

First of all, you need to install Wine's runtime dependencies. This is most easily done by installing Wine from your distribution's repository if you haven't already done so.

sudo apt install wine-stable

Setting up LXC

Compiling 32-bit Wine on 64-bit Ubuntu is complicated. We'll use LXC to create a 32-bit container to build it in. If you're actually using a 32-bit Ubuntu installation, you can skip LXC and compile it natively.

First you need to install LXC and the relevant templates.

sudo apt install lxc lxctl lxc-templates

Next, set up the LXC container and bind your home directory so you can access the existing files.

sudo lxc-create -t ubuntu -n winebuildbox -- --bindhome $LOGNAME -a i386
sudo cp -R /etc/apt /var/lib/lxc/winebuildbox/rootfs/etc
sudo lxc-start -n winebuildbox
sudo lxc-attach -n winebuildbox

You should now have a root terminal in the new container. Make sure the hostname is winebuildbox (the prompt says eg. root@winebuildbox:~# )

Wine build dependencies

Next, edit the apt lists to include source repositories using nano for example. Since the container is very minimal, you'll need to install nano first.

apt update
apt install nano
nano /etc/apt/sources.list

Below the lines starting with deb, uncomment the corresponding lines with deb-src (remove the preceding #). You can ignore pairs where both deb and deb-src are commented out.

Now you can install the Wine build dependencies. Remember to run apt update again after editing the lists.

apt update
apt build-dep wine

Finally, we want to perform the compilation with our usual user account, not root.

su <username>

Keep this terminal open for later.

Compiling Wine

Download the Wine 4.0 sources and extract them to ~/EFZ/winebuild/ or where you think is most convenient. Now navigate to the source directory and open up the file dlls/dinput/dinput_main.c, then find the function check_dinput_events(void) and within it, delete the line starting with MsgWaitForMultipleObjectsEx, which should leave the function empty besides the big comment block. Save the file. Now use the LXC container terminal to navigate into the source directory, and type in the following as your normal user, not root:

./configure --prefix="$HOME/EFZ/wine"
make && make install

Make sure you include the --prefix parameter to have Wine installed into our EFZ directory. The compilation will take a long time.

You should now have a full installation of Wine in ~/EFZ/wine.

Cleanup

Shut down the LXC container. In the container terminal window, type in as root:

systemctl poweroff

If you don't plan to recompile Wine in the future, you can also destroy the whole container.

sudo lxc-destroy winebuildbox

Feel free to also delete the Wine sources in ~/EFZ/winebuild now, if you wish.

Setting up EFZ

Installation

First of all, you need to create the wineprefix. Open a terminal in our EFZ directory, and type in

export WINEPREFIX="$HOME/EFZ/prefix"
wine/bin/wineboot

Wine might complain about missing Mono and Gecko packages, these are safe to ignore. Now, copy an existing EFZ installation over to the new wineprefix, for example into ~/EFZ/prefix/drive_c/EFZ, and extract EFZ Revival on top of it like you would on Windows.

Wineprefix configuration

Open up winecfg with

wine/bin/winecfg

and choose Add application, then find and select efz.exe. Now highlight efz.exe in the Applications tab, move over to Libraries and add in the libraries ddraw and d3dx9_43 (ddraw is not in the dropdown list but you can type it in, Wine will warn you about it but it's ok to ignore the warning). EFZ Revival supplies the custom ddraw.dll, but you need to acquire d3dx9_43.dll manually from Microsoft (DirectX End-User Runtimes June 2010). Use cabextract (install with Apt if needed) to extract this .exe rather than running it, and then again on the resulting Jun2010_d3dx9_43_x86.cab to get to the required DLL. Place it in the game's installation folder.

  • Note: Newest versions of Wine (4.12.1 tested) can now handle the text rendering without native d3dx9_43.dll. It's also possible to use D9VK instead of Wine's DirectX9 implementation if you have a Vulkan-capable graphics card, however, it's not stable and has some other issues, so it's not recommended at this time. Additionally, if you are using a beta version of Revival with extended features, these will not work without native d3dx9_43.dll.

EFZ configuration

By now you should have a fully working EFZ installation. Edit your EfzRevival.ini, set up your buttons with config.exe like you would on Windows and try it out. You can use

wine/bin/wine explorer

to make opening different executables a bit simpler.

  • Important: EfzRevival.ini is an UTF-16 little-endian encoded text file. Some of the simplest text editors might not be able to open it, while some others might silently save it as UTF-8 and make it unreadable for Revival. Make sure you save it with the correct encoding, and if you have issues use a text editor such as Kate, Geany, Notepadqq or Vim. Wine's notepad.exe should also work.

Troubleshooting

If you've followed the guide so far, the game should be playable but there might be some issues.

EFZ crashes on startup with a DirectDraw error

Most likely a driver issue. This is known to happen on some very old Nvidia cards, using the free Nouveau driver, as well as some virtual graphics controllers of VirtualBox and such. You could force software rendering with the environment variable LIBGL_ALWAYS_SOFTWARE=1 to see if it starts up, though this is likely to be too slow to play. If it does work, consider using Nvidia's official drivers if possible, or getting a new graphics card. Note that Revival wraps the original DirectX 7 calls to DirectX 9, so hardware that can run vanilla EFZ might not be able to run it with Revival. Your GPU should be able to support at least OpenGL 2.1 to avoid issues (if in doubt, use glxinfo from the mesa-utils package in Ubuntu to find out what is supported: glxinfo | grep "OpenGL version string")

EFZ crashes on round start, menus work fine

May be caused by driver incompatibilities (using OpenGL core profile with a version that doesn't play well with d3dx9_43, which is used by revival to render text). As a workaround you need to edit the registry of your wineprefix; with regedit, add a DWORD "MaxVersionGL" = 0x00030000 in HKEY_CURRENT_USER\Software\Wine\Direct3D (create the Direct3D key first if needed)

EFZ doesn't respond to keyboard in fullscreen mode

This issue seems to happen sometimes with Gnome (or Gnome-based desktops). The simplest solution is to just avoid using fullscreen and instead setting a sufficiently large window size in EfzRevival.ini. You can also fix it by disabling Allow the window manager to control the windows in winecfg, under the Graphics tab, but this will make the window of EfzRevival.exe unresponsive if started in Wine's command prompt (for example, when opened from Wine's explorer or launched with wine start efzrevival.exe).

"Sticky" keyboard inputs

This is especially apparent when pressing esc, for example when pressing it in character select screen quits the game. Caused by Fcitx, or maybe some other input method framework. As a workaround, you should

unset XMODIFIERS

before launching the game (add this in your launch script if you're using one).

Constant 100% CPU use

Disable CSMT for your wineprefix using Wine's regedit, in HKEY_CURRENT_USER\Software\Wine\Direct3D (create the Direct3D key first if needed) add DWORD csmt = 0x0

Visual stuttering

EFZ runs at 64FPS, which can cause issues if you're using desktop compositing or otherwise forcing vsync. It's highly recommended to disable all compositing effects if possible, and additionally make sure vsync is off. You can use the environment variable vblank_mode=0 with Mesa-based drivers for that.

Stuttering when a lot of text is rendered (especially training mode)

The text rendering done by Revival is surprisingly taxing on your system. On a very old PC this might mean that it's simply not powerful enough, even though the game runs fine otherwise. If you have a new CPU however (especially modern Intel CPUs), this could be caused by an aggressive power saving policy. You can check this with the cpupower tool (on Ubuntu, install packages linux-tools-common and linux-tools-generic), using the command

cpupower frequency-info

Check the output for current policy, if it says the current governor is powersave, especially with the intel_pstate driver, you should change this. The list of available governors should be shown above this section (usually at least performance and powersave are available). You will need root privileges to change this, so use

sudo cpupower frequency-set -g performance

to change the performance policy.

  • Note: This change does not persist between reboots.
  • Note2: There are a lot of tools for managing the performance policy, including GUI applications and extensions for Gnome, KDE Plasma etc. You can also use GameMode to apply tweaks only when playing EFZ (or other games) and return to powersave mode when you're finished, which could be helpful especially on a laptop when you wish to save battery.

Text is garbled in config.exe and pal_edit.exe

Just like in Windows, you need to run these executables with Japanese locale to avoid garbled text. Look up how to install Japanese language support for your distribution, then use the environment variable LANG=ja_JP.UTF-8 when launching these.

Ugly / inconsistent fonts with Revival

If the training mode text doesn't align properly, or the player names look off in netplay, you need to add a font replacement to the registry (and install a fitting font if you don't have any). EFZ Revival is made to use MS Gothic, so a similar font is preferred, such as IPA Gothic. In Ubuntu, this font is found in the fonts-ipafont package. After installing the font, using Wine regedit, add "MS Gothic"="IPAGothic" and "MSゴシック"="IPAGothic" in HKEY_CURRENT_USER\Software\Wine\Fonts\Replacements.

  • Note: if you have MS Gothic installed and want to use it, you can add "MSゴシック"="MS Gothic" instead.


Example scripts

You might end up with a lot of different environment variables you need to use, so making a launcher script for EFZ might be wise. Here's an example efzrev.sh to be placed in our base EFZ directory:

#!/bin/sh
export WINEPREFIX="$(pwd)/prefix"
export WINEDEBUG="-all"
export vblank_mode="0"
unset XMODIFIERS
cd prefix/drive_c/EFZ
../../../wine/bin/wine start "EfzRevival.exe"
  • Using $(pwd) for the prefix makes it possible to move your whole EFZ setup around, prefix and Wine and all, without any issues.

To make config.exe display text correctly, you need to use Japanese locale. Here's an example script (you can also adapt it for pal_edit):

#!/bin/sh
export WINEPREFIX="$(pwd)/prefix"
export WINEDEBUG="-all"
export LANG="ja_JP.UTF-8"
cd prefix/drive_c/EFZ
../../../wine/bin/wine start "config.exe"

Alternative method: Setting EFZ via Lutris

As of May 3rd, 2022, this method should still work.

For this, you need the following:

- Lutris, preferably .deb or your distro's choice of package, as this method has not been tested on the Flatpak version.

- Eternal Fighter Zero, thus the EFZ folder.

- Both d3dx9_43.dll and ddraw.dll must be on the EFZ folder. (Refer to the previous Wineprefix configuration section for a How to)

- Small terminal knowledge. (opening winecfg through the terminal of your choice. Refer to the previous Wineprefix configuration section for a How to.)

- A winehelper.bat file on the EFZ folder to run in Lutris.

Creating the winehelper file

(Note: Nemo or Dolphin file manager are recommended for this operation, as they offer to create an empty file out of the box.)

Once inside the EFZ folder, create an empty file and name it "winehelper.bat". Open the file via your text editor of choice, and paste the following line there:

%SystemRoot%\explorer.exe "."

Save the changes to finish setting up the file.

Setting up Lutris

First, click on the "+" icon on the upper left part of the window, and select "Add locally installed game".

Lutris1.png

Once here, you should choose the type of runner. We want to choose "Wine - runs Windows games" so we can select .exe files to run with Lutris.

Click on the second tab while you are here, and look for the first option - Runner. Then, click on the Browse / Examine button, and you will be prompted with a file manager.

Here, simply locate the winexplorer.bat file and click on it to select it as the runner that Lutris will use to run Eternal Fighter Zero.

The third tab, Runner options, is where you can select the wine version you wish to use. For this guide, Wine 5.17 (lutris-5.17) is the version that was used as an example, but any newer or older version of Wine should work as well.

Once done, you can save the changes and close the window.

Now, try running the game. Click on the Play button, or right click on the game's image and select Play. A window like this should pop up after a small while:

Lutris2winehelper.png

Once here, find the efzrevival.exe and run it by double clicking on it. It should open up and work just as it does on Windows.

And that should be all that is needed to run Eternal Fighter Zero with online play through Lutris.

Video Guide

Installing the wine libraries: https://streamable.com/1fc17b

Setting up Lutris: https://streamable.com/w9ujkr (Recommended to set the virtual desktop resolution to 1280x960 instead of 720 like it's displayed in the video.)


General
FAQ
Media
Characters
Akane
Akiko
Ayu
Doppel
Ikumi
Kanna
Kano
Kaori
Mai
Makoto
Mayu
Minagi
Mio
Misaki
Mishio
Misuzu
Mizuka
Nayuki (asleep)
Nayuki (awake)
Rumi
Sayuri
Shiori
UNKNOWN
Mechanics
Guides
Wiki