Wow, that's more feedback than I had expected :D
I'll try to answer the questions (although I'm not at home at the moment, so config files will have to wait). Also, as with most things, your mileage may vary, and you may have to fiddle a bit to find the right way for you. However it's not too tricky, and my post was primarily intended as an encouragement to give it a shot. I'll try to be a bit more verbose than neccessary, so it can serve also other people in the future. Maybe others who also got it to work can also chip in, and we can stick this in the HowTo section on TL?
BW under WINE - Mini-HowTo
Contents:- Graphics drivers and hardware acceleration
- SC & Virtual Machines
- SC & Windows API Emulation
- Configuring WINE
- Making & mounting an image of your BW CD
- Required fonts for bnet
- WINE Registry tweaks (speedup)
- xorg.conf tweaks (speedup)
- Running SC/WINE on a seperate display
- Resolving mouse selection lag
- Hamachi on Linux
- BWChart under Wine
- ICCup Launcher under Wine
Ok, so here's what I did. Currently I am running Debian Lenny with Kernel 2.6.22, but distro should have little or no effect on this, and as far as I'm aware any 2.6 kernel should do. If in doubt, ask the wine maintainers who are also hanging out here (hint hint). I have an NVidia GeForce FX 5200Go in my (old) laptop, so first I installed the appropriate drivers for that. Whether you have an NVidia or ATI card shouldnt matter, simply google around and find an appropriate how-to to install the appropriate driver with 3D acceleration. Instructions may vary depending on your distro, but there are many tutorials on the web. Verify you have your drivers set up correctly by runnning glxinfo orglxinfo | grep render it should say 'Direct Rendering: Yes'. If not, try to fix that first. Another check is to run glxgears and look at what FPS you get. Depending on your CPU, if it's software rendering you ought to get an FPS or the order of magnitude of 100's, with hardware rendering (what you want) it should be in the 1000's. Also if you have an NVidia card, you should see the NVidia logo when the Xserver is started (eg after boot).
SC and virtual machines Now as I said previously, there's 2 principal ways to run SC under Linux, one being emulation through wine/cedega/crossover, the other being virtualisation. Virtualisation may in principle be the way to go, but as I said VirtualBox whilst great and free (praise and discussion maybe in another thread), doesnt support 8bit colour depth (as of v1.5.2), so no SC on that. It's supposed to work under VMWare, but I havent tried this myself. If you have VMWare set up already, maybe give it a shot and let us know. WRT Xen I havent invested enough time to say anything much about it (comments appreciated).
SC and Windows API emulation Now Emulation: SC/BW is supposed to work with wine as well as its derivatives (cedega, xover). Wine is free so I went with that, but if you plan on playing many games and would like to have some support, Cedega may be the way to go (doesnt cost much). Sidenote: If you're too stingy to spend $15 on Cedega, you can also build it yourself from CVS, but that'll take a bit longer than just a few min, be warned.
Ok, so I decided to go with Wine. My successful attempt was with Wine 0.9.47, but other versions may work as well. If your distro doesnt have it in its own repositories (yet), the Wine guys also maintain packages for all major distros over on their website. After installing Wine, the fiddling begins. Over on WineHQ there are many posts with things to try, so if things dont work, go look there. Most notably here and here. There's a lot of good advice there, but you may have to dig a bit deeper through all the posts and the replies to them at the bottom. I'll try to summarize the key things:
Configure Wine: run winecfg autodetect drives, and make sure your CDROM drive is set to 'cdrom' (advanced settings). You might also want to pick one of the older Windows versions to be emulated (like 9x, XP), although I'm not sure if it makes a difference. If you run into trouble with the CD not being found later or with other apps on wine, check that any auto-mounting on your system doesnt change mount points and wine doesnt know where to look. Also if you changed drive letters you may have to update the registry, instructions are on the wine website. Anyways, if you like SC/BW you probably want to make an image of your BW CD and mount that instead in the future instead of the CD. (I havent played with BWLauncher yet, maybe someone has experience...?).
BW without the CD As of BW 1.15.2, making an image of the CD to play without it is no longer necessary, as you can copy the INSTALL.EXE files of the SC/BW CDs to your StarCraft directory and rename them StarCraft.mpq and BroodWar.mpq respectively. If you are low on HDD space you can also hunt around the web for a stripped down version of the install.exe files (w/o cinematics). The old instructions how to make an image are here: + Show Spoiler +***** Optional:To make an image of your Broodwar disc, first find out the device node of your CDROM drive. If you dont know, pop in the CD, mount it (or let automount/HAL/hotplug/etc take care of it), then run mount Find the /dev/whatever entry that corresponds to the mounted CD (probably something like /dev/cdrom or /dev/cd or /dev/sr0 etc ...). Then to make an image run dd if=/dev/yourcdnode of=/path/to/where/you/want/the/iso/broodwar.iso If it doesnt work for you, unmount the CD before running dd. Then to mount the iso to install or play SC run mount -o loop -t iso9660 /path/to/broodwar.iso /mount/point/of/cdrom . Of course you don't want to have anything mounted at this point already, and, if you have installed SC previously already, you either want to mount the iso to the mount point from which it was installed, or set up the new mount point in wine as a CD drive (using winecfg) and change the path to the SC CD in the Windope Registry (using regedit) - instructions are on the Wine Website. *****
Ok, now install SC with wine setup.exe then BW (also using setup.exe), then apply the latest patch manually after downloading it from http://www.battle.net. If you have SC already installed on a windows partition on your system, you dont need to reinstall it, but can run it from there.
Ok, time to run SC. If you have a fancy DE, you can probably run it from your start menue, otherwise wine StarCraft.exe will do. Out of the box, everything should work (except for the bnet chat area, which looks a bit bad), but likely gameplay will be a tad choppy. To speed things up many people recommend to increase priority for SC by starting it with nice -20 wine StarCraft.exe Give it a try, but in my case it didnt help.
Now the tweaks:
Font issues especially on bnet there may be problems with font rendering, and installing msttcorefonts will likely help the issue. There are some notes about changing the fonts included in the File section of xorg.conf to make a difference, but I couldnt verify that for my system.
Registry keys there are a bunch of registry keys you can add that can drastically improve performance, this will likely require correct configuration of your graphics drivers beforehand (see above). More info on these can be found over at winehq, my feeling is that these keys really are key, but the solution seems to be different for everyone, so you will have to try different combinations and see what you get. Anyways, run regedit to edit Wine's registry. There is an incomplete list of regkeys on the Wine WIKI. Note that there are two ways of adding them, either to HKEY_CURRENT_USER, which then applies to every program, or to HKEY_USER after making an application subdirectory, if you want the settings only to be applied for a particular application (b/c of conflicts with other apps). I'll go for the simpler way and added HKEY_CURRENT_USER (a.k.a HKCU) | +-Software | +-Wine | +-Direct3D | | | +->DirectDrawRenderer | | dri | | also possible: opengl, gdi, glsl | | | +->RenderTargetLockMode | | readtex | | | +->PixelShaderMode | | enabled | | | +->VertexShaderMode | | hardware I think you should try the only the 2 keys DirectDrawRenderer = opengl and RenderTargetLockMode = readtex first and see what you get. If you get a black screen (but SC runs as sounds/menues work), try adding the other two keys. If things still don't work, try different options of DirectDrawRenderer ie dri or gdi or glsl in combination with and without the last two keys. In my case dri was the successful key, but for many it is opengl. I'll try to post a screenshot later.
I should also mention that the first time I attempted to use these registry keys, I was not successful. Although for some ppl it works, in my case, depending on the key combination, SC either crashed, ran fast but with a black screen (doh), or was horribly unstable, or horribly slow. I then went on to tweak my xorg.conf file. Make a backup of if before you even touch it!!! cp -p xorg.conf xorg.conf.mybak I'm not at home right now, so I cant post the file right now, but I will once I get home. From what I recall though, although the driver was properly configured and glxinfo and glxgears returned the desired result, there were no font entries in the FILES section, as well as no MODULES section at all, which I added manually with a list of modules to be loaded, among them glx. There also was another rendering option which I dont recall, but I will post the file. When tweaking the xorg.conf the fastet (albeit not most elegant way) to check things is after saving the modified file as xorg.conf, kill the xserver with ctrl+alt+backspace, and start it back up with startx to be sure the settings take effect.
Edit: So I'm back home and here are the relevant parts of my xorg.conf: + Show Spoiler +Section "Files" FontPath "/usr/share/fonts/X11/misc" FontPath "/usr/X11R6/lib/X11/fonts/misc" FontPath "/usr/share/fonts/X11/100dpi/:unscaled" FontPath "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled" FontPath "/usr/share/fonts/X11/75dpi/:unscaled" FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled" FontPath "/usr/share/fonts/X11/Type1" FontPath "/usr/X11R6/lib/X11/fonts/Type1" FontPath "/usr/share/fonts/X11/100dpi" FontPath "/usr/X11R6/lib/X11/fonts/100dpi" FontPath "/usr/share/fonts/X11/75dpi" FontPath "/usr/X11R6/lib/X11/fonts/75dpi" # path to defoma fonts FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType" EndSection
Section "Module" Load "i2c" Load "bitmap" Load "ddc" Load "dri" Load "extmod" Load "freetype" Load "glx" Load "int10" Load "vbe" EndSection
Section "Device" Identifier "NVIDIA FX GeForce Go5200" Driver "nvidia" BusID "PCI:1:0:0" Option "RenderAccel" "true" EndSection
Section "Screen" Identifier "Default Screen" Device "NVIDIA FX GeForce Go5200" Monitor "Generic Monitor" DefaultDepth 16 SubSection "Display" Modes "1024x768" "800x600" "640x480" EndSubSection EndSection
Section "DRI" Mode 0666 EndSection
...(contd)...
Things to take note of are (bold above): make sure font paths are correctly set up, and check that the X server doesnt complain when started; check the modules section, glx should definately be there, the rest I'm unsure; try using the RenderAccel option in your device section (which will probably look different from mine); try changing the default color depth to 16 bit (SC is 8bit, but for some reason that doesnt work properly, 16bit feels a bit faster than 24bit though, at least for me); a final note goes to dri: if you are using the DirectDrawRenderer option opengl in the wine registry, you probably want to comment out (# in front) dri from the modules section, and also comment out the whole DRI section. Again you may have to try different combos, but the above worked for me.
A note from 0xDEADBEEF (ATI graphics card): + Show Spoiler + - Why do you write that 3D accel is needed? It's not. I used the "radeon" driver for a while (open source 2D only driver for ATI cards), so nothing with DRI etc., and it still works. Of course, because SC doesn't require 3D acceleration at all.
- I also never needed to start an X server specifically with 8 or 16bit color depth. 24 (= 32) is fine. There should be no need to change anything.
- The FontPath settings in xorg.conf are mostly irrelevant these days thanks to FreeType, which Wine also uses.
Sirakor's comment re 3D accel: @0xDEADBEEF: you are correct that StarCraft does not need 3D acceleration. I did find however, that open source drivers (especially the nvidia one), can slow down the system on a whole (or X, rather) significantly. Now whilst it isnt directly linked to 3D accel, having working 3D acceleration means that you have your graphics card set up correctly, and that you will get the best speeds out of it, thus not slowing you down. I don't have an ATI card, so it may be different. Re the other pieces, again it's probably not necessary in all cases, but it did seem to help with my (rather old) hardware configuration, so I thought I'd put it here in case someone else also runs into problems with a standard setup.
I should say here that if you are new to Linux, be a bit careful when editing the xorg.conf. If you screw things up, this may leave you without a graphical interface, so make sure you know how to restore the backup we made earlier from the command line: cp -p xorg.mybak xorg.conf . Also check how your distribution handles manual changes to xorg.conf, as after manual changes no automatic updates of the file through the distros tools might occur anymore, unless you specifically tell it to.
There also are some reports of using wine on a second display/Xserver with 8bit colour depth - see the Wine website. Something like this should do the trick: xinit '/path/to/wine /path/to/StarCraft.exe' -bpp 8 --:1 That probably requires having an 8 bit section in your xorg.conf. I haven't played enough with this myself though, to be able to judge if it helps. Starting the new display as 640 x 480 may also be a good idea. Happy digging in the man pages of xinit, X, etc and let us know how it went.
Yet another edit: Some people experience some mouse selection lags at higher apm's, this may be caused by 3-button emulation (thanks to ChessWhiz for this comment)
On December 28 2007 08:37 ChessWhiz wrote:Show nested quote +On December 28 2007 06:47 borg wrote:you'll definitely notice some mouse selection lag if your apm is anywhere over 100. there's no good solution for this unfortunately. Have you tried turning off Emulate3Buttons in your xorg.conf? I had this problem, where the mousedown event was always delayed, and I solved it by disabling Emulate3Buttons. Basically, that option waits after a left-click event to see if you soon press a right-click so it can do middle-click emulation, and that waiting time causes the lag. Here's my mouse section of /etc/X11/xorg.confSection "InputDevice" Identifier "Configured Mouse" Driver "mouse" Option "CorePointer" Option "Device" "/dev/input/mice" Option "Protocol" "auto" Option "ZAxisMapping" "4 5" Option "Emulate3Buttons" "false" Option "EmulateWheel" "on" Option "EmulateWheelButton" "2" EndSection Comment: If you use Sax2 or some other GUI config tool, you can probably also use that to turn off 3-Button Emulation instead of editing the xorg.conf.
So in summary for me the combination of
- proprietary graphics driver
- Wine 0.9.47
- Tweaking wine registry keys with regedit
- Installing msttcorefonts
- Tweaking xorg.conf
did the trick. If you found another way, let us know! At which point I should mention that on the winehq website there was a post about starting SC on a separate display with a modified color depth that worked for this guy (and it was confirmed by others too), so if the tweaks described here dont work for you, maybe look into that option first. See the two links to the SC pages on winehq and the text above.
Good luck and happy gaming!
Edit: If you're looking to get Hamachi working, try these links
http://files.hamachi.cc/linux/README (thanks to chiflutz for the link) http://forums.hamachi.cc/viewtopic.php?t=16590 (thanks to JohnnyHazardous for the link)
More edits:
BWChart under Wine BWChart does work under wine (WinXP mode), but you need to run winetricks and install vcrun6 (thanks to mjh for this comment), or download the following *.DLL files and drop them into your .wine/drive_c/windows/system32 - MSVCP60.DLL, d/l on bwchart website broken, get it here - MFC42.DLL d/l link - msvcrt.dll (included in mfc42.zip) - msimg32.dll d/l link
ICCup Launcher under Wine The ICCUP Launcher also works under Wine, just be sure to turn off the version check. Also, you may need to install the Gecko engine to be able to see the news (this is if it complains that you need to install IE).
|