Sunday, September 07, 2008

WoW Multiboxing Setup

I have been playing World of Warcraft quite a bit lately. In fact, I've been multiboxing--playing with five characters at a time. Yea, I know this makes me quite the nerd.

Luckily, I can do all this with one computer, unlike the old days when multiboxing could only be done with several computers. My system has an AMD Athlon X2 64 Dual 4800+ processor with 2GB of RAM and a striped volume set up using two hard drives and the Windows Disk Management utility. My video card is an NVIDIA GeForce 8800 GT with 512MB of RAM, and I have a 21" LCD screen running at 1680x1050.

This setup easily runs 5 instances of WoW with the main instance at full graphics settings and the four other instances at minimum graphics settings. However, things start to lag a little bit in crowded areas, especially Orgrimmar, because my memory usage spikes to over 2GB. Another GB of ram would make my system ideal for 5-boxing.

Before I go into key broadcasting software, I'd like to share a couple tips you can use to make your five characters look super-coordinated. First is chain follow. Set up a macro on your second character to follow your first character, one on your third character to follow your second character, etc. Now you can run through populated areas with your long chain of characters so everyone can see just how many they are. This is much better than having them all lumped together right behind your main.

Second, when you are just standing around, you don't want all your secondaries in a big lump standing behind your main. So, here's what you can do. Designate a key (I use the up arrow key, but you might want to use something like F12) for positioning. On your main, leave this key unbound. On your secondary, bind it to strafe left; on your third, bind it to strafe right; on your fourth, bind it to forward; and on your fifth, bind it to backward. Now, you can press your positioning key to have all your characters fan out. Move your main into the middle of the formation and you have an escort.

Now, on to key broadcasting software. I started out using Octopus for key broadcasting and instance management, but it lacks a few features I wanted such as round-robin broadcasting and 'hotstrings.' I know I can set up a round-robin system using castsequence, but this prevents me from using /stopcasting in the macro to get immediate heals. Sadly, I just found out that Octopus is no longer in development.

A few days ago I bought a license for Keyclone. The only thing I can't do with Keyclone that I could do with Octopus is assign F1-F5 to my instances to switch between them. I can do something similar with the maximizer in Keyclone, but I want all my instances to be full screen. Maybe there's a way to do this and I just haven't figure it out yet. --Update: This is possible by creating a bunch of full-screen regions, but maximizer is screwy with widescreen resolutions and wants to just stretch 800x600.

The feature I love most about Keyclone is the hotstrings feature. Using a clever setup, I can play from any of my instances at any time and all my characters will automatically assist the active instance. This is done without using focus or having to keep a target. It took me some trial and error to get it to work right, so in addition to the link above I'll let you know what exactly worked for me.

The first complicated part is setting up a whole crapload of hotstrings. You have to have five hotstrings per instance per macro. To save you this headache, you can download my keymap files here. Unzip those files to your keyclone directory and assign them to each of your 5 WoW instances. You'll need to bind the following keys in WoW to some action bars (I used slots 1-6 on action bar 6):

[ ] ; ' , .
Next, you need some macros with complicated targetting based on which modifier keys are being held down. The example macros in the link above are longer than 255 characters and a pain to get working, so here is a shorter macro that works just as well:
/target [mod:ctrl,mod:alt,mod:shift,target=Character4] [mod:ctrl,mod:shift,target=Character1] [mod:ctrl,mod:alt,target=Character2] [mod:alt,mod:shift,target=Character3] [mod:ctrl,target=Character5]
/cast [target=targettarget] Lightning Bolt
/targetlasttarget
This macro is actually three lines, so make sure you move all the "[mod:...]" parts onto the first line, separated by spaces.

This should be all you need to get the setup to work. If you have any problems, please post to the dual-boxing forums.

Next, I'd like to explain what settings I use for my WoW instances. Like I said before, I run my main instance at full graphics settings and the other four at the lowest settings. The easiest way to do this is to have two copies of WoW, the first one for your main instance and the second one for your other four instances. This wastes a lot of space though, because you have two copies of the Data directory, one in each WoW directory. I have a better solution.

