Author Topic: War2 over Linux  (Read 35208 times)

Offline Delete mine too

  • Death Knight
  • *********
  • Posts: 2652
  • http://meatspin.com
    • View Profile
    • http://meatspin.com
Re: War2 over Linux
« Reply #15 on: June 09, 2016, 08:00:19 PM »
Good find! I seen fixes like those and people get game play nicely but that display for bnet interface and random crashes is a problem ;(

Offline shesycompany

  • Death Knight
  • *********
  • Posts: 3587
  • retired, be in music section
    • View Profile
Re: War2 over Linux
« Reply #16 on: June 09, 2016, 10:22:36 PM »
just vm used to in linux

Offline Igognito

  • Axe Thrower
  • ****
  • Posts: 406
    • View Profile
Re: War2 over Linux
« Reply #17 on: June 09, 2016, 11:40:25 PM »
After a night of Gaming I want to give some more feedback on the mentioned problems:

a) The graphics of battle.net enviroment are non visible (THIS PROBLEM IS STILL PENDING BUT IT IS NOT CRITICAL)
b) If I play full screen I loose the keyboard focus (FIXED)
c) I cant host games because of a port issue (FIXED BY USING THE GUIDE: http://en.war2.ru/support/warcraft-ii-hosting-latency-fix/)
d) Mouse even in the slowest speed is toooo fast for my taste (THIS WAS FIXED BY DISABLING THE TOUCHPAD)

To solve (b) I create a virtual screen using: xinit -- :1
This has the problem that this screen is under the user that it creates it and sound does not have permission.
To solve the sound problem you need to add your user to the audio driver and reboot.

sudo adduser $USERNAME$ audio

Every time before executing war2 you open a terminal and run: xinit -- :1
this gives you a console there execute a script like this (a slightly updated script version than the previous one):

#!/bin/bash

#Lets find and disable the touchpad:
ID=$(xinput list | sed -n 's/.*touchpad[[:blank:]]*id=\([0-9]\+\)[[:blank:]]*.*/\1/Ip')
xinput set-prop $ID "Device Enabled" 0

#Lets change our screen resolution to 640x480
xrandr -s 640x480

#Lets execute wine with war2combat
env WINEPREFIX="/home/$USERNAME$/.wine"
wine C:\\windows\\command\\start.exe /Unix /home/$USERNAME$/.wine/dosdevices/c:/users/Public/Start\ Menu/Programs/Warcraft\ 2\ Combat\ Edition/Activated\ War2Combat.lnk

Other tricks found:
War2Observer from showdog works under linux and my solution!
But in order to work you must execute it separately, before xinit -- :1

I do so from the terminal as a background call: wine .wine/drive_c/War2Combat/War2Observe.exe &
But you could also click on it.

I want to use the cpu savior from IL but all my efforts failed for now. Thus this is an added topic!
And unfortunately, the war2 insight is not working either thus no replays :-( for now.

Thanks for reading, for all your responses and for enduring me and some of my tests!

Cheerios
ps: If anyone needs more help to get war2 running over linux I'll be glad to give a hand!

Offline shesycompany

  • Death Knight
  • *********
  • Posts: 3587
  • retired, be in music section
    • View Profile
Re: War2 over Linux
« Reply #18 on: June 13, 2016, 05:17:02 AM »
well im fixing to go to ubuntutututu. thx man. or fedora gotta get prepared been awhile.
« Last Edit: June 13, 2016, 05:24:33 AM by easycompany »

Offline Igognito

  • Axe Thrower
  • ****
  • Posts: 406
    • View Profile
Re: War2 over Linux
« Reply #19 on: June 13, 2016, 07:48:51 AM »

Offline shesycompany

  • Death Knight
  • *********
  • Posts: 3587
  • retired, be in music section
    • View Profile
Re: War2 over Linux
« Reply #20 on: June 13, 2016, 08:56:32 AM »
kk thx

Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1650
    • View Profile
Re: War2 over Linux
« Reply #21 on: June 21, 2016, 05:55:11 AM »
After a night of Gaming I want to give some more feedback on the mentioned problems
Thanks a lot for great research!
Sorry, i disappeared from war2 for last several weeks (real life, no time for war2 at all), but i'll look into war2 over linux project later.
Need help to translate War2Combat to German, French, Italian, Polish or another language: http://forum.war2.ru/index.php/topic,4728.0.html
Please, contact me if you are interested in that.

Offline Igognito

  • Axe Thrower
  • ****
  • Posts: 406
    • View Profile
Re: War2 over Linux
« Reply #22 on: July 03, 2016, 05:37:35 AM »
I was away for a month too... And I will still be away. Holidays without internet! Today is an exception I will be online for a bit :-)

