PDA

View Full Version : Halo on Linux: The Ultimate Guide



klange
July 26th, 2009, 01:08 PM
I've noticed some people here are looking at using Linux a bit more often and thought I'd do this forum some justice and provide a complete guide to playing CE, with all the fun stuff, under Linux with Wine.

Protip: For best gaming performance on Linux, be sure to use an nVidia card. ATI has, for years, made horrible drivers for Linux, and Intel's drivers aren't up-to-scratch enough to play games you can normally play on Windows (Halo especially).

First off, some version notes:
I'm running:
- Ubuntu 9.04 - x86
- Kernel 2.6.24-24
- Wine 1.1.24 (tested with .25 and .26, but they have a fatal issue in EVE, so I reverted .24 until it gets fixed e: Now running on .27, but I haven't tried EVE yet. Don't care, honestly.)
- NVidia driver: 180.44 [on a GeForce 9800GT]
- X11: 1.6.0
I can't guarantee things will work the same on an older version of Wine or different nVidia drivers, though newer versions of either should only improve things.

Topics Covered in this Guide:
- Installing Halo CE
- Running CE off of your Windows drive
- Running CE directly on Linux
- Running CE optimally without extensions
- Running CE with extension hooks ("Open Sauce on Open Source")
- Tips on using the HEK under Linux
- Running the Halo CE Dedicated Server
- 3ds Max 7 *new*
- Trouble Shooting

