Friday, February 6, 2009

Project Report: OBDMultibox and WoWCast.ahk

Sometime in early 2008 I realized I wasn't really playing WoW anymore, so I canceled my accounts, and went a good six to eight months without playing at all. I didn't even really miss it, except as a coping mechanism for other unpleasantness (which I discussed at length, on several occasions, on this blog).

I did have high hopes for several other games (chief among them Spore) which all managed to disappoint, so that's part of what drove me back to WoW.

Another was just absence making the heart grow fonder, as it is often accused of doing. Over the course of the summer, news stories about WoW on Digg or Ars Technica often caught my attention, and more and more they made me think fondly on my experience with the game. Then, too, there was the content of those stories, which generally focused on the upcoming (at the time) Wrath of the Lich King expansion, and I'd just sort of always assumed I would reactivate my account when the expansion came out, if just to try it out.

So all of those were factors (and improvements brought with the expansion are actually the main reason I stayed in the game), but the number one thing that drove me to reactivate my account in the first place was multi-boxing.

Multi-boxing is a term used to describe playing a game with more than one computer (or "box") controlling more than one instance of the game. It's most popular in MMOs, because generally there is an advantage to having more than one character grouped together, but a given account can only have one character logged in at a time.

There's a similar process called "multi-instancing" where you play more than one instance of a game on a single box, and the only real difference is the complexity of the setup. What I do is actually "multi-instancing," but the former term is much more common, and often used as an umbrella. I will do so through the rest of this post.

(If you're already sick of hearing about multi-boxing -- and I wouldn't blame you if you were -- you're not going to like the rest of this post any better, so feel free to move right along.)

Anyway, over the summer while I was out of the game, my brother-in-law Graham ran my account briefly, genuinely multi-boxing, with one of my high-level healers running around with either his hunter or warrior, keeping them topped off with health while they did whatever it was they were doing. He had a lot of fun with that setup, and I must admit even then it sounded tempting.

Then later in the summer, maybe September, my brother-in-law Jeff got access to my parents' accounts (which were idle at the time) and some software designed to really make multi-boxing easy by providing full control for two characters within one game client. He was playing two Paladins together, and having a blast. The more I heard about it, the more I wanted to try it out.

So, for all these reasons, I reactivated my account about a week before the expansion came out, and three or four days later I also reactivated K--'s old account, which had long been in my possession, to give me a second character to team up with. The complexity of multi-instancing is trying to find some way to make sure some keystrokes control one of your characters, and other keystrokes get through to the other instance of the game and control that character. The most popular way to resolve this is to play two identical character types and and duplicate every keypress to go through to both games.

What I did instead was download and install a free program called AutoHotKey which gives you full control of all the user input, and lets you run commands and/or reroute any input before it reaches running programs. (To do this, I had to learn yet another scripting language, one designed just for AutoHotKey, but it's a much smaller language than Python or LUA, and I only need to know how to do a few simple things, so it wasn't such a big deal).

Anyway, I wrote a script that would identify any open instances of WoW (on the assumption that there would be two), and then capture any keypresses and send them to the first instance of WoW unless I was holding down Alt at the time, in which case it would send the keypress (without the Alt) to the second instance.

That was pretty effective, but tiring on the fingers.

One technique that's basically always used in multi-boxing is a /follow command. Basically, you almost always pick one character as your leader and another as your follower, and then you bind a keypress on the follower to automatically /follow the leader -- an in-game command that will make him try to follow wherever the leader goes (with some limitations). One problem is that the follower can easily get caught on objects (like steps up to a building, or logs mostly buried in the sand) that your leader steps right over while you're holding the Up arrow to walk.

So, to deal with that, and to manage the other necessary macros used by a follower, I created a WoW Addon which I called OBDMultibox. Originally it was OBD, but the short name was conflicting with some other process or Addon or something, so I added Multibox to make it clearer. OBD, by the way, is short for "Other Brother Darryl," which I find hilarious but T-- is the only other person I know who even gets it, and she doesn't find it very funny....

Anyway, I digress. This Addon started out as a very simple one: a single button, near the center of the screen that shows up on the leader's screen and, when pressed, activates the follower's /follow command. That saved me a spellbar spot, because I could use a mouseclick instead of a keyboard command, and so freed up the keyboard command for something more important (like a fireball). I also color-coded the button to show me constantly if the follower is still following, or if he had stopped (usually, as I said, because he got hung up on something).

Then I added some functionality so that, from the leader's game client, I could type a chat command and it would instantly send a group invite to the follower character, and then send a whispered message that would cause the follower character to automatically accept the invitation, and then the leader character would change the looting options to Free For All, all with only one mouse click from me. Awesome.

But, as I hinted above, I quickly got tired of the Alt-button trick, and decided I wanted something cleaner. I spent some time working on macros so I could clean up my spellbar, and then narrowed it down from 12 to 6 keys that I needed. Then I put those, on my leader character on the odd-number keys, and did the same thing with my follower and put them on the even-number keys. Then I rewrote my AutoHotKey macro to start repeating all twelve of the keys to both instances, so I don't have to hit Alt anymore. Instead, it sends odd and even numbers to both, but each instance only responds to one or the other.

And then I really got fancy with my Addon. I had it, on both ends, get a list of all the texture files on each button on the spellbar (the unique name that the game used to look up the pictures displayed there), and then the follower whispered a list of all his textures to the leader, and vice versa. Then, I drew smaller copies of each of those icons on the spellbar in the correct place for the other character, so when I'm looking at my spellbar for my leader, instead of having my normal spells on odd numbers and blank spaces on the even numbers, I have my normal spells on the odd numbers and my pet's normal spells (at 2/3 size, so they're obvious to spot) on the even numbers. So, at a glance, I can know exactly what I will cast if I press "4," even though it's actually casting the spell in a completely different instance of the game.

I started working on this in mid-November, but didn't really pick up speed until early December (because of NaNoWriMo). By mid-January it was working pretty stable, and I'm using it pretty much daily now.

I'm still having some problems with the timing, becaus the leader won't always auto-set the loot method (which is annoying). I'd also like to find a clean way to pass mouse clicks through to the follower client, but that has proven a real puzzler. Right now, as a workaround, I just Alt-Tab to the follower client whenever I need to use the mouse to loot an item or talk to a quest-giver. I hope to eventually revive the Alt tactic, passing Alt-clicks through to the follower client, but I haven't felt any real drive to wrestle with that in several weeks.

For the most part, this is a complete project that I'm pretty happy with. It makes my life a lot easier, and multi-boxing WoW has made it a lot of fun, for several months now.

Status: Stable, v. 1.0

No comments:

Post a Comment