Offline Crash3r

  • Peon
  • **
  • Posts: 20
    • View Profile
Re: War2 over Linux
« Reply #23 on: September 06, 2016, 11:30:04 AM »
I'm also using Linux as my daily OS -- ElementaryOS (based on Ubuntu, but with Pantheon DE)

I have played War2 in Virtualbox (use scaled mode to get a stretched display that was almost fullscreen), and its playable, but the slight mouse lag really makes it only fun for a casual game.

I was looking for something more native, so I've also figured out how to run it on Wine, although a bit differently than Ingognito:

- Install wine (sudo apt-get install wine)
- Download War2 from en.war2.ru
- Run the EXE file and complete the installer
# If you stop here and try to play it, only non battle.net functions will work, and it will run in a small window instead of full screen
- Use Ingognito's war2.sh script to launch War2Combat (save it as war2.sh in Documents or whatever, dont forget to do 'chmod +x war2.sh' then launch by typing './war2.sh'

# If you use the shell script to launch War2, it will launch full screen and look good, but for me it crashes 7/10 times when connecting to battle.net. About 3/10 times it allows you to log in and then sometimes it will work fine, but other times it will crash if you try to look at a profile or join a game

To fix random crashing, I enabled Comparability Mode on all War2 EXE files for Windows XP:
- Open 'Configure Wine'
- Click Applications
- Click 'Add Application' button
- Add 'War2noCDloader.exe' and select 'Windows Version: Windows XP'
- Repeat for War2PLoader.exe, War2Patcher.exe, and Warcraft II BNE.exe

Now launch War2 with Ingognito's war2.sh

The game plays even better than on my Windows 7 PC, the only thing that is an issue is that Battle.net graphics dont display, but it is fully functional other than that - you can still chat and even view profiles, edit your profile, change channels, and create games. Creating games is a bit tricky without graphics (there is no checkbox displayed for Fixed order) so you have to click around blind and guess a bit but it works

The only major problem I have is that I cant get 'xinit -- :1' to work before launching war2.sh. It opens a fullscreen terminal (so it kills X), but then I cant interact with it at all

This must be an Elementary OS/Pantheon issue so I will ask them about it...

So what I do for now is just run the war2.sh without xinit -- :1, what happens is it uses my current desktop and resizes it to 640x480, and everything works fine until I'm done playing, but then the display is messed up.

So I fix the display with 'xrandr -s 1920x1080' but then all my applications are still messed up so I have to restart all of them (Albert, Conky, Plank)

I usually just end up rebooting, which kind of kills the point of the whole thing (might as well dualboot), but hopefully I can find a way around the display issues after the game ends

Offline Crash3r

  • Peon
  • **
  • Posts: 20
    • View Profile
Re: War2 over Linux
« Reply #24 on: September 06, 2016, 12:18:27 PM »
I have a workaround for my problem with the applications not adjusting back to 1920x1080 after playing War2, I wrote a script to restart the applications that have display issues, I call it 'unwar2.sh'

If anyone has the same problem, this script probably wont fix the your application display issues  (unless you only use the exact same applications as me), but use this as a guide to create your own script, just set the resolution back to your resolution, then kill the processes that have display issues and restart them

