Hi everyone,
As I have struggled for long to get AoE2 + Voobly working on Linux, here is a quick guide for those who may be interested in playing AoE2 on Linux in solo or multiplayer.
There are actually two different guides:
1: The first one is the fastest, and is more or less the same than other guides that you could find here or on Voobly forums. MAJOR DOWNSIDE: If you ALT+TAB in game, and then go back in game, you keep scrolling indefinitly and the game becomes unplayable (see: https://bugs.winehq.org/show_bug.cgi?id=30814). Other than that, the game and Voobly run perfectly.
2: The second one addresses the ALT+TAB issue but is much longer. Use it if you are not afraid from installing wine from source.
## GUIDE 1 ##
This guide assumes you use a 64-bits Linux distro. The package manager used here is aptitude but apt-get is fine too.
First you need to install wine and directplay:
# aptitude install wine
# aptitude install winetricks
$ winetricks directplay
You then want to create a 32-bits prefix (that is important) with the following command:
$ WINEARCH=win32 WINEPREFIX=~/.wine wine wineboot
Now we want to install AoE2 and Voobly. The simpliest way is to do so on a Windows computer. So install Voobly and AoE2 on a Windows computer, make sure Voobly works in multiplayer, install any patch you want(SmallTree, WK, UserPatch, etc.)
After that, you should have two folders "Voobly" and "Age of Empires 2" that you can copy paste in the "Program Files" directory of your ~/.wine/drive_c folder.
Then open your text editor, and copy-paste:
#!/bin/bash
export STAGING_WRITECOPY=1 &&
cd /home/YOURNAME/.wine/dosdevices/c:/Program\ Files/Voobly/ &&
wine voobly.exe
And change "YOURNAME" to the right folder name.
Save this file as a .sh file (e.g. voobly.sh and place it in your home directory). Now to start Voobly you just have to open a console, and type "bash voobly.sh". Before that, I recommand to run winecfg, and to increase the DPI (otherwise fonts may be too smalls within Voobly. You can also change font size in Voobly parameters.).
You can now run Voobly. You may notice that the "Game Browser" is bugged, that is no big deal. Connect to the lobby you want, and you may be asked where is age2_x1.exe file. Create a room and start a game to check if the game runs fine. If so, go back and apply the following options to the game room:
Start again a game, and see if it lags. If it doesn't, congratz, you finished this guide and should now be able to play just as fine as on Windows!
However, you may experience mouse lag. I haven't found a complete solution to this, but a workaround is the following. Run wine regedit, and look for "Conquerors" with the "Find" tool. You should find the right folder, and look for the entry CommandLine. We will edit this entry as follows: "WHATWASALREADYTHERE NormalMouse". That is to say just add a space and "NormalMouse". The trick here is that you will now only use you computer mouse ingame and not the AoE2 mouse. DOWNSIDE: You loose some informations from the customs cursors of AoE2, but this is minor issue.
Now you just need to tick "Enable Microsoft Window cursor in game" in your game room parameters and you should now only have your computer mouse ingame, no more mouse lag. Et voilà!
Now be careful and DO NOT ALT+TAB ingame (except if you want to see what the bug described earlier does).
A last bug you may encounter: In Green Arabia, the light on the explored grass may flicker. It is no big deal but bad for eyes, so the only workaround I found was to install Enhanced Terrains mod. This depends of your screen and game resolution.
## GUIDE 2 : get rid of ALT+TAB bug ##
Forget what I wrote in guide 1. I won't write a complete guide, but just describe the important steps. The problem here is that we need to patch wine thanks to the solution found by Raditz12: see https://bugs.winehq.org/show_bug.cgi?id=30814#c22 and https://bugs.winehq.org/attachment.cgi?id=52463&action=diff. There is only three lines to edit in one source file! Yet we can't edit that file with wine already installed, because commands like aptitude install wine or .deb packages only give you binaries, that is to say a package already compiled.
So what we need to do is to download wine sources. Those can be found on wine website.
I strongly recommend you to read this page: https://wiki.winehq.org/Building_Wine and especially the "Shared WoW64" part. That is what you will have to do. The big deal here is to install the dependencies in order to have everything working fine.
After downloading the sources, just decompress the .tar.bz2 file, add the files to a ~/wine-dirs/wine-source directory, and apply the changes in the dlls/user32/input.c file (I did it manually). After that, you can follow the steps in the "Shared WoW64" section.
This should do the works. If you have any problem during the install / after, feel free to ask, I may have encountered them also.
Hope this helps somebody (oh, one day!).
As I have struggled for long to get AoE2 + Voobly working on Linux, here is a quick guide for those who may be interested in playing AoE2 on Linux in solo or multiplayer.
There are actually two different guides:
1: The first one is the fastest, and is more or less the same than other guides that you could find here or on Voobly forums. MAJOR DOWNSIDE: If you ALT+TAB in game, and then go back in game, you keep scrolling indefinitly and the game becomes unplayable (see: https://bugs.winehq.org/show_bug.cgi?id=30814). Other than that, the game and Voobly run perfectly.
2: The second one addresses the ALT+TAB issue but is much longer. Use it if you are not afraid from installing wine from source.
## GUIDE 1 ##
This guide assumes you use a 64-bits Linux distro. The package manager used here is aptitude but apt-get is fine too.
First you need to install wine and directplay:
# aptitude install wine
# aptitude install winetricks
$ winetricks directplay
You then want to create a 32-bits prefix (that is important) with the following command:
$ WINEARCH=win32 WINEPREFIX=~/.wine wine wineboot
Now we want to install AoE2 and Voobly. The simpliest way is to do so on a Windows computer. So install Voobly and AoE2 on a Windows computer, make sure Voobly works in multiplayer, install any patch you want(SmallTree, WK, UserPatch, etc.)
After that, you should have two folders "Voobly" and "Age of Empires 2" that you can copy paste in the "Program Files" directory of your ~/.wine/drive_c folder.
Then open your text editor, and copy-paste:
#!/bin/bash
export STAGING_WRITECOPY=1 &&
cd /home/YOURNAME/.wine/dosdevices/c:/Program\ Files/Voobly/ &&
wine voobly.exe
And change "YOURNAME" to the right folder name.
Save this file as a .sh file (e.g. voobly.sh and place it in your home directory). Now to start Voobly you just have to open a console, and type "bash voobly.sh". Before that, I recommand to run winecfg, and to increase the DPI (otherwise fonts may be too smalls within Voobly. You can also change font size in Voobly parameters.).
You can now run Voobly. You may notice that the "Game Browser" is bugged, that is no big deal. Connect to the lobby you want, and you may be asked where is age2_x1.exe file. Create a room and start a game to check if the game runs fine. If so, go back and apply the following options to the game room:
Start again a game, and see if it lags. If it doesn't, congratz, you finished this guide and should now be able to play just as fine as on Windows!
However, you may experience mouse lag. I haven't found a complete solution to this, but a workaround is the following. Run wine regedit, and look for "Conquerors" with the "Find" tool. You should find the right folder, and look for the entry CommandLine. We will edit this entry as follows: "WHATWASALREADYTHERE NormalMouse". That is to say just add a space and "NormalMouse". The trick here is that you will now only use you computer mouse ingame and not the AoE2 mouse. DOWNSIDE: You loose some informations from the customs cursors of AoE2, but this is minor issue.
Now you just need to tick "Enable Microsoft Window cursor in game" in your game room parameters and you should now only have your computer mouse ingame, no more mouse lag. Et voilà!
Now be careful and DO NOT ALT+TAB ingame (except if you want to see what the bug described earlier does).
A last bug you may encounter: In Green Arabia, the light on the explored grass may flicker. It is no big deal but bad for eyes, so the only workaround I found was to install Enhanced Terrains mod. This depends of your screen and game resolution.
## GUIDE 2 : get rid of ALT+TAB bug ##
Forget what I wrote in guide 1. I won't write a complete guide, but just describe the important steps. The problem here is that we need to patch wine thanks to the solution found by Raditz12: see https://bugs.winehq.org/show_bug.cgi?id=30814#c22 and https://bugs.winehq.org/attachment.cgi?id=52463&action=diff. There is only three lines to edit in one source file! Yet we can't edit that file with wine already installed, because commands like aptitude install wine or .deb packages only give you binaries, that is to say a package already compiled.
So what we need to do is to download wine sources. Those can be found on wine website.
I strongly recommend you to read this page: https://wiki.winehq.org/Building_Wine and especially the "Shared WoW64" part. That is what you will have to do. The big deal here is to install the dependencies in order to have everything working fine.
After downloading the sources, just decompress the .tar.bz2 file, add the files to a ~/wine-dirs/wine-source directory, and apply the changes in the dlls/user32/input.c file (I did it manually). After that, you can follow the steps in the "Shared WoW64" section.
This should do the works. If you have any problem during the install / after, feel free to ask, I may have encountered them also.
Hope this helps somebody (oh, one day!).
Last edited: