How to patch WINE for Linux (Ubuntu) for play on Uthgard

If you need support, you can get help here!
thursa
Myrmidon
 
Posts: 83
Joined: Sep 23, 2012 23:35

Postby thursa » Sep 22, 2013 10:18

It's time I put together this little guide on how to patch WINE for use on Linux (I'm using Ubuntu.. if you're not using Ubuntu or a debian-based distro, you might have to find a different way.)

Just some background. WINE queries the graphics card and driver for the max GL blending and gets back a 0. This breaks Dark Age of Camelot in WINE. Hence the simple one-line patch. Unfortunately, this would most likely break WINE for other apps, but it will work perfectly with DAoC.

This guide assumes you are running 64-bit Ubuntu, as all modern computers support 64-bit. If you're using 32-bit, you can skip the part about making a 32-bit chroot environment for WINE.

Install 32-bit Chroot
Reference: https://help.ubuntu.com/community/DebootstrapChroot

1. Install schroot and debootstrap:
Code: Select all
sudo apt-get install schroot debootstrap


2. Assuming you're using 13.04 (Raring Ringtail), create a file called raring_i386.conf in /etc/schroot/chroot.d/raring_i386.conf:
Code: Select all
[raring_i386]
description=Ubuntu Raring
personality=linux32
directory=/var/chroot/raring_i386
root-users=<YOUR USERNAME>
type=directory
users=<YOUR USERNAME>


(Replace <YOUR USERNAME> with the username you use on the system)

3. Set up the 32-bit chroot environment:
Code: Select all
sudo mkdir -p /var/chroot/raring_i386
sudo debootstrap --variant=buildd --arch=i386 raring /var/chroot/raring_i386 http://archive.ubuntu.com/ubuntu/


4. Check the environment:
Code: Select all
schroot -c raring_i386 -u root
lsb_release -a


This should show the environment

5. Install a minimal ubuntu environment and all the WINE dependencies
PLEASE USE WINE 1.4.1 or 1.5.31. In 1.6, the pixel shader code has changed substantially and this patch will not work with it.

Code: Select all
schroot -c raring_i386 -u root
apt-get install ubuntu-minimal build-essential devscripts quilt
apt-get build-dep wine1.4


6. The source code for WINE should be located in /root on the chroot

Patching WINE and building packages

(Note your WINE directory may be a different version!)
Code: Select all
cd wine1.4-1.4.1
quilt new daoc.patch
quilt add dlls/wined3d/directx.c
edit dlls/wined3d/directx.c
quilt refresh
dch -i "WINE patched for use with Dark Age of Camelot"
debuild -uc -us


When editing the file above, use your favorite editor and go to around line 2613 in directx.c and change it so it looks like this:

Code: Select all
    if (gl_info->supported[ARB_VERTEX_BLEND])
    {
        glGetIntegerv(GL_MAX_VERTEX_UNITS_ARB, &gl_max);
        gl_info->limits.blends = gl_max;
        TRACE_(d3d_caps)("Max blends: %u.\n", gl_info->limits.blends);
    }
    gl_info->limits.blends = 4; /* DAOC Hack */
    if (gl_info->supported[EXT_TEXTURE3D])
    {
        glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE_EXT, &gl_max);
        gl_info->limits.texture3d_size = gl_max;
        TRACE_(d3d_caps)("Max texture3D size: %d.\n", gl_info->limits.texture3d_size);
    }
    if (gl_info->supported[EXT_TEXTURE_FILTER_ANISOTROPIC])
    {
        glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &gl_max);


7. Exit the schroot and make sure you have 64-bit dependencies installed for the 64-bit side of things:

Code: Select all
sudo apt-get install build-essential devscripts quilt
apt-get build-dep wine1.4


8. Repeat step 6 fo the 64-bit environment. Make sure the .deb files are placed in a DIFFERENT location than where you put the 32-bit ones.