In Linux, you can create links to files and folders. This means you could have a directory called "Bush" with a bunch of incriminating documents, and you could create an alias called "scumbag" to point to the "Bush" directory without copying all the files. Lucky for us, there's also a way to do this in Windows.

First, download the program Junction and extract it to your Windows directory. Next, create a new directory called World of Warcraft2 or something of your choosing. This will be the installation for your other four instances. Now, you need to copy everything in your original WoW folder EXCEPT the Data, Screenshots, Patches, and Logs directories into your new WoW directory. Delete the Accounts under WTF in your new WoW directory (because we're going to create a link for it also).

Now, open a command prompt (Start, Run, type in cmd). Go to your new WoW directory (for example, type cd "C:\Program Files\World of Warcraft2"). Type junction Data "C:\Program Files\World of Warcraft\Data" and then "junction WTF\Accounts "C:\Program Files\World of Warcraft\WTF\Accounts" and you're all set! Launch WoW from your original installation for your main instance and from the secondary installation for the other four instances. Configure the other four with the lowest graphics settings you can stand.

Finally, a few tips for leveling up. First of all, as you may have already heard, avoid collection quests! Unless you are just collecting one item for each character, that is. Otherwise it's rather inefficient. Finish all the "kill X number of Y" quests in your starting area, then move to the low-level area. If you finish all the good quests there, you can always move to another faction's starting area. For example, I usually do the quests in Durotar and Brill, then Crossroads and The Sepulcher.

Wow, that was a pretty long article. Thanks for reading!

P.S. I am developing a program to manage WoW macros, with multiboxing support. This will make it easier to copy the same macro across all your characters. Post your contact details in a comment if you are interested in trying out a beta.

Run Linux applications natively under Windows

I hate Windows, it sucks. As I say, failure is not an option--it comes bundled with Windows! However, the embarassing truth is that I need it. I can't live without Photoshop and World of Warcraft, and I don't care to try getting them to run on Linux. Additionally, my job requires me to have some form of Linux for the software development environment we use.

I've tried several solutions that would let me utilize Linux and Windows on the same computer, including VMWare, dual-booting the old fashion way, and dual-booting with a wubi-based Ubuntu installation. It's always a pain in the butt and my wireless drivers just don't work right under Linux, so my search for something better never ended.

The solution is a brilliant software package that lets you run Linux applications in Windows without a virtual machine, and it's called andLinux.

AndLinux is a complete Ubuntu Linux installation that runs seamlessly on Windows. This is made possible using the native Windows port of the Linux kernel, coLinux. It's not perfect yet though, so I'd like to shed some light on a few nifty bits of information I have found.

First of all, I installed the lite xfce4 based version. You may be tempted to download the KDE version because it sounds more familar, but wait--it's five times larger and you can do everything you need with the lite version.

After the installation and reboot, you should see a little yin yang icon in your system tray. You can click on this to get a meager list of applications to run on your new Linux-in-Windows installation. This will hardly do. Install an application you want to use (I like gedit) with the Synaptic package manager, and then I will show you how to add it to the menu.

You need to edit C:\Program Files\andLinux\Launcher\menu.txt to change the shortcuts available on the andLinux Menu. Here is a sample and the format:

Root Terminal;xfce4_terminal.ico;xfce4-terminal
<shortcut name>;<icon file>;<linux command>
It's pretty simple. I added a shortcut for gedit (Gnome's Text Editor) by putting:
gedit;xfce4_terminal.ico;gedit
Yea, I know i used the terminal icon. I'm too lazy to go find a decent icon to use.

One of the first big issues I encountered was drive size. My installation defaulted to a size of 2GB, and I need much, much more than that. In order to make your andLinux drive larger, you must perform two steps. The first step is enlarging the container file for the drive, and the second step is enlarging the filesystem to use the whole container.

To enlarge the container, unzip the file C:\Program Files\andLinux\
ImageResizeTool.zip, and run the toporesize.bat file. Select your disk drive image, which should be at C:\Program Files\andLinux\Drives\base.drv, and click 'resize file.' Something should happen, and if you get an error message at the end of the process, don't worry just yet.

