Warcraft II Forum

Warcraft II => Mods & Development => Topic started by: Igognito on May 12, 2016, 09:29:37 PM

Title: War2 over Linux
Post by: Igognito on May 12, 2016, 09:29:37 PM
Hi all,

for better or worst I'm using Linux. Currently I run war2 using Wine but I would like to see a native version...

Why? Because I have several problems:
First of all, if I play only single player the game is ok. I also assume if go non enhanced multiplayer it should be fine.
The moment I go to Enhanced multiplayer all hell breaks loose!
a) The graphics of battlenet enviroment are non visible
b) If I play full screen I loose the keyboard focus
c) I cant host games because of a port issue (perhaps this can be bypassed)
d) Mouse even in the slowest speed is toooo fast for my taste (this perhaps can be fixed with a linux system command)

Anyhow, I would be willing to help in order to make a linux version! Or create an extensive guide of how to make War2 play properly under linux.

Thus I'm starting this post...
First question, do you have the source code? if so, perhaps we could try to compile under linux! That would be the ideal solution.
Second question, anyone else uses linux? Do the same issues arise?
Third question, who is willing to help me for this!

Thats for now!
ps: Thank you for the great job of reviving War2! You reminded me the great times I had when I was younger!
ps2: Slowly, I will do my best to get involved with the development.
Title: Re: War2 over Linux
Post by: easycompany on May 12, 2016, 10:31:03 PM
i used fedora but i vm'ed a win2000 custom i had. idk man someone just now got it to play on win10 lol.
you would def want to look at sc1 progress at its the same as war2.

there something called playonlinux a custom wine.

ive used aqrits ddraw to fix broodwar on win7.

oracle vm make ya a custom windows of your choice xp and under ull be ok.

something like that if noone comes along :P gone back to jam and drink!
Title: Re: War2 over Linux
Post by: EviL~Ryu on May 13, 2016, 12:06:52 AM
Didn't like wine and war2 when I tried it on Mac, online play was impossible because of lagged graphics.


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 over Linux
Post by: iL on May 13, 2016, 11:15:44 AM
Hi, Igognito!

a) The graphics of battlenet enviroment are non visible
b) If I play full screen I loose the keyboard focus

Try graphics fix by aqrit. I never tried it on linux because i have no working desktop on linux, but that's quite possible it works fine.
http://forum.war2.ru/index.php/topic,1790.0.html (http://forum.war2.ru/index.php/topic,1790.0.html)
Try test4 (should be slow, but good with graphics). Or minimal (should be faster, but could cause crash or w/e).
Your report about ddraw fix under wine would be highly appreciated.

c) I cant host games because of a port issue (perhaps this can be bypassed)

You should forward your 6112 tcp/udp ports from your gateway to your wine to let war2 receive incoming packets incoming to your internet connection. There's no guides about that, i hope you're quite experienced linux-user to do that yourself...

d) Mouse even in the slowest speed is toooo fast for my taste (this perhaps can be fixed with a linux system command)

No ideas, should be configured somewhere in wine i hope...

Anyhow, I would be willing to help in order to make a linux version! Or create an extensive guide of how to make War2 play properly under linux.

Creating an extensive guide would be great!
If you resolve that problems with linux and make guide, we would be happy to publish it on en.war2.ru and here on the forum also.

First question, do you have the source code?

Nobody has the source code for war2. That is a very big problem, but here's our world...
Another community still tries to release wargus (opensource clone for war2), but wargus is kinda kids' toy comparing with war2.
And virtualization (i mean wine) reached sufficient progress for last years.
I think the future for war2 over linux is wine.

Second question, anyone else uses linux? Do the same issues arise?

One or two persons tried war2 under wine several years ago with similar problems (with graphics). Now we have aqrit's ddraw wrapper developed for war2 specially. I hope it should resolve the problem. At least ddraw is open-source, so can be updated for wine. I think it should be really possible to run war2 on linux.

Third question, who is willing to help me for this!

I feel war2 on linux would be important project. I have no time for such experiments, but i can try to test/help your with your project.

ps: Thank you for the great job of reviving War2! You reminded me the great times I had when I was younger!
ps2: Slowly, I will do my best to get involved with the development.

Well, let that be your project for war2 on linux. You lead it, i just try to help with my experience as i can.
ps: Which linux distribution/wm would you recommend me to install for tests? My test hardware is about 5-10 years old (amd core 2 duo, 2x3000Mhz).
Title: Re: War2 over Linux
Post by: Igognito on May 13, 2016, 05:22:25 PM
That is great!
Thank you guys for the thumbs up, quick responses and info.