9. Almost there! Let's install the 64-bit .deb packages:
Code: Select all
dpkg -i wine_1.4.1-0ubuntu2_amd64.deb wine1.4-amd64_1.4.1-0ubuntu2_amd64.deb


Now install the 32-bit .deb package:
Code: Select all
dpkg -i wine1.4-i386_1.4.1-0ubuntu2_i386.deb


10. Install winetricks and Mono for WINE:
Code: Select all
sudo apt-get install winetricks
winetricks mono210


You should now be able to run Dark Age of Camelot on Linux!

As for patching, I have never found patching to work properly on Linux. The Tajendi 2 patch would break DaOC for Uthgard. I got around this by creating a Windows XP VM on VirtualBox, copying all the files over to it and patching it in Windows, then copying them back to Linux.

Script to run Uthgard-flavored DAoC

Here's the script I use (note: I run it from the Ramdisk from a script which I've included below. You can substitute /opt/daoc with where ever you installed the DAoC directory you've patched for Uthgard.)

Code: Select all
#!/bin/sh

USER=<YOUR Uthgard username>
PASS=<YOUR Uthgard password>
SERVER=server.uthgard.net
cd /opt/daoc
wine connect.exe ./ $SERVER $USER $PASS


*** BONUS ***

If you have plenty of memory (8 GB) or higher, you can copy all the DAoC files to a ramdisk. Change uid and gid to match your user id, if you are the first user created on the system, it should be 1000.

Code: Select all
#!/bin/bash
# Set up Uthgard ramdisk -- faster than regular disk!

if [ -h /opt/daoc ]; then
   sudo rm -f /opt/daoc
fi
sudo mkdir -p /opt/daoc
sudo mount -t tmpfs -o size=5736340k,nr_inodes=43620,mode=755,uid=1000,gid=1000 tmpfs /opt/daoc
echo -n "Copying DAOC files to Ramdisk..."
rsync -rl $HOME/daoc/ /opt/daoc/
echo "done!"

sudo mkdir -p /opt/EOA
if [ -d $HOME/Electronic\ Arts ]; then
  rm -rf $HOME/Electronic\ Arts
fi

sudo  mount -t tmpfs -o size=1024k,mode=755,uid=1000,gid=1000 tmpfs /opt/EOA
ln -sf /opt/EOA $HOME/Electronic\ Arts


The script above assumes your Uthgard-patched daoc directory is located in $HOME/daoc.
The second bit is the temporary chat buffers section that Dark Age of Camelot creates and places that on a ramdisk.
If you need to save any combat information, make sure you copy the files from /opt/EOA first before you unmount the ramdisk!

Sound Issues

If you encounter issues where the sound doesn't work.. and you have some other app using the sound system (via Pulseaudio or otherwise) make sure you install libasound2-plugins:i386:

Code: Select all
apt-get install libasound2-plugins:i386


I hope this guide helps. If there are any refinements needed, I'd be happy to edit the original post to suit.
Last edited by thursa on Dec 06, 2013 09:17, edited 3 times in total.

User avatar
Fortyseven
Forum Moderator
Forum Moderator
 
Posts: 643
Joined: Apr 01, 2009 00:00
Location: V.N. Milfontes, PT

Postby Fortyseven » Sep 22, 2013 19:07

Great guide. I've been asked to write one, but you've taken that out of my hands (I did manage to get DAoC to work without chroot, this was on Debian, BackTrack and Kali however, not Ubuntu... involved installing redist versions of DirectX 9.0c and the .NETs needed, since mono tended to act up and cause random portal crashes and breaking sockets)!

Sticky :)
Image
Image
Image

thursa
Myrmidon
 
Posts: 83
Joined: Sep 23, 2012 23:35

Postby thursa » Sep 26, 2013 10:55

Thanks. I had to cobble this together from various notes, so if there is anything missing or went wrong, I can fix the original post.
My next project is to try and get Uthgard DAoC working on FreeBSD. I heard it can run WINE faster than Linux.

