WineD3D DLLs to play Dark Souls II on Linux

Info:http://davidgis.fr
Author: David TECHER,
Date: 2014-10-30
Revision: 303-121623

Important

Dark Souls II can be play on Linux. Using Wine 1.7 there are two options to play this game
  1. OPTION 1: If you want build wine yourself then you can find instructions at http://www.davidgis.fr/documentation/Dark_Souls_II/
  2. OPTION2: Keep your own Wine version. You just have to download WineD3D DLLS. This is what I tested on Ubuntu 12.04 32 Bits. This way NVIDIA users don't have to patch their own Wine version.

Table of contents

1   Prerequisites: Wine/WineTricks/Steam

  1. You should have wine installed

    sudo apt-get install wine winetricks
    
  2. Install Steam

    winetricks --no-isolate steam
    
  3. Using winetricks install requirements to play videos for this game

    winetricks -q devenum quartz wmp10 vcrun2010
    
  1. Launch Steam (your own account etc....)
  2. Buy the game

Important

If you try to play Dark Souls II now then your screen may flicker! That's why I rebuilt WineD3D DLLs so this issue could be fixed!

2   How to use those DLLs and play this game

  1. Download those DLLs using table below. (green = OK | red = Outdated)
File Status Download History
WineD3D_Dark_Souls_II.tar.bz2 | green WineD3D_Dark_Souls_II_tar.bz2
  • Add NVIDIA Geforce GTX 780 Ti
  • Add NVIDIA Geforce GTX 780
  • Add NVIDIA Geforce GTX 760
  • Add NVIDIA Geforce GTX 750
  • Patch to start the game
  • Patch to avoid invisible ennemies
  • Patch to set StrictDrawOrdering to 'enabled'.This way users don't have to set it using regedit
  • Patch to avoid flickering screen

Tip

If you want to build those DLLs yourself so refer to Instructions to build WineD3D DLLS

  1. Decompress this tarball and copy those DLLS into folder in "Dark Souls 2/Game" folder -- where your 'DarkSoulsII.exe' executable is located

    Game

  2. Using winecfg choose a virtual desktop to play the game

    winecfg

  3. Now you can run the game using commands listed below

    • Set up the following variables

      Tip

      It is very important to use the commands before launching Steam else game will get slower.

      export WINEDEBUG="-all"
      export WINEDLLOVERRIDES="d3d10,d3d10core,d3d8,d3d9,ddraw,dxgi,libwine,wined3d=n"
      
    • Go to the folder where Dark Souls II is located and run the game

      cd "$WINEPREFIX/drive_c/Program Files/Steam/SteamApps/common/Dark Souls II/Game"
      wine DarkSoulsII.exe
      

      or you can start this game through Steam if Steam is not already started!

      cd "$WINEPREFIX/drive_c/Program Files/Steam
      wine Steam.exe
      

3   XBOX 360 Contoller

Dark Souls II could be played using XBOX 360 controller.

Xbox_360_Controller

3.1   Instructions

Tip

