HAPPENING NOW: We're live from Motorola's 'Relationship' event!

Revolutionary: Balance and Options

Unlike most people, when I brought Wii Fit home for the first time, I didn't head straight to my Wii and slide the disc in to play. Instead, I tore apart the packaging to get at the Balance Board, which I then attempted to "hook up" to my computer. It took a while and a change in my method of operating, but I eventually got the thing connected and working in GlovePIE. It was at that point I started realizing what the Balance Board was really capable of, and this week I'll be sharing with you a few things I've learned about this new peripheral, so that you can start scripting for it and letting your imagination run wild.

GlovePIE version .30's support for the Balance Board is not without its faults (and those faults can seriously set back production), but there are enough functions available to let you viably use it as an input device or game controller, once you get over a few bumps.

To connect the Wii Remote to a Bluetooth device, there is a sync button on the back, inside the battery compartment. If you had to open that up every time you wanted to connect your Wiimote, you'd quickly find the process annoying, but the process is simplified by letting you press the 1 and 2 buttons simultaneously instead of the sync button. The Balance Board only has a power button and a sync button inside the battery compartment, and only the sync button will allow you to connect to Bluetooth devices aside from the Wii. You'll get yourself a workout just from flipping the heavy board over every time you need to sync it, but you could save yourself the trouble of opening the battery cover by getting one of these.


Unlike the Wiimote, there's only one way to sync the Balance Board

Once you get it connected, you can go ahead and start playing around with it in GlovePIE. I started by writing and running some debugging scripts to see what kinds of values the board was throwing out and how sensitive it was. With no weight on it, Wiimote.RawFrontLeft was showing over 5000 units of whatever. Standing on it brought the number up over 7000 units, and shifting my weight directly over the front left corner of the board actually lowered the number back towards 5000. Through some more testing I determined that GlovePIE has the Balance Board's sensors labelled wrong, with everything rotated 180 degrees opposite of how the Wii intends you to orient yourself on the board.

When you're scripting for it, you can either keep the rotated orientation in mind and write your code for the proper orientation, or you can keep things simple by just turning your Balance Board around and writing your scripts the logical way. That may be the best way to keep your code working, in case future revisions of GlovePIE fix the sensor mapping; you'll only have to turn your board back around to run scripts you've written for GlovePIE .30.


This is how GlovePIE .30 wants you to place the Board

GlovePIE's documentation gives you a list of Balance Board functions, but doesn't go into great detail on how they work. If you're familiar with GlovePIE scripting, you shouldn't have much difficulty figuring out how to use them.
Wiimote.BalanceBoard.RawFrontLeft, Wiimote.BalanceBoard.RawFrontRight, Wiimote.BalanceBoard.RawBackLeft, and Wiimote.BalanceBoard.RawBackRight give you raw values for each of the sensors on the corners of the board.

Wiimote.BalanceBoard.FrontLeft, Wiimote.BalanceBoard.FrontRight, Wiimote.BalanceBoard.BackLeft, Wiimote.BalanceBoard.BackRight, Wiimote.BalanceBoard.WeightLeft, Wiimote.BalanceBoard.WeightRight, Wiimote.BalanceBoard.WeightFront, Wiimote.BalanceBoard.WeightBack, and Wiimote.BalanceBoard.Weight convert the Raw values into kilograms, but similarly to the Raw values, I was getting around 100Kg to start with on each sensor with no weight on the board.

Wiimote.BalanceBoard.JoyX, Wiimote.BalanceBoard.JoyY, and Wiimote.BalanceBoard.Joy convert and combine the Raw values into vectors that can be used to control joystick axes. You can use the MapRange functions with these Joy functions to convert ranges of motion and pressure on the Balance Board into PPJoy joystick emulation controls. Writing a script to play Pong should be a piece of cake.

Due to uncontrollable variations in production, the default values for each sensor won't always be the same -- even if GlovePIE were designed to display them as 0 upon startup. In my experimentation, I found it necessary to write a bit of code to offset the initial values output by the board at the start of the script to a 0 value. Whenever I would run the script, I'd make sure that nothing was on the board, so that it would calibrate itself properly, in much the same way you have to keep your thumb off the analog sticks of your game controllers when you turn on your console, lest you have Mario running in circles when you take your thumb off the stick.

Keep in mind when you start scripting that the Wii Balance Board is not actually a balanced board. You can apply differing amounts of pressure to any of the sensors at once, so it's good for more than just see-saw applications. Through leverage, there will be some small amount of pressure on one side inversely affecting pressure on the opposite side, but that can be accounted for with deadzones and other routines for ignoring unintentional input.

I'm most excited to see scripters and developers using the Balance Board in conjunction with the Wii Remote. It can add more functionality and immersion and help erase the notion that Wii controllers are too simplistic to support compelling gameplay. It's entirely possible to have the Balance Board placed in front of your seat and acting as a walking, running, and strafing controller for first person shooters, while you aim your gun with the Wii Remote. You could also pair it up with the Wii Wheel, working as a set of pedals for acceleration and braking. Then of course, there's the expected uses like surfing, but even that is being taken to different extremes by the scripting community.

To use the Balance Board with another controller, careful attention must be paid to the order in which the devices are synced to the computer. For other peripherals, we could get away with just naming them specifically (for example: Nunchuk.JoyX, but for the Balance Board, we need to add the prefix "Wiimote." Wiimote1.BalanceBoard.JoyX will only work if you have the Balance Board synced up before any other Wii controllers, but the number can be re-written to correspond with the order in which you sync'ed your devices.

Next time out, I'll show you the way I'm using my Balance Board, but in the meanwhile, if you've got any ideas for games that could be perfect to control with it, please drop a comment for discussion.

Every Tuesday, Mike Sylvester brings you REVOLUTIONARY, a look at the wide world of Wii possibilities. If this entire column read like Klingon to you (assuming you don't understand Klingon), perhaps an introduction to GlovePIE would be in order. We can think of no better place to get to started with the Programmable Input Emulator than Revolutionary: Introducing GlovePIE.

This article was originally published on Joystiq.