User avatar
realac0
Eagle Knight
 
Posts: 548
Joined: May 18, 2010 00:00

Postby realac0 » Sep 29, 2013 14:38

i play Uthgard on Linux from years, and now is time to fix the "u must update your connect.exe ... bla bla".

i've read lot of posts, i've try the script posted on this broad that download the client, install mono etc etc, but the game started, not give anymore the message of update connect.exe, but mods are not applyed and, most important, performance are really poor, lot wrost than my old Playonlinux installtion (still working).

atm i am using ubuntu 12.04 with HD5850 and last drivers ATI

installed and working DAoC under a prefix using Playonlinux (atm i use wine dolloader.exe to start client)

so the question is:

- having a working client on Linux (the one on Playonlinux)
- having a daoc installation working and patched on windows7 partition (and on vmware too under linux)

what i must copy from patched clients (the win7 ones) into my working Playonlinux prefix for make this new connect system work?

another question is:

- how to start it?

... i have other questions, but first i'd like help on this
---------- UTHGARD 1.0 ------------
ALBION
Imeope 6l1 - Infiltrator
Imoep St0ned - 6l7 Paladin
Ellehn Thunderer - 7l0 Scout

HIBERNIA
Drawstab Boo <Rinnegati> - 9l0 Ranger
Realz <Rinnegati> - 6l3 Blademaster
----------------------------------------
Drawstab Vol.1) http://www.youtube.com/watch?v=s5mE6RQhRwA
Drawstab Vol.2) http://www.youtube.com/watch?v=fDsCAMqZ ... e=youtu.be
Paladin WTF http://www.youtube.com/watch?v=-FeY55eYiQI

... currently playing ESO

thursa
Myrmidon
 
Posts: 83
Joined: Sep 23, 2012 23:35

Postby thursa » Oct 03, 2013 09:04

realac0 wrote:i play Uthgard on Linux from years, and now is time to fix the "u must update your connect.exe ... bla bla".

i've read lot of posts, i've try the script posted on this broad that download the client, install mono etc etc, but the game started, not give anymore the message of update connect.exe, but mods are not applyed and, most important, performance are really poor, lot wrost than my old Playonlinux installtion (still working).

atm i am using ubuntu 12.04 with HD5850 and last drivers ATI

installed and working DAoC under a prefix using Playonlinux (atm i use wine dolloader.exe to start client)

so the question is:

- having a working client on Linux (the one on Playonlinux)
- having a daoc installation working and patched on windows7 partition (and on vmware too under linux)

what i must copy from patched clients (the win7 ones) into my working Playonlinux prefix for make this new connect system work?

another question is:

- how to start it?

... i have other questions, but first i'd like help on this


I create a separate, specially-patched version of DAoC for Uthgard. Basically, I copy this to a Windows virtual machine and patch it there with ModManager. Once it has successfully patched, I copy it back to the Linux system (ALL OF IT).

I did notice that when it comes time to update ModManager/Portal/Connect.exe files, the updater fails in WINE. It leaves: update.Connect.exe and update.ModManager.exe and update.Portal.exe files lying around. I just do:

mv update.Connect.exe Connect.exe
mv update.ModManager.exe ModManager.exe
mv update.Portal.exe Portal.exe
mv update.Updater.exe Updater.exe

In addition, because I do not want Uthgard trying to re-patch my game files (because once the Taj2 patch happens, it breaks the game!), I rename ModManager.exe to something else!

I also only connect to Uthgard using Connect.exe. I do not use Portal.exe.

I don't think dolloader.exe is used anymore. I also don't have Mono installed on the linux side, I only install it inside WINE.
WINE takes care of running Connect.exe to connect to Uthgard. (See the script in the first post)

I've not used the Playonlinux client. I just grab the installDAOC.msi and install that from scratch, copy to windows vm, patch it for Uthgard, and copy it back.

User avatar
realac0
Eagle Knight
 