Next you'll probably have to resize the filesystem to fit the container. Open a Linux terminal from your nifty yin-yang andLinux Menu in the system tray, and type the following commands:
dfree -h
apt-get install ext2online
ext2online /dev/cobd0
dfree -h
You should be all set! -- Update: when I tried to increase my drive size to 20GB, I found out that ext2online has some limitations. If you run into problems when you run ext2online, try the following after increasing the image file size using toporesize. Copy andLinux\Drives\base.drv to base1.drv. Edit andLinux\settings.txt and add cobd2=Drives\base1.drv. Restart andLinux and type ext2resize /dev/cobd2. Shutdown andLinux and move base.drv to base.drv.old. Move base1.drv to base.drv, remove the cobd2 line from settings.txt, and then start andLinux. Voila!

Now you may have noticed when you opened a terminal that it is a root terminal. It's not a good idea to leave it this way--you should create a normal user to do everything except administration tasks. You can find a guide to doing this on the andLinux wiki at http://andlinux.org/wiki/index.php5?title=Quick_Tips#create_a_normal_user.

One of the steps created problems for me, and that was the editing of the /usr/bin/startwindowsterminalsession file. Instead of editing this file, I changed all my shortcuts to start up under my user account. You can start an application under a specific user by adding 'sux - <user>' before the command. Therefore, my command to start gedit is 'sux - jbarton gedit.'

Changing the data directory for MySQL in Ubuntu

There have been several occasions where I wanted to change my MySQL data directory. First it was to run multiple instances of MySQL, which I gave up on. Then I bought an external drive to save my development environment, including my source code and the MySQL data directory, so I could develop from any machine at work or home. Both times I kept running into problems getting such a seemingly simple configuration change to work properly.

I thought it would be rather easy. One way to do it is by changing the MySQL configuration in /etc/mysql/my.cnf, but I wanted to make it easier for other developers to use the local MySQL database. So instead I created a directory for MySQL data on my external drive, then issued the following commands to create a symbolic link from /var/lib/mysql to that location:
cd /var/lib
sudo mv mysql mysql2
sudo ln -s /mnt/jbarton/mysql /var/lib/mysql
Of course, I was greeted with several nasty error messages any time I tried to start MySQL or initialize the new data directory (either directly or through the symbolic link). Here are some of the complaints I found in the logs:
[Warning] Can't create test file /srv/mysql/hostname.lower-test

kernel: [ 82.391726] audit(1210139515.249:2): type=1503 operation="inode_create" requested_mask="w::" denied_mask="w::" name="/var/lib/mysql2/hostname-linux.lower-test" pid=5888 profile="/usr/sbin/mysqld" namespace="default"

InnoDB: Error: unable to create temporary file; errno: 13

kernel: [ 82.508111] audit(1210139515.369:5): type=1503 operation="inode_mknod" requested_mask="w::" denied_mask="w::" name="/var/run/mysqld/mysqld.sock" pid=5888 profile="/usr/sbin/mysqld" namespace="default"

[ERROR] Can't start server : Bind on unix socket: Permission denied

[ERROR] Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ?

[ERROR] Aborting

[Note] /usr/sbin/mysqld: Shutdown complete

mysqld_safe[5892]: ended
After several failed searches on Google to figure out the problem, I finally found the solution. The culprit is AppArmor, a security framework now default in Ubuntu that is supposed to be easy to use. I would say that it is a big pain in the ass, and not very user-friendly. There was nothing in my syslog around the nasty MySQL and kernel error messages that even hinted at AppArmor.

Once you know AppArmor is the problem, the fix is very easy. You simply edit /etc/apparmor.d/usr.sbin.mysqld. Underneath the two lines authorizing the default MySQL data directories, add two more with your custom directory. Make sure you have a trailing / on the directory name, otherwise it will not work (I had this problem at first). After this change, restart AppArmor:
sudo invoke-rc.d apparmor restart
Now you should be able to set up the new directory as a MySQL data directory and initialize it using mysql_install_db. For more information on this topic, check out the following links:

AppArmor - Ubuntu Wiki
The Brainwrecked Tech had the same problem
Ubuntu bug #201799
A thread on the Ubuntu forums with the solution