Forum:Wii remote on Game Maker (can anyone say, "Wiisabers"?)



Have you ever wondered whether it was possible to make a Wii game with Game Maker? Have you ever wanted to use the Wiimote's motion sensing for your Game Maker projects? If not, here's a moment of inspiration.

I have successfully connected the Wii remote to my PC with Bluetooth, used the GlovePIE emulator and PPJoy freeware programs to convert its signals into something the PC interprets as a game controller, and had Game Maker read it. Some experiments are still incomplete, but, in the spirit of freeware and stuff like that, I decided that I should share my discoveries and allow other Game Makers to toy with this new opportunity.

What you need to use the Wiimote on Game Maker:

1.Wii remote

2.Bluetooth dongle (I used a Kensington 2.0 USB Dongle running version 4 of the driver, most other mainstream Bluetooth adapters work as well)

3.GlovePIE (freeware program to interpret and emulate Wii output and input, download at http://carl.kenner.googlepages.com/glovepie_download)

4.PPJoy (freeware program to create virtual joysticks that GlovePIE can emulate Wii signals into, and hence make it readable on Game Maker. Download at http://www.simtel.net/product.download.mirrors.php?id=75176, or other mirror sites)

5.Game Maker 6.0 or higher, you do NOT need the Pro edition

Really, the only commercial products you need for this is the Wii remote and the Bluetooth adapter. If you have a Wii and a Bluetooth dongle already, this will be no problem for you. Otherwise, a Wii remote costs around 40 US dollars and a decent, reliable Bluetooth dongle can probably be found easily on Amazon or eBay for 30 US dollars.

The first thing you need to do to hook up your Wii remote is to connect it to Bluetooth. Compatible Bluetooth adapters are listed at http://www.wiili.org/index.php/Compatible_Bluetooth_Devices. Assuming you have your Bluetooth adapter set up, all you have to do is search for any devices in range while holding 1 + 2 on the Wii remote. An icon should appear that says "Nintendo RVL-001" or something similar. Clicking on that once (on a Widcomm display) and then clicking "Bluetooth Setup Wizard" at the left toolbar will take you to a menu. At the bottom, quickly click "Skip pairing" and keep holding down 1 + 2. Eventually, on the next window, an icon will appear with two green arrows indicating the connection was successful. Once you click "Finish," you will have connected a Wii remote to your PC.

Now you need two programs to make the Wii remote's signal be understood by both the computer and Game Maker. The first one you should use is PPJoy. Once you have downloaded, installed, and setup everything from the link above, you should be able to find "Configure Joysticks" in a program files menu or in "All programs" on your Start menu. You must configure a "Virtual Joystick," which will create a pretend plugin that the computer thinks is a game controller. You should consider the buttons and other inputs of a Wii remote now. What I did was make it a 12-button controller (including POWER, which you shouldn't need to use unless you think of something fancy) with six axes. The first three axes were the translational accelerometers (linear movement and acceleration) and the next three were the rotational sensors (tilt). Set all of these to default (digital0 and analog3 looking settings); you don't need to scan for anything yet. (Chances are it won't understand that the Wii remote is pressing a button.)

Now, to turn the Wii remote's signals into the virtual joystick that you just created, you can use GlovePIE. Despite the anti-Semitic and overly anti-military (on the hate scale) copyright message, GlovePIE is an excellent tool for getting the Wii remote to do neat things on your PC. You will need to write a simple program in the script window, which isn't as hard as it might seem. All you need to do is write lines like this:

PPJoy.Digital1 = wiimote.Up

for each button and axis you put into the virtual joystick in PPJoy. If I ever upload a Game Maker Wii game, it will include my own script that will just need to be run to make a connected Wii remote work on the game. Remember, PPJoy.Digital for buttons and PPJoy.Analog for axes.

Once you have this complete, you will have your Wii remote ready for whatever you want to do on Game Maker. The only thing that's left is to write your events and codes in Game Maker itself. If you just want to make sure, you can check PPJoy's virtual joystick to make sure which Wii remote button corresponds to a given button number, or what type of axis each mode of rotation or acceleration is.

In Game Maker, you can use variables like "joystick_xaxis(1)" to read the axes in a code, and use joystick button events under the Mouse category. With this, you will have your Wiimote ready for your games.

Some things I didn't mention: GlovePIE can read the infrared camera on the Wiimote that detects the sensor bar, the Nunchuck buttons and axes of motion and rotation, and the Classic Controller's buttons and analog sticks. If you feel the need, you can connect multiple Wii remotes, manipulate the LEDs that indicate player number, and make the Wiimote vibrate with GlovePIE. Unfortunately, the speaker capability is limited, but this may change in the future.

So there you have it. Game Maker can make Wii games. If anyone wanted to know how to do this, your wish is granted, and great if anyone has been inspired to use this information. I am planning a 2D Star Wars "WiiSabers" game using the Wii remote to swing a stickfigure lightsaber-wielding Jedi (or Sith, for the Dark Side freaks). It can also be used as a convenient controller for a second player or alternative control scheme to a keyboard on other games, and the axes don't even need to be utilized.