Posts: 548
Joined: May 18, 2010 00:00

Postby realac0 » Oct 04, 2013 18:07

well, SUCCESS!! work like a charm.

i just copyed everything from my Win7 partition (ofc u can do from a VM too) into my already working Playonlinux prefix (where all settings was already right set for daoc ... winecfg, regedit etc.).
doing "export WINEPREFIX=dir/of/prefix" and launching daoc with wine connect.exe, was a fail.
i've look the debug and was claiming about install mono for run dotnet applications and bla bla
i installed mono via winetricks
after this i edited and made some tests for the launcher (to put on Playonlinux -> shortcuts)

this one is working (is basically the same i've read on this post, w/out use variables):
maybe can be useful for guys that, like me, use Playonlinux:


--- sry i don't see the code button for paste terminal code ---

#!/bin/bash
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
export WINEPREFIX="/home/realac0/.PlayOnLinux/wineprefix/DAOC2"
export WINEDEBUG="-all"
#POL_Log=Installazione manuale_1323683884
cd "/home/realac0/.PlayOnLinux/wineprefix/DAOC2/drive_c/Electronic Arts/Dark Age of Camelot2"

wine connect.exe ./ server.uthgard.net USER PASSWORD

------------------------------------------------------------------------

100% working, no more errors of connect and bla bla bla
thx for the help!!!


... another question below
---------- UTHGARD 1.0 ------------
ALBION
Imeope 6l1 - Infiltrator
Imoep St0ned - 6l7 Paladin
Ellehn Thunderer - 7l0 Scout

HIBERNIA
Drawstab Boo <Rinnegati> - 9l0 Ranger
Realz <Rinnegati> - 6l3 Blademaster
----------------------------------------
Drawstab Vol.1) http://www.youtube.com/watch?v=s5mE6RQhRwA
Drawstab Vol.2) http://www.youtube.com/watch?v=fDsCAMqZ ... e=youtu.be
Paladin WTF http://www.youtube.com/watch?v=-FeY55eYiQI

... currently playing ESO

User avatar
realac0
Eagle Knight
 
Posts: 548
Joined: May 18, 2010 00:00

Postby realac0 » Oct 04, 2013 18:21

second question is about the wine version and the known problem of "VertexShaderMode=none" that make impossible to use catacombs models.
i've read and found somewhere (prolly on these broads) a post about a re-compiled working wine version that fix this problem (i should have the wine foloder somewhere on my backups). With this re-compiled wine, was possible run catacombs models.

this is the old thread:

viewtopic.php?f=65&t=17654

for me, using ATI GPU, this was not working (while using nvidia cards seem was ok).

so for all these time i just run old models when i play on Linux.

this is not a problem at all, BUT:

there are some skins that make me crash the client, because seem use models that need the "VertexShaderMode=enabled"
exemple:

- Bersekeers when new vendo mode
- Bainshee mob skins (bananas?) on lep tower hib hr
- bd pets
- mid warevolves mobs skin (=same skin of bersekeers vendo mode)

this make for me impossible play 8v8, and force to re-boot on windows (i usually play fine 1on1 with ranger amg, even if sometimes my client crash if a sorc+bananas pass the wall ^_^)

i've solved the problem of Bersekers finding a way to change the vendo mode replacing new model to old, but i have no idea how fix bananas, bd pets and warewolves (replacing the model)

u have this problem too?
if yes, u have a solution?

let me know
bb and thx for the help
---------- UTHGARD 1.0 ------------
ALBION
Imeope 6l1 - Infiltrator
Imoep St0ned - 6l7 Paladin
Ellehn Thunderer - 7l0 Scout

HIBERNIA
Drawstab Boo <Rinnegati> - 9l0 Ranger
Realz <Rinnegati> - 6l3 Blademaster
----------------------------------------
Drawstab Vol.1) http://www.youtube.com/watch?v=s5mE6RQhRwA
Drawstab Vol.2) http://www.youtube.com/watch?v=fDsCAMqZ ... e=youtu.be
Paladin WTF http://www.youtube.com/watch?v=-FeY55eYiQI