This weekend I'm busy with finishing a paper but next week I will devote sometime to get you some more feedback!

Quest Accepted: I will collect a guide with all  the details of how to make it work perfectly over linux.

I use Ubuntu, but by my experience if you get to work it on one the transition to the next linux is easy. Thus after I fix the problems on Ubuntu I will be happy to have requests for other distributions.
The main issue is fixing that damn keyboard focus that doesn't allow me to play on full screen.

Cheerios!
Title: Re: War2 over Linux
Post by: easycompany on May 13, 2016, 05:25:24 PM
Great man ! I have a reactos I was gonna try and see if I could do like a .pal to change war2s colors so its atleast more playable. react cant run aqrits.idk who would use it anyhow.
Title: Re: War2 over Linux
Post by: tupac on May 14, 2016, 11:14:11 AM
You can disable the firewall:

sudo ufw disable
sudo ufw enable

You could also use iptables to open port 6112 on your interface:

"Ifconfig" to see your interface. (eth0)

iptables -A INPUT -i eth0 -p all –dport 6112 -j ACCEPT
iptables -A OUTPUT -i eth0 -p all –dport 6112 -j ACCEPT

I think easycompany said the new color fix was still broken. But would be good to hear your results.
Title: Re: War2 over Linux
Post by: easycompany on May 14, 2016, 12:05:31 PM
no lol to ReactOs, ya i did type that drinking :P. well gone from this thread.. glhf!
Title: Re: War2 over Linux
Post by: Igognito on June 02, 2016, 12:44:20 PM
Hi all again,

I have been very busy lately so I haven't yet tried all suggestions. But I did try some stuff:

i) graphics fix by aqrit
this didn't work :-( It also made the game slower to launch!
ii) Wine doesn't really have directx but uses a lame emulator. I tried to install directx to wine but it got really complicated. In other words even if this would solve the problem it does not worth the effort.

I also tried with Starcraft and there I managed to get 1 game to run properly over Battle.net but I never managed to get a 2nd :-(
Thus the problem is for both games and it is similar!

I tried also some other small stuff with no success. (Wine Setting and Wine window management)

I'm still on it and I will keep you informed.

ps: For now I have not tried anything about the ports as the  EF_Host bot solves the problem ;-)
Title: Re: War2 over Linux
Post by: tupac on June 02, 2016, 01:45:15 PM
Hi all again,

I have been very busy lately so I haven't yet tried all suggestions. But I did try some stuff:

i) graphics fix by aqrit
this didn't work :-( It also made the game slower to launch!
ii) Wine doesn't really have directx but uses a lame emulator. I tried to install directx to wine but it got really complicated. In other words even if this would solve the problem it does not worth the effort.

I also tried with Starcraft and there I managed to get 1 game to run properly over Battle.net but I never managed to get a 2nd :-(
Thus the problem is for both games and it is similar!

I tried also some other small stuff with no success. (Wine Setting and Wine window management)

I'm still on it and I will keep you informed.

ps: For now I have not tried anything about the ports as the  EF_Host bot solves the problem ;-)
There are many versions for the newest color fix. Was the battle.net interface still messed up? I'll will try to install war2 on a Debian system.
Title: Re: War2 over Linux
Post by: easycompany on June 03, 2016, 02:28:49 PM
try play on linux it has warcraftbne supported
https://www.playonlinux.com/en/supported_apps-1-0.html (https://www.playonlinux.com/en/supported_apps-1-0.html)

downloads
https://www.playonlinux.com/en/download.html (https://www.playonlinux.com/en/download.html)