Code: [Select]
#!/bin/sh
xrandr -s 1920x1080
#Lets find and enable the touchpad:
ID=$(xinput list | sed -n 's/.*touchpad[[:blank:]]*id=\([0-9]\+\)[[:blank:]]*.*/\1/Ip')
xinput set-prop $ID "Device Enabled" 1
killall plank
killall conky
killall albert
cd "/home/$USERNAME$/.conky/Gotham"
conky -c "/home/$USERNAME$/.conky/Gotham/Gotham" &
cd "/home/$USERNAME$/.conky/Green Apple Desktop"
conky -c "/home/$USERNAME$/.conky/Green Apple Desktop/conky_seamod" &
albert &
« Last Edit: September 06, 2016, 12:28:36 PM by Crash3r »

Offline Crash3r

  • Peon
  • **
  • Posts: 20
    • View Profile
Re: War2 over Linux
« Reply #25 on: September 06, 2016, 04:01:47 PM »
Ok scratch all the startup/shutdown/war2.sh scripts

I finally got it working on PlayOnLinux, no extra commands necessary. And when launched it is full screen, when closed I am automatically restored to my native resolution with no broken applications still stuck in 640x400!

War2 is working 100% in game (better graphics than my Windows 7 PC, and audio is perfect too), just the minor annoyance of Battle.net graphics missing as discussed above (everything works -- chat, channels, commands, create game, but its black background in lobby until inside a game lobby)
Code: [Select]

 PlayOnLinux Install Instructions:

1. Download War2 from en.war2.ru
2. Get wine (sudo apt-get install wine)
3. Get PlayOnLinux (sudo apt-get install playonlinux)
4. Open PlayOnLinux
# You need to have Wine version 1.9.9 installed, to install it/check if installed, open PlayOnLinux and click Tools > Manage Wine Versions
5. Click 'Install a Program'
6. Click 'Install a non listed Program' (bottom left)

# Important:
7. During install, Click 'Use Another Version of Wine' and select version 1.9.9 (you might have to install this beforehand)

8. Next, next, next (create virtual drive and name it War2Drive, select 32bit install)
9. Browse for War2Combat-4.exe from Downloads, Install Warcraft2. During install I chose not to 'create desktop icon' just to keep wine desktop uncluttered

# Important:
10. For the shortcut, select 'War2Launcher.bat', and name it 'Warcraft II'

11. It will create the shortcut and then another shortcut creation screen will popup. Click cancel on that one

# At this point, the install is fully working

12. Change default icon to war2 icon -- Right click on the shortcut and select 'Set the icon'
13. Open the 'hicolor' folder > 32x32 > apps > 8742_Warcraft II BNE.0.png
Let me know if this works for you guys, I like it alot better than having to run the start and stop scripts, and its much more newb friendly for other players on Linux (Although probably not too many newbs use Linux, but its still easier anyway)
« Last Edit: September 06, 2016, 05:01:44 PM by Crash3r »

Offline Crash3r

  • Peon
  • **
  • Posts: 20
    • View Profile
Re: War2 over Linux
« Reply #26 on: September 09, 2016, 05:17:06 PM »
I also got Stealthbot installed on Linux/Ubuntu with Wine-1.9.18 + PlayOnLinux if anyone is interested just PM me. Maybe I will post instructions later, but I it was long process of trial and error and required some manual DLL loading

Basically -
Download Stealthbot 2.6r3 (2.7 doesnt work on WINE): http://www.elitegrounds.net/scBots.html
PlayOnLinux Config:
Install vb6run
install msxml6
Install Microsoft Core Fonts
use wine-1.9.18

Go here: http://www.stealthbot.net/forum/index.php?/topic/189-needed-files/

Download SSubTmr6.dll, BNCSutil.dll, and MSSCRIPT.OCX

Place BNCSutil.dll in program files/stealthbot dir
Place MSSCRIPT.OCX in System32 dir of PlayOnLinux stealthbot drive
Use PlayOnLinux to open a windows cmd prompt, and run regsvr32 SSubTmr6.dll to load that