xboxdrv` is used. Without xboxdrv it is not doable to lock on/off target enemies using 'RS' button.

  • Unplug your controller

  • Unload xpad module

    sudo rmmod xpad
    
  • Plug your controller

  • Run the following command

    sudo xboxdrv --detach-kernel-driver --detach -D --force-feedback --deadzone 10% --trigger-as-zaxis --buttonmap tl=tr,tr=tl --axismap -trigger=trigger
    

3.2   Known issues #1: I got a dbus error

If you got

[ERROR] XboxdrvDaemon::run(): fatal exception: failed to get unique dbus name: Connection ":1.7" is not allowed to own the service
  "org.seul.Xboxdrv" due to security policies in the configuration file

Then add

--dbus disabled

3.3   Known issues #2: I can't jump

If you can not jump then you should update your settings before

Xbox_360_Controller

  • Plug your XBox 360 controller. Click 'Start' button

  • Navigate to the right menu. Click A as shown on image below

    Dark_Souls_II_Jump_Switch_001

  • Using the Directional pad (D-pad) navigate to the line as shown on image below hightlightted in red color

    Dark_Souls_II_Jump_Switch_002

  • Using the Directional pad (D-pad), switch from the default setting to 'B' as shown on image below hightlightted in red color

    Dark_Souls_II_Jump_Switch_003

  • To run: 'Left stick' + 'B'

  • To jump: while running (both 'left stick' and 'B' pressed) ...when you want to jump

    • keep 'left stick' pressed / stop press 'B'
    • keep 'left stick' pressed / press 'B' quickly

4   Instructions to build WineD3D DLLS

Tip

If you don't want to build those DLL then you can find WineD3D DLLs already built (link provided in table above) . Then jump to section How to use those DLLs and play this game

4.1   Prerequisies: Patches for Wine 1.7.15

4.1.1   Download

  • Download wine 1.7.15 sources

    wget http://mirrors.ibiblio.org/wine/source/1.7/wine-1.7.15.tar.bz2
    
  • Decompress the tarball

    tar xvjf wine-1.7.15.tar.bz2
    
  • Go to this folder

    cd wine-1.7.15
    

4.1.2   Patches: Download this patch and apply it

You can both download and patch wine-1.7.15

cd wine-1.7.15
wget -q http://www.davidgis.fr/download/wine/patches/wine-1.7.15_Dark_Souls_II_WineD3D.patch -O - |patch -p1

4.1.3   Patches: History of this patch (optional!)

Here is the history for this patch (optionnal if you ran commands below)

  1. Patches to apply in order to start the game (taken from wine git repository)

    Note

    It took me a couple of hours to find the patches required so this game could start!

    wget -q "http://source.winehq.org/git/wine.git/patch/a1784d9ed939ea2fdc350489fdbe94502912a276" -O - |patch -p1
    wget -q "http://source.winehq.org/git/wine.git/patch/4811a839cf4f21a17323a0f0b1f148d0fc9840fb" -O - | patch -p1
    
  2. Patch to apply to remove invisible enemies (author: Krzysztof Sobiecki )

    Note

    There is a link to this patch is comments section in http://appdb.winehq.org/objectManager.php?sClass=version&iId=30252

    wget -q "http://pastebin.com/raw.php?i=dgpekkVY" -O - | patch -p1
    
  3. Patch (to be reversed) to avoid flickering screen

    Note

    This is my own patch so I can play Crysis 2 with Wine 1.7.15. I had to write this patch because the real huge patch for wine over 1.7.17 didn't work for wine 1.7.15

    wget -q http://www.davidgis.fr/download/wine/patches/reversed_pixel.patch -O - | patch -p1 -R
    
  4. StrictDrawOrdering has to be set to 'enabled'. It is set to 'disabled' by default. Apply this patch to set it to 'enabled'

    wget -q http://www.davidgis.fr/download/wine/patches/enable_strict_draw_ordering.patch -O - |patch -p1
    
  5. These patches are optional.

    # wined3d: Add NVIDIA Geforce GTX 760 to device list.
    wget -q "http://source.winehq.org/git/wine.git/patch/ed51082dd6f0dfa030ccf55a235379ef1c3681bf" -O  - |patch -p1
    #wined3d: Add NVIDIA Geforce GTX 750 to device list.
    wget -q "http://source.winehq.org/git/wine.git/patch/a69c488f087b5a09599b841c929ec2531888d279" -O - | patch -p1
    # Add NVIDIA Geforce GTX 780 to supported device list.
    wget -q "http://source.winehq.org/git/wine.git/patch/5ef54904f24c7dfc4a0bfd1795e59cf510c425d2" -O - | patch -p1
    # wined3d: Add NVIDIA Geforce GTX 780 Ti to supported device list.
    wget -q "http://source.winehq.org/git/wine.git/patch/84c63435b4370af16908b0c6a89c6b5fa56fe170" -O - |patch -p1
    # Add my own graphic card since it is a GTX 680 hard-moded to GRID K2
    wget -q "http://www.davidgis.fr/download/wine/patches/wined3d_grid_k2.patch" -O - | patch -p1
    

4.2   Build DLLs using Mingw on Linux

Note

Commands provided in this section are taken from WineD3DOnWindows. Check that mingw is installed (apt-get install ...)

  • Unset CC

    unset CC
    
  • Get out from wine-1.7.15 folder

    cd ..
    
  • Delete any folder 'wine-win32', 'wine-tools'

    rm -rf wine-tools  wine-win32
    
  • Do the first taken from WineD3DOnWindows

    mkdir -p wine-tools
    cd wine-tools
    ../wine-1.7.15/configure  --without-freetype
    make -j2  __tooldeps__
    
  • If it is OK then go ahead with commands below

    Note

    Here I don't use the flag -DUSE_WIN32_OPENGL as it is suggested on WineD3DOnWindows else patch #2 (provided by Krzysztof Sobiecki ) won't work = Game will crash!

    cd ..
    mkdir -p wine-win32
    cd wine-win32
    ../wine-1.7.15/configure  --without-freetype --host=i586-mingw32msvc CFLAGS="-O2 -DWINE_NOWINSOCK" --with-wine-tools=/root/wine-tools/
    make -j2 dlls/d3d10 dlls/d3d10core dlls/d3d8 dlls/d3d9 dlls/ddraw dlls/dxgi dlls/wined3d
    mkdir -p crossdlls
    cp -vf dlls/d3d10/d3d10.dll dlls/d3d10core/d3d10core.dll dlls/d3d8/d3d8.dll dlls/d3d9/d3d9.dll \
            dlls/ddraw/ddraw.dll dlls/dxgi/dxgi.dll dlls/wined3d/wined3d.dll libs/wine/libwine.dll \
                    crossdlls/
    cp -r crossdlls/ /tmp/
    cd ..
    
  • All DLLs are available in '/tmp/crossdlls' folder