https://www.playonlinux.com/en/ (https://www.playonlinux.com/en/) main page
Title: Re: War2 over Linux
Post by: Igognito on June 09, 2016, 01:30:33 PM
I have already tried that :-(
Wine and Play on Linux function fine as long as you do not connect to battle.net!
I can have perfect LAN games or perfect single player games. The moment I go to Battle.net the problems start.

I'm sure I will find a solution eventually, especially now that I found out that starcraft has the same problem. I'm sure there is a guide to fix it :-) for starcraft as it is more popular :-(

Cheers
Title: Re: War2 over Linux
Post by: tupac on June 09, 2016, 04:12:31 PM
I have already tried that :-(
Wine and Play on Linux function fine as long as you do not connect to battle.net!
I can have perfect LAN games or perfect single player games. The moment I go to Battle.net the problems start.

I'm sure I will find a solution eventually, especially now that I found out that starcraft has the same problem. I'm sure there is a guide to fix it :-) for starcraft as it is more popular :-(

Cheers
You can follow the wine community and see its been the same way for years now. Maybe one day someone will fix it.
Title: Re: War2 over Linux
Post by: Igognito on June 09, 2016, 07:10:57 PM
Great News!!!!

I have solved the most important problem for now! (Indeed by searching for Starcraft!)

Keyboard focus: SOLVED
Solution is pretty complicated though:

Everywhere you need to replace: $USERNAME$ with your username :-P

First we need a shell command that will setup and execute war2:

war2.sh

xinput set-prop 10 "Device Enabled" 0 # This disables my touchpad because I'm on a laptop
xrandr -s 640x480 # This is important you will need to set the screen resolution to 640x480 (do not worry this is temporary only for this script)

# The following are needed for WINE
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


STEP 2:

You need to add your user to the audio driver!

sudo adduser $USERNAME$ audio

and restart your pc

STEP 3:

Create a War2 Screen

open a terminal and type:
xinit -- :1

that will give you a new screen where we will run war2

now you execute your script!

This solution works for multiple games!
Title: Re: War2 over Linux
Post by: easycompany on June 09, 2016, 07:31:20 PM
gj! 8)
Title: Re: War2 over Linux
Post by: tupac 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 ;(
Title: Re: War2 over Linux
Post by: easycompany on June 09, 2016, 10:22:36 PM
just vm used to in linux
Title: Re: War2 over Linux
Post by: Igognito 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/ (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!
Title: Re: War2 over Linux
Post by: easycompany on June 13, 2016, 05:17:02 AM
well im fixing to go to ubuntutututu. thx man. or fedora gotta get prepared been awhile.
Title: Re: War2 over Linux
Post by: Igognito on June 13, 2016, 07:48:51 AM
You might or might not need to also do this

http://karuppuswamy.com/wordpress/2010/09/26/how-to-fix-x-user-not-authorized-to-run-the-x-server-aborting/ (http://karuppuswamy.com/wordpress/2010/09/26/how-to-fix-x-user-not-authorized-to-run-the-x-server-aborting/)
Title: Re: War2 over Linux
Post by: easycompany on June 13, 2016, 08:56:32 AM
kk thx
Title: Re: War2 over Linux
Post by: iL 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.
Title: Re: War2 over Linux
Post by: Igognito 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 :-)
Title: Re: War2 over Linux
Post by: Crash3r 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
Title: Re: War2 over Linux
Post by: Crash3r 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 &
Title: Re: War2 over Linux
Post by: Crash3r 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)
Title: Re: War2 over Linux
Post by: Crash3r 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 (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/ (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 (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 (http://www.deviantart.com/art/Stealthbot-dock-icon-114102201) (must resize to 32x32)
Title: Re: War2 over Linux
Post by: Crash3r 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 &
Title: Re: War2 over Linux
Post by: easycompany on September 09, 2016, 05:25:53 PM
igognito is usually playing gow ef if u need him.nice work man!
Title: Re: War2 over Linux
Post by: Igognito 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

Title: Re: War2 over Linux
Post by: iL on September 19, 2016, 06:37:40 AM
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.
Well, not a high priority task, but yes, i think i can look into it, especially for ver 1.
I also going to continue on win 8-10, so i hope to fix bugs for these windows. I think would be better to rewrite savior. I don't like it's current code.

Also i don't trust that's not possible to make insight and warvideo to work, i hope need to make some additional config things to start it. These things worked find for all windows for years, so should be a way to run then on wine also.
I still had no time to test linux as i promised, i'll try it soon...
Title: Re: War2 over Linux
Post by: Igognito on September 20, 2016, 04:41:41 PM
Well, not a high priority task, but yes, i think i can look into it, especially for ver 1.
I also going to continue on win 8-10, so i hope to fix bugs for these windows. I think would be better to rewrite savior. I don't like it's current code.

Great, I will try to get you the dump. It is not a really urgent issue but it would be nice to stop having the fan working every now and then :-P

Also i don't trust that's not possible to make insight and warvideo to work, i hope need to make some additional config things to start it. These things worked find for all windows for years, so should be a way to run then on wine also.
I still had no time to test linux as i promised, i'll try it soon...

About warvideo and insight. There are several issues to consider that makes it hard to use them. First, that you need to return to your desktop in order to start them. Second, well I got to start insight but it simply crashed :-( I will try again.

There is another program called hypervideo I think. I had a brief look at it. This could work but I'm afraid it lags badly the game.
I will do more tests when I have the time and keep you informed.

I think in the end we should be able to compile a decent guide even for new linux users.

Cheers
Title: Re: War2 over Linux
Post by: Crash3r on September 21, 2016, 01:23:06 PM
I've been playing alot of Warcraft since my last post and its working great.

Only problems, as you know, is black screens in chat and stuff but fully functional and perfect in game.

Only glitch I have found since last post is losing keyboard focus after 1st game (only happens sometimes I think), but I can fix it by quickly switching workspaces and then switching back (SUPER + right arrow, SUPER + left arrow)

So because I have that quick workaround, I havent even spent anytime trying to fix it yet but maybe Ill get around to it.

I really want to get War2Video working or an alternative, but havent spent any time yet. Ill let you know what I find.
Also on my todo list is the Map Editor, if I can get those 2 to work thatd be awesome

By the way, I didnt use the PlayOnLinux War2 installer, I set it up custom settings. You should checkout PlayOnLinux because i think of it like a virtual machine manager for Wine installs. It allows you to run multiple versions of Wine and assign them to different programs easily. Also you can use it to manage the wine instances which each have their own 'drives', + their own libraries installed
Title: Re: War2 over Linux
Post by: Igognito on September 22, 2016, 07:17:49 PM
I tried the editor at some point. It gave me some problems but I do not remember the details.
It was not important for me as I also have 1 win machine where I could use the editor if I wanted.

The keyboard focus problem I only solved it by using xinit (that is the main reason I use it)
I hadn't tried your key combinations but it was so annoying that I prefer my solution.

Lately, I'm getting more crashes I think it must be the observer :-(

About PlayOnLinux. I have used it. It is not for me though... I like wine simple :-P (well with wine tricks but that is a detail)

Keep playing, I hope to find you online and we have a game together. Together with Disgruntled we 3 use linux to play :-)
Title: Re: War2 over Linux
Post by: Wretcher on September 27, 2016, 07:09:54 PM
I got WarVid working on Linux/Ubuntu --- it required mfc42 library (winetricks)

I also got Map Editor working, it just worked on whatever winetricks I already had installed for Warcraft2.

It just lags a bit tho, the mini-map displays the map perfectly, but when you move it to look at a new area it takes about 2seconds for the window to refresh which is weird but useable, like you said, if you are serious about map editing you can run a Windows VM
Title: Re: War2 over Linux
Post by: Igognito on September 28, 2016, 09:48:30 AM
I will try again... I tried it and added the library you mention. But that was not enough. The problem for me arises that I cant safely alt-tab among windows applications. If I can somehow start warvid recording without alt-tab then it should work!
Title: Re: War2 over Linux
Post by: Wretcher on September 28, 2016, 10:18:14 AM
I'm unable to get back to the desktop at all while running War2 - here's how I do it

I open War2 in its own workspace, then I SUPER + RIGHT to get to the next workspace, then I use that workspace to open whatever program I want to be able to access while playing Warcraft (spotify, warvid, etc) then SUPER + LEFT to get back to war2

It works

Only one problem I have noticed with Warvid is that once I go back to Warvid to clear/save a recording and start a new one (with War2 still running in the other workspace), all of the buttons on Warvid are hidden the menu is all black

But the buttons are still there and they all reappear when you click one of them

So just memorize where the Start/Stop recording button is (bottom right) then hit where it should be. The recording will stop and then the buttons to save/clear will reappear. So I save it and then press record again and switch back to the War2 workspace

Lol the shit we have to put up with to play on Linux. I'm still just totally stoked I dont have to play inside a VM anymore tho, no mouse lag! And in game is actually even better than when I played on Win7
Title: Re: War2 over Linux
Post by: Disgruntled on September 28, 2016, 11:49:20 AM
Also the user jos is playing on a linux machine.

never tried to get warvid running... Will give it a go this week and report back

My bug question at the moment is regarding 100% cpu usage
Has anyone found a fix.  I scale the cpus to 75% with an applet...

Has anyone had luck with the cpulimit command... Ir are we all suffering with high temps and cpu usage?


Also ive been using wine-staging for a lot less crashing

Cpuscaling applet im using (bios quiet and cool i think meeds to be on)
http://www.webupd8.org/2010/12/cpu-frequency-scaling-appindicator.html?m=1 (http://www.webupd8.org/2010/12/cpu-frequency-scaling-appindicator.html?m=1)
There a command line interface that can make this change too but the gui is easy for me

Info on winestaging... Its the development version so ot may mot be as stable but im finding it works well.  Can be installed side by side or as complete replacement for wine.
Use at own risk!!! If things are working well without it i wouldn't mess with it
http://wine-staging.com/ (http://wine-staging.com/)
Fixed a lot of crashes for me but inteoduced an issue with focus where i need to alt tab out and in to get text imput focus (ie type in password)

Also i think its worth noting the performance is majorly effected by using the right graphics driver (restricted drivers settings).  I assume the people using wine regularly know this but new players may not realize this is so important
Title: Re: War2 over Linux
Post by: Igognito on September 28, 2016, 12:19:42 PM
I tried the cpu util but it crashes war2 the moment it launches.
I believe it could be a security issue. (As from my understanding the utility modifies the protected memory of war2)

Perhaps trying it with elevated right might allow it to work.

how do you get to scale the cpu to 75?

Also what is the wine-staging, could you give a guide for using those?

Thanks
Title: Re: War2 over Linux
Post by: Disgruntled on September 28, 2016, 12:39:38 PM
Can confirm neither version of cpusavior works for me either (elevated priv.  Or not) Appreciate IL and a possible rewrite attempt sometime down the line :)
Title: Re: War2 over Linux
Post by: Disgruntled on September 28, 2016, 12:48:00 PM
Also i think if we could say hey: heres a game you can play on linux,  here are some easy directions.  Posted to the correct places we could see an small influx of new players looking for a game that works well and is nostalgic. Even just us writing here may help

Also there seems to be more documentation on diablo 2 and starcraft 2... Often the problems we are having have been solved by those guys
Title: Re: War2 over Linux
Post by: Igognito on November 18, 2016, 12:45:57 PM
Hi all,

recently I had a new problem with war2 over linux!
After getting a few units everything was getting slow! It wasn't lag it was just sluggish!

I mentioned it to Disgruntled and he said that it is the graphics card and that I need to install the proprietary drivers of nvidia.

So I went to check and !!! guess what, I had the drivers installed.
I was out of ideas but I decided to check if it happens in single player too.
And the problem appeared there too.
After exiting war2 by accident I noticed that wine was giving me an error message about 32bit and opengl.

I go what???? I have opengl and the drivers work fine (or at least report it works fine)
Then I did what every computer scientist should do when he gets a problem that makes no sense! Reinstall :-D

So now that I shared my pain let me give you an explanation.

It appears that the NVIDIA drivers or opengl got an update! But the link among the two was not recompiled... As a result even if everything was reported fine the two where not working.
Solution: Deactivate driver->reboot->Reactivate driver->reboot

Also useful to know that war2 requires the propitiatory drivers to play smoothly.

To linux players:
Major tasks pending:
 (1) Getting a recording app to consistently work.
 (2) Getting the cpu 100% problem handled.
 (3) Create a war2 package for distribution?

does anyone ever done something similar with (3)?
It would be cool if users could go to the software center and get even just a link to en.linux.war2.ru with a nice step by step description of how to install war2!

That will certainly get us some people trying it out!

Cheers
Title: Re: War2 over Linux
Post by: Igognito on December 12, 2016, 02:40:24 PM
Hello all!

I believe I managed to fix one more problem!
the colors inside the battle.net menu. Which are important mainly for hosting easier games :-)

We need the following stuff:
This ddraw.dll is able to fix the Battle.net menus correctly on Windows.
http://www.bitpatch.com/downloads/war2_ddraw_test4.zip (http://www.bitpatch.com/downloads/war2_ddraw_test4.zip)
And here is the source code: https://github.com/aqrit/war2_ddraw/ (https://github.com/aqrit/war2_ddraw/)

I think that also iL had mentioned it. But the trick to make it work was there:
https://www.winehq.org/docs/wineusr-guide/config-wine-main (https://www.winehq.org/docs/wineusr-guide/config-wine-main)

You need to overidde the dll the procedure is described on the above guide.
I will make an upgraded post of the total guide one of these days!

Cheers

ps: I will also try this: http://hifi.iki.fi/cnc-ddraw/ (http://hifi.iki.fi/cnc-ddraw/)
Title: Re: War2 over Linux
Post by: iL on December 15, 2016, 07:27:56 AM
Great job, Igognito!
Sorry, i promised to check that on my linux desktop, but i still have no time for that.
Nice to see the project war2 over linux is alive!

I hope to release a new version of combat, to make it compatible with as many systems as possible. Appreciate your part with linux compatibility.
I still didn't have time to config any kind of working linux desktop+wine to try war2, nice to see you do it yourself successfully!

When i read something like your posts, i want to go into that and do something immediately. That is really interesting for me. But then i return to my real life and see i have many other high-priority and interesting projects. Sad there's so many interesting projects and so few time for them in my life...
Title: Re: War2 over Linux
Post by: iL on December 15, 2016, 07:42:28 AM
Can confirm neither version of cpusavior works for me either (elevated priv.  Or not) Appreciate IL and a possible rewrite attempt sometime down the line :)
Savior uses hardcoded addresses in process memory. These addresses are the same for all windows xp&7 (most likely), but i'm not sure if they are declared the same on any system.
I have no knowledge about memory management, i just tried and that worked for win xp and win 7.

I have no idea how to find proper addresses under wine. Maybe some kind of debugger same as for windows?
I think need to get the addresses from some kind of process table instead of hardcoded ones as in my code.
Savior is opensource, so anyone can try that.

You need to overidde the dll the procedure is described on the above guide.
I will make an upgraded post of the total guide one of these days!
Just to copy proper ddraw.dll to war2combat directory, same as in windows?
From your link:
Quote
DLLs usually get loaded in the following order:

    The directory the program was started from.

    The current directory.

    The Windows system directory.

    The Windows directory.

    The PATH variable directories.
You can also contact aqrit, he is a great developer in all these ddraw things, maybe he will be interested in making his code compatible with wine also.
Title: Re: War2 over Linux
Post by: Igognito on December 15, 2016, 08:31:12 AM
I have started making a more friendly guide.
It will be a few page pdf with images etc...

It will include many tips and solutions to problems I encountered.

Hopefully, I will get it finished this weekend.
War2 Linux Guide v1 :-D

To use ddraw.dll you need to define an override for wine. I will present how in my guide.

Savior is open source? Give me the link, I will have a look and see if I can get it to work under linux.
I never did any invasive programming but I'm fast to learn stuff like that :-P

Cheers

ps: Also ddraw.dll needs to be more efficient. I should get a profiler for wine and see what mess up its performance on the users box. Is Aqrit active in the forum?
Title: Re: War2 over Linux
Post by: iL on December 15, 2016, 09:21:56 AM
ps: Also ddraw.dll needs to be more efficient. I should get a profiler for wine and see what mess up its performance on the users box. Is Aqrit active in the forum?

Not sure if he is active now, but i think yes. He answered quickly every time i PM'ed or emailed him: http://forum.war2.ru/index.php?action=profile;u=563 (http://forum.war2.ru/index.php?action=profile;u=563)
Not sure it's possible to make ddraw more efficient, here's the thread: http://forum.war2.ru/index.php/topic,1790.0.html (http://forum.war2.ru/index.php/topic,1790.0.html)

Savior is open source? Give me the link, I will have a look and see if I can get it to work under linux.
I never did any invasive programming but I'm fast to learn stuff like that :-P

This: http://forum.war2.ru/index.php/topic,2093.0.html (http://forum.war2.ru/index.php/topic,2093.0.html)

I have started making a more friendly guide.
It will be a few page pdf with images etc...

It will include many tips and solutions to problems I encountered.

Hopefully, I will get it finished this weekend.
War2 Linux Guide v1 :-D

To use ddraw.dll you need to define an override for wine. I will present how in my guide.

Would be great! I'll try to install/config war2 with your guide and think how to optimize the process.
Title: Re: War2 over Linux
Post by: Igognito on December 15, 2016, 12:30:27 PM
And another breakthrough!!!

I managed to get warvid working by using:
taskset -c 0 wine program_name.exe
to run war2
and to run warvid!

This will be included to the guide!!!!

The command sets the affinity to 0!
Probably also insight will work in the same way!

unfortunately that trick didn't work for cpusavior.

Which almost remains the last task for a 100% functional war2combat under linux!!!!
Title: Re: War2 over Linux
Post by: Igognito on December 20, 2016, 02:30:33 PM
Hello all!

I have made a pdf version of the guide.
https://www.dropbox.com/s/ihsl1qsdekhiwhw/War%202%20Guide.pdf?dl=0 (https://www.dropbox.com/s/ihsl1qsdekhiwhw/War%202%20Guide.pdf?dl=0)

Tasks pending:
(1) cpu_savior or a similar utility
(2) Create a linux war2 package for distribution in Ubuntu Software Center? Or perhaps only add a link to the en.war2.ru with nice images.
(3) Start with other distributions

Cheers all