... currently playing ESO

thursa
Myrmidon
 
Posts: 83
Joined: Sep 23, 2012 23:35

Postby thursa » Oct 13, 2013 19:26

realac0 wrote:second question is about the wine version and the known problem of "VertexShaderMode=none" that make impossible to use catacombs models.
i've read and found somewhere (prolly on these broads) a post about a re-compiled working wine version that fix this problem (i should have the wine foloder somewhere on my backups). With this re-compiled wine, was possible run catacombs models.

this is the old thread:

viewtopic.php?f=65&t=17654

for me, using ATI GPU, this was not working (while using nvidia cards seem was ok).

so for all these time i just run old models when i play on Linux.

this is not a problem at all, BUT:

there are some skins that make me crash the client, because seem use models that need the "VertexShaderMode=enabled"
exemple:

- Bersekeers when new vendo mode
- Bainshee mob skins (bananas?) on lep tower hib hr
- bd pets
- mid warevolves mobs skin (=same skin of bersekeers vendo mode)

this make for me impossible play 8v8, and force to re-boot on windows (i usually play fine 1on1 with ranger amg, even if sometimes my client crash if a sorc+bananas pass the wall ^_^)

i've solved the problem of Bersekers finding a way to change the vendo mode replacing new model to old, but i have no idea how fix bananas, bd pets and warewolves (replacing the model)

u have this problem too?
if yes, u have a solution?

let me know
bb and thx for the help



Yes, this is all fixed above. See the change I made to the WINE source code for 'dlls/wined3d/directx.c'. Adding the gl_max_blend line and recompiling WINE fixes all the problems with the models above. It's the reason you have to compile WINE from source and create packages for it.

Of course, this may break other WIndows programs you run with WINE!

Veritaas
Warder
 
Posts: 43
Joined: Nov 17, 2012 16:49

Postby Veritaas » Nov 04, 2013 19:35

I use wine for some other purposes, so i'd like to run daoc with the binaries that i get from my official repos, without compiling it from source (im using a rolling release distro).

As the only thing you did was recompiling whole wine just for one single .dll (or two if the lib64 one is not just a link to the lib32 one), i should be able to just use the finished dll that you compiled if you gave me those, or am i wrong?
In winecfg you can set extra rules for each executable which dlls are to be used.
Image
New Uthgard:
- Dve MultiTools [Paper Daoc] (Merc) 8L3
Uthgard Legacy:
- Veritaas LivingWeapon (Merc) 10L0
- Blooddyn HeavyDuty (2h Pala) 7Lx
on the "other" Freeshard: Veritate (Merc) 10L; on Camlann (EU PvP): Veritaas (Merc) 10L

User avatar
Sioras
Myrmidon
 
Posts: 174
Joined: Jan 20, 2010 01:00
Location: Germany

Postby Sioras » Nov 04, 2013 19:58

Veritaas wrote:I use wine for some other purposes, so i'd like to run daoc with the binaries that i get from my official repos, without compiling it from source.

As the only thing you did was recompiling whole wine just for one single .dll (or two if the lib64 one is not just a link to the lib32 one), i should be able to just use the finished dll that you compiled if you gave me those, or am i wrong?
In winecfg you can set extra rules for each executable which dlls are to be used.


I run standard wine with game.dll-only setup, e.g., no pixel shader. That is, you can use your standard wine but need to set some extra options as well as some tuning concerning your sound and graphic setup (see tips in this board or visit WineHQ.org). You don't have to use playonlinux, nevertheless I'd recommend to use winetricks at least.


I suggest at least:
- disable fixme-SPAM (causes lags)
- disable pixelshader for game.dll
- use window mode
- use alsa instead of pulse (gives you multi-sound, e.g., for TS + DAoC)
- dependent on your graphic card, use OpenGL instead of DirectX
- there are many more tuning advices which are strongly dependent on your hardware and OS