Download Warcraft II: Battle.net Edition hash files from here: http://www.stealthbot.net/board/index.php?showtopic=34851

Place that W2BN dir in program files/stealthbot

Launch Stealthbot
Settings > Bot Settings >

Configuration > Enter your username, password, server (server.war2.ru), cdkey doesnt matter but is required so enter '123123123123', Home: WAR2BNE, Product: Warcraft II BNE

Advanced > Connection Method: ADVANCED - Local hashing

Hit 'Apply and Close'

Now Connect

Optional:
Create desktop icon (look at other shortcuts for config example) -- /usr/share/applications/stealthbot.desktop
Desktop Icon Pic: http://www.deviantart.com/art/Stealthbot-dock-icon-114102201 (must resize to 32x32)

Offline Crash3r

  • Peon
  • **
  • Posts: 20
    • View Profile
Re: War2 over Linux
« Reply #27 on: September 09, 2016, 05:23:36 PM »
Also, I started having some display again issues after closing War2, only with 2 applications -- tint2, and albert. They wouldnt restore back to the 1920x1080 resolution.

So I wrote a quick bash script to launch warcraft 2, then check every 1s to see if it is still running. When it closes, the script will restart those two programs which fixes their display issues

Code: [Select]
#!/bin/bash
/usr/share/playonlinux/playonlinux --run "Activated War2Combat" %F
pid=`ps -elf | grep 'warcraft ii bne.exe' | grep -v grep | awk '{print $4}'`
echo $pid
while ps -p $pid >/dev/null
do
    echo "."
    sleep 1
done
killall tint2
killall albert
tint2 &
albert &

Offline shesycompany

  • Death Knight
  • *********
  • Posts: 3587
  • retired, be in music section
    • View Profile
Re: War2 over Linux
« Reply #28 on: September 09, 2016, 05:25:53 PM »
igognito is usually playing gow ef if u need him.nice work man!

Offline Igognito

  • Axe Thrower
  • ****
  • Posts: 406
    • View Profile
Re: War2 over Linux
« Reply #29 on: September 18, 2016, 09:19:04 AM »
Hi all, and hi Crash!

happy to see that my efforts helped a bit :-)

I tried running my script without xinit and while war2 works it really messes up the desktop. As a result I kept using xinit.

did you tried xinit with different desktop identifier?

xinit -- :10 for example. It is possible that 1 is reserved in your distribution...
furthermore, when you run xinit you might need to move around your mouse to get focus!

Lately, I have tried a few other stuff and here are the results:

Non functional: War2Video, War2Insight, cpusavier 1-2.
Fully functional: War2Observer

War2Video I need to run more tests but in general it blocks the wine desktop.
War2Insight crashes the game when it starts (yes I got it to start recording)

cpusavier 1-2 cause a memory dump of the wine desktop
@Il: do you still develop this? perhaps if I somehow get to record the messages you might be able to fix it! I believe it could be  a "security" issue.

Finally, War2Observer works but you need to be a bit tricky to execute properly
I do the following:

I made a war2.bat:

start War2Observer.exe
start War2PLoader.exe

and modified my script to do:

wine C:\\windows\\command\\start.exe /Unix /home/theo/.wine/dosdevices/c:/War2Combat/war2.bat

anyother way I tried it would end up crash my pc (sometimes)
Still I believe that observer increases the chance of getting a crash (lets say from 1% to 5%) but that is something I can leave with :-)

I never managed to work it with playonlinux I always had a keyboard focus problem. But I think the trick is: Wine version 1.9.9
I currently use wine 1.6.2

When I have sometime and mood to mess up with a pc I will try wine 1.9.9
It is possible that you do not actually need playonlinux just that wine version and then it might play out of the box!
Crash, you should though send a message to playonlinux that War2Combat plays best with wine 1.9.9 and give them your install guide. They will automate it for future users :-)

Cheers all