Files for your Convenience
I've hosted Winject, mfc42.dll and my chktrust.exe for your convenience:
Winject (http://halo.phpwnage.com/linux/Winject.exe)
mfc42.dll (http://halo.phpwnage.com/linux/mfc42.dll)
chktrust.exe (http://halo.phpwnage.com/linux/chktrust.exe)


Teaser Pics
To get you enticed, here are a few shots of my experiences

http://blog.phpwnage.com/~klange/screenshots/coldsnap_linux.png
Coldsnap, falling off of a cliff in a warthog. When running full-screen like this, framerates are sporadic but high. Vsync fails to function for some reason.

http://blog.phpwnage.com/~klange/screenshots/more_halo.png
Me in Botfree, after about a half hour of kill-die-kill-die-kill-die...

http://blog.phpwnage.com/~klange/screenshots/halo_3360.png
I was bored... saw the "Multi-Monitor Gaming" thread... set my virtual desktop size to 3360x1050... did this. Note that, due to the way Open Sauce, etc. are activated, I couldn't use them when taking this shot, so no FoV changes.

http://blog.phpwnage.com/~klange/screenshots/oh_hey_opensauce.png
And, of course, Open Sauce showing Skyline and Limited's field-of-view and third-person extension.

Installation
Whether you want to play off of a Windows drive or directly in Linux, you're going to need to install to ensure all the right libraries are in place in Wine. Installing CE is very simple, but will require you to dig up some DLLs from the Internet or (if you're running 32-bit Windows) a Windows installation. For the purposes of this tutorial, I have created a fresh, untouched Wine directory and will be installing CE.

Go find mfc42.dll and put it in your Wine System32 directory. This file is required to install Halo.
http://blog.phpwnage.com/~klange/screenshots/ce_linux/get_mfc42.png

Run the installer:
http://blog.phpwnage.com/~klange/screenshots/ce_linux/installation_0.png

Accept the EULA.
http://blog.phpwnage.com/%7Eklange/screenshots/ce_linux/installation_1.png

The first thing to note is that a regression in a recent version of Wine broke the installer buttons, so make sure your enter key works on your keyboard.
Hit enter...
http://blog.phpwnage.com/%7Eklange/screenshots/ce_linux/installation_2.png

Enter your CD key, this is especially important if you're playing off of a Windows drive, this is the entire reason why we're installing.
http://blog.phpwnage.com/%7Eklange/screenshots/ce_linux/installation_3.png

Hit enter...
http://blog.phpwnage.com/%7Eklange/screenshots/ce_linux/installation_4.png

Select whatever options are appropriate. I didn't want to install GameSpy Arcade, who does?
http://blog.phpwnage.com/%7Eklange/screenshots/ce_linux/installation_5.png

Then hit enter. The installation should run through as normal.

Congratulations, you've installed Halo CE!

You can play right now without too many issues, but we're going to get into some more technical topics and ways to make Halo play better.

But wait, there's one last step. If you want to see chat text, you need to go into the redist/ directory of the CE installation path and run the msxmlenu installer with:

wine msiexec /i msxmlenu.msiPlaying off of Your Windows Drive
Is so easy, I don't know why I gave it its own section.

First off, to save space, go in to ~/.wine/drive_c/Program Files/Microsoft Games/ and shift+delete the Halo Custom Edition folder. You won't be needing this on Linux.

Just mount the drive by clicking or double-clicking on it in whatever file browser you use. (In Ubuntu, go to Places > [Your Windows Drive] and just click it). If your Windows installation of Halo CE is up to date (1.08), you should have no issues playing Halo.

Playing Directly on Linux
Now, here's where we get problems. Versions of CE older than 1.08 have a CD check that fails to work on Linux. We need to update Halo to the newest version, but if you're on Linux without any Windows installation to speak of, we're going to have some issues. The Halo updater application has a quirk that makes it not accept the results of a trust check (one of those "Do you trust this application?" things). We need to fake a positive result using a C++ application we have to build right now:


int main(int argc, char * argv[])
{
return 0;
}Save it to the CE directory as "main.cpp".

We need to compile this for Windows with the mingw32 C++ compiler. Install the package 'mingw32' (or similar) on your distro. Ubuntu users need to just run `sudo apt-get install mingw32`. Note that this will also install the runtime and binutils package for Mingw32.

The program this installs varies across different distros. On 32-bit Ubuntu, it is i586-mingw32msvc-g++. You may want to type "i[tab][tab]" to find out what compiler to use.

When you have it figured out, compile the C++ file:

i586-mingw32msvc-g++ main.cpp -o chktrust.exeYou should now be able to run haloupdate.exe and successfully update Halo to 1.08. At this point, you should have no issues playing CE.

Optimizing Halo for Smooth Play
Halo isn't exactly the most obedient game when it comes to listening to your quality-control settings.

The golden rule is ensure that you're running Wine with a virtual desktop (set to the size you want to play Halo on).
Run `winecfg`:
http://blog.phpwnage.com/%7Eklange/screenshots/ce_linux/winecfg_halo.png
(Yes, that says 3360x1050, I was testing over two displays)

The next issue to tackle is that Halo has sporadic, extremely high frame rates that cause visual tearing and unreliable gameplay speeds. The best bet you have is to ensure that Sync to Vblank is enabled in the nVidia X Settings Manager. This usually works with Halo and provides more reasonable (that is, lower) framerates and less (and sometimes, no) visual tearing.
http://blog.phpwnage.com/%7Eklange/screenshots/ce_linux/synctovblank.png

When running Halo without extensions, we can provide command line parameters by running Halo from a terminal. Most notably, we can specify a resolution:

wine haloce.exe -vidmode width,height,refresh_rateNow there's one last issue we may face that we can "solve" and that is flickering decals. Sometimes, larger decals (explosion marks) flicker. The only way to fix it is to turn them off, but it's more of a personal preference. Remember, decals can alert you to recent activity with blood and explosions scars, but they can also slow down game play.

http://blog.phpwnage.com/~klange/screenshots/ce_linux/decals_are_bad.png
Large decals have some issues

http://blog.phpwnage.com/~klange/screenshots/ce_linux/decals_are_fine.png
Small decals work fine...

Another thing to note is that the nVidia active-camo bug is still there. I'm looking into fixes for it.
http://blog.phpwnage.com/~klange/screenshots/ce_linux/nvidia_bug.png

Open Sauce on Open Source
The primary issue here is that Wine has a very strict attachment to its own DirectX libraries, and trying to hook in another library simply will not work the way we want. Because of this, we need to do some injection hackery to get Open Sauce to work.

Please, please note: if you try to set your Wine installation to use the native d3d9.dll first, it will only crash your Halo. Don't even bother trying!

Go find Winject 1.7 or newer, as a feature we need was introduced in this version. For ease of use, you can put it in your CE directory.

Winject is a process injection tool originally written (if I'm not mistaken) for cheating in some games by running a debugger or other hack, but don't worry, that's not what plan on doing. We just want to pre-load our Open Sauce DLL.

Start Winject. If it doesn't start, run it from a terminal (wine Winject.exe) and ensure you have all the right DLL files. I'm not entirely sure if it requires anything special.
http://blog.phpwnage.com/%7Eklange/screenshots/ce_linux/winject.png

Go to File > Select File and select haloce.exe. Under the "DLL to Inject" drop down box, find your Open Sauce DLL. Conveniently, the issues we have allow you to give it a more appropriate name (which is useful if you have more than one, but that shouldn't be the case).

If you want dev mode access, install the required DLLs for HaloCEDev.exe and be sure it is running before you continue.

When you're all ready to go, click "Launch" and Halo will start.

Note that you can't supply Halo with any command line parameters, so you can't specify a screen resolution. You will want to set Halo to the highest 4:3 resolution you can use.
I'm requesting that a fix be made for this in the form of a (resolution w h r) command in Open Sauce, but that may not happen.

Also note that Winject may make its "failure" sound while CE is loading. This does not necessarily mean it failed to pre-load, as its injection test simply can not run while CE is doing map hashing.

If all went as planned, you should be running CE with Open Sauce. Press Page Up to activate dev mode and see what commands are available.

The Halo Editing Kit
There are no known issues with the HEK as I haven't had the time to really mess around with it. Sapien and Guerilla should have no issues running (and a hobo's and kornman00's versions of the two applications should work fine as well). I have not had the time to test all of the tool functionality yet but will get to work on it when I start making my next map, Remnant. The real issue on Linux is that 3ds Max is a bitch to install (but can be done, see below), and we have no plugins for Blender. If you're really into Linux, you'll probably want to use Blender which is why I'm requesting someone port TheGhost's GBX exporter to Blender!

Pictures:
http://halo.phpwnage.com/linux/tool-structure.png
Running `tool structure` on the Tutorial BSP, which I exported from Max 7 under Linux.

http://halo.phpwnage.com/linux/sapien-tutorial.png
The new BSP in Sapien. Sorry, didn't take a shot of lightmaps, which I ran at 0 0.001.

http://halo.phpwnage.com/linux/build-cache-file.png
Building the cache file was nice and quick, as expected for such a small map.

http://halo.phpwnage.com/linux/tutorial_banshee.png
And my modifications in game, I slapped a banshee in the middle of the map and moved some vehicles around.

This section is reserved for troubleshooting of any issues that come up to readers of this tutorial.

The Dedicated Server
Even if you don't use Halo on a Linux desktop, running it on a Linux server may still come up.

There are two ways to run the dedicated server after installing CE.

You can run it interactively by ensuring an X session and running:

wineconsole haloceded.exeOr you can run it in the background (best done without an X session by simply ssh'ing into the server):

wine haloceded.exeTo edit the config files, use `wine notepad`, as it operates in the correct mode for Windows text files and most Linux editors will convert to UTF-8.

I have not yet gotten Rec0's Devicator to work on Linux, but I am working on it. If I am successful, I will post the necessary steps here.

3ds Max 7
Contrary to popular belief, there is in fact a version of 3ds Max that runs in Wine. Now, it's not the most recent, but it works for our purposes (I still suggest you learn to model in Blender, but at least now you can get your models into Halo).
Please note beforehand:
- A Windows installation is required to authorize 3ds Max because the key entry page doesn't render. winegecko bugs or something like that. There is a guide on AppDB (http://appdb.winehq.org/objectManager.php?sClass=version&iId=2588).
- Or you can cheat and install 3ds Max 7 as noted here (http://appdb.winehq.org/objectManager.php?sClass=version&iId=2588) into its own Wine directory and continually reinstall it after the 30 day trial runs up. I guess that's circumvention, so I'll add that I don't support it. Authorize the damn build, you can still get keys for Max 7 these days.
- You're going to need to remove the Combustion plugins. Sorry, they don't work, so if you needed particles, you're out of luck. (CMB.bmi and cmbtext.dlt - I moved them to a separate folder in the 3dsmax7 directory which I called "DO NOT USE", but moving them to ~ or something like that will work, too.)
- For Blitzkrieg, grab the one labeled "Blitzkreig" [sic] on hce.halomaps.org and be sure to include the DLL files in your system32/ directory.
- If you can play Halo CE on Linux as noted above, I recommend using DirectX mode in 3ds Max, as OpenGL mode does not work without extra effort, and you get to use DirectX GLSL materials.

Other than that, you can just install from the Installer on a recent version of Wine and you should be fine.

http://halo.phpwnage.com/linux/max.png
Messing with the HCE tutorial before switching to DirectX mode.

http://halo.phpwnage.com/linux/jms.png
Exporting the Tutorial JMS file.

http://halo.phpwnage.com/linux/havok.png
Havok / Reactor works as well.


Troubleshooting
Issue: "Halo complains that some file is missing or corrupt and won't run!"
Solution: You're probably trying to run Halo from outside of the CE directory. Halo has issues when you're not in the right working directory. I recommend cd'ing into the CE directory and running `wine haloce.exe` or double-clicking the EXE for best results.

Issue: "The mouse jumps out of the window when I play."
Solution: There is a check box in winecfg labeled "Allow DirectX apps to capture the mouse". You should check this.

Issue: "Halo messes with my display resolution and screws up my X server on exit"
Solution: Be sure that you're running Wine with a virtual desktop. This prevents Halo's dirty DirectX initialization from mucking things up, and has the added benefit of allowing you to run Halo in a windowed mode.

Issue: "When I start Halo with the -windowed option, it doesn't work"
Solution: And it's not going to. Just use a virtual desktop at a resolution less than your screen resolution. (If you do something larger than your screen resolution, Wine will remove the borders from the window because it will assume you want to run it full screen)

Issue: Sapien / A Hobo middle-mouse clicking does not rotate the screen.
Solution: You probably told Wine to use dinput8, as instructed in the horribly inaccurate tutorial on AppDB. Just remove it and you should be fine.

Reviews of this Tutorial
"Super epic post needs moar +rep"
"great job on the linux tut. When I get my second comp up and running (gonna be a while tbh) Im planning on running Ubuntu on it."
"Nice guide."
"great tutorial"
"ZOEY"

TomClancy
July 26th, 2009, 04:09 PM
Nice! I'll have to try this at some point.
I'd rep you but it won't let me. :saddowns:

Rob Oplawar
July 26th, 2009, 04:22 PM
I Just played through the latest build of BCE in linux. It was awesome, despite the occasional glitch.

klange
July 26th, 2009, 04:24 PM
I Just played through the latest build of BCE in linux. It was awesome, despite the occasional glitch.
I'm actually lucky in that I'm coming up from shitty hardware where Halo always ran poorly on Windows, straight to this where even with the occasional glitch it's a major improvement.

e: Adding some troubleshooting notices, only have one for now, but if anyone has issues, let me know and I'll write up the fix. ee: Yeah, forgot about some of the other issues, added them.

ThePlague
July 26th, 2009, 04:55 PM
Very good, if I ever put Linux back on any of my computers i'll definitely use this

klange
July 28th, 2009, 01:00 AM
ATTN: HBO
Credit the right person when posting news on forum threads, kthxbye

Going to add download links for the required files on my server tomorrow.

I despise typing on my iPod, so no more right now.

e: Files will be up on my server later tonight, working on Cerebrum at the moment.
ee: Files are up ^_^
eee: Thanks for the rep. I've gotten more reps from this post than I've gotten even from the Cerebrum thread, and in less time.
http://blog.phpwnage.com/~klange/screenshots/screenshot2.png

klange
August 13th, 2009, 11:00 AM
Sticky-Bumping for notes on 3ds Max 7.
e: And screenshots of the HEK. Guerilla runs, just didn't need to use it at the time. I'll get pics of it later.

ThePlague
November 5th, 2009, 09:00 PM
I'm stuck on compiling the cpp file. Can you upload yours somewhere, or is it different for everyone?

klange
November 6th, 2009, 12:18 AM
I'm stuck on compiling the cpp file. Can you upload yours somewhere, or is it different for everyone?
I did upload it. http://halo.phpwnage.com/linux/chktrust.exe

ThePlague
November 6th, 2009, 09:03 PM
Oh, didn't know the cpp was the chktrust. Cool.

e: How do you go about fixing this (http://www.modacity.net/forums/picture.php?albumid=170&pictureid=1369)?

supersniper
November 24th, 2009, 11:19 PM
http://gbxforums.gearboxsoftware.com/showthread.php?t=87754

Bhamid
November 29th, 2009, 12:52 PM
I did everything the tutorial right, but any keyboard inputs don't work, only the mouse.
Wine version 1.1.33, ubuntu karmic 9.10

klange
November 29th, 2009, 05:12 PM
I did everything the tutorial right, but any keyboard inputs don't work, only the mouse.
Wine version 1.1.33, ubuntu karmic 9.10
Which is a pain in the ass, I know. Keep restarting Wine, try a different window manager (Alt+F2: `metacity --replace`). You'll get it eventually.

daeha
December 20th, 2009, 09:14 PM
Hey everyone!
I've modified the tutorial on linux-gamers.net (http://www.linux-gamers.net/smartsection.item.90/howto-run-a-halo-server-using-wine.html) to add a method to run the dedicated server on a machine that doesn't have X. Here's my version:
http://wiki.zone42.ca/bin/view/Zone42/HaloDedicatedServer

Basically the gist of it is:

wineconsole --backend=curses cmd.exe /c haloceded.exe

Used in conjunction with GNU SCREEN, this is extremely useful.

t3h m00kz
September 10th, 2011, 11:56 PM
Just installed ubuntu on an old machine I had laying around. I doubt it can even run the game but this will be my go-to if I ever get that shit up and working

MEGAVKNG2
October 26th, 2013, 03:20 PM
Will HEK work on this? I think Linux is going to be my 2nd computer if i ever get one >:D

Znikrot
April 29th, 2014, 03:31 AM
Hello everybody, I know the thread is very very old, but I thought you could help:

I recently installed Halo CE on ubuntu 13.10 with playonlinux and it runs just fine, except for the fatc that I can't see the bottom part of the HUD, I can't see what I'm typing in the console xD

Other than that I can't see the "shield effect" when I shoot elites or other spartans. Is it a known issue or it happens just on my machine? :D

I have a dell Inspiron 17R 7720 with nVidia Geforce GT650M 2Gb

Thanks in advance for all the help :D

Cortexian
May 4th, 2014, 02:13 AM
For your first problem: That's a normal issue, and not isolated to Linux. It happens when you're using a non-standard resolution for the game. Can you see the normal game chat and the like, or what you type after sending it? If so, try a lower / 4:3 resolution instead of a higher 16:9 one.