Greets Sio
Last edited by Sioras on Nov 04, 2013 20:02, edited 1 time in total.
Image

User avatar
Sioras
Myrmidon
 
Posts: 174
Joined: Jan 20, 2010 01:00
Location: Germany

Postby Sioras » Nov 04, 2013 20:01

NVM ... double :!:
Image

thursa
Myrmidon
 
Posts: 83
Joined: Sep 23, 2012 23:35

Postby thursa » Nov 06, 2013 19:47

Running DAOC in WINE without pixelshaders looks HIDEOUS. Maybe there's a way to copy/symlink in a special changed .dll but I'm not sure which one this would be.

The best thing would be for the WINE team to add in some kind of quirk or have it handle gl_max_blends properly. I think what happens is it queries the graphics card for the max_blends and it returns a 0 and DAOC is so old it can't handle it properly.

thursa
Myrmidon
 
Posts: 83
Joined: Sep 23, 2012 23:35

Postby thursa » Dec 05, 2013 11:24

I've just tried getting WINE to compile on Debian 7 (Wheezy) amd64 in a 32-bit chroot. It compiles, but I get the dreaded: "Renderer creation failed". It's as if it can't find a library somewhere.

This is with WINE 1.6.1 but the code is pretty much the same. Would be better if we could add in a quirk for 'game.dll' so WINE wouldn't need constant recompiling.

I used the guide here: http://verahill.blogspot.com.au/2013/05/416-wine-1530-in-chroot.html

Unfortunately it doesn't seem to be complete. On older versions of Debian you could kind of cross-compile without a 32-bit chroot, but that's all changed now that Debian has gone down the multi-arch path.

EDIT: WINE v1.6.1 is broken with the patch. The code for pixel shaders appears to have changed quite a bit from 1.4.1

More notes: Needed to install libasound2-plugins:i386 to get sound working properly if something else already uses pulseaudio/sound system

Confirmed: Patch works with WINE v1.5.31. To do: Check WINE 1.6 release candidates to see where it changed such that the patch stopped working

User avatar
epo
Gryphon Knight
 
Posts: 287
Joined: Mar 26, 2013 11:33

Postby epo » Dec 06, 2013 06:24

last time i also got the renderer creation failed error message. so if you could figure out what to do,I would totally switch to my Linux system again.
holsten-knight wrote:Just get over it, reach high rr and look at all high rr caster prior to this change as unworthy and laugh about them. :wink:


Image
Image

thursa
Myrmidon
 
Posts: 83
Joined: Sep 23, 2012 23:35

Postby thursa » Dec 06, 2013 09:13

epo wrote:last time i also got the renderer creation failed error message. so if you could figure out what to do,I would totally switch to my Linux system again.


Use WINE 1.4.1 or 1.5.31 (don't use 1.6.xx!!) and patch it as above with the :
gl_info->limits.blends = 4;

And recompile it. You have to use a 32-bit chroot to compile as DAoC will not run with a 64-bit WINE, only with 32-bit WINE.

I also symlinked libGL.so.1 and libGLU.so.1 to /lib32 and that seemed to work.


Return to Support

Who is online

Users browsing this forum: No registered users and 8 guests

Monday, 03. March 2025

Artwork and screen shots Copyright © 2001-2004 Mythic Entertainment, Inc. All rights reserved. Used with permission of Mythic Entertainment. Mythic Entertainment, the Mythic Entertainment logo, "Dark Age of Camelot," "Shrouded Isles," "Foundations," "New Frontiers," "Trials of Atlantis," "Catacombs," "Darkness Rising," the Dark Age of Camelot and subsequent logos, and the stylized Celtic knot are trademarks of Mythic Entertainment, Inc.

Valid XHTML & CSS | Original Design by: LernVid.com | Modified by Uthgard Staff