Previous Blog Next Blog
Prev/Next Blog
by date

Wii Remote Control in TGE is Working

Wii Remote Control in TGE is Working
Name:Rob Terrell 
Date Posted:Dec 15, 2006
Rating:4.8 out of 5
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Rob Terrell

Blog post
Hey, I've finally got something to blog about. So yeah, I got a Wii. You know, it's for the kids! It's not for me, honest, honey!

I was talking to a co-worker about the Wii, and we came up with a great idea for a Wii game. But, how to protoype such a thing?

When I got the Wii, I also got some extra controllers. One of those was for me. After following the progress of folks reverse-engineering and coding for the Wii remote I decided to try to hack some Wii remote support into TGE. You know, for the kids.

So far: it's working! And it's fun. Take a look at www.youtube.com/watch?v=o-5mlzf9KxQ
or a high-quality the screen capture movie (9 MB QuickTime). Ignore the dead-tired looking dweeb in the corner (he's actually having fun, that's how he shows it) and focus on the Wii remote in his hand. You can also see some of the console debugging in the background.



I don't have the left-right control as fine as I'd like it, but it's just a matter of fooling with it.

Edit: added YouTube video link.

See, I'm serious about TGE. Now, finally, for the love of god, won't someone let me join the Constructor beta?

Recent Blog Posts
List:08/09/08 - iPhone games!
04/08/07 - TGWii Code
12/21/06 - Wii Remote Beta Binary
12/18/06 - Wii Remote + IR Sensor Bar
12/15/06 - Wii Remote Control in TGE is Working

Submit ResourceSubmit your own resources!

Jeremy Alessi   (Dec 15, 2006 at 04:46 GMT)
Radical!

Gary "ChunkyKs" Briggs   (Dec 15, 2006 at 04:56 GMT)
I was gonna try exactly the same thing [now, if only Wiis weren't sold out here every single damn time I go to look; even the controllers are entirely inaccessible]!

I presume you've attached it to the mouse since you're using OSX and joystick code doesn't work? Or did you write a separate joystick/wiimote handler?

Gary (-;

Vashner   (Dec 15, 2006 at 05:00 GMT)   Resource Rating: 5
lol coolness.

edit: After reading it again. There is a market for new controllers for pc's and consoles.

Wii has a problem with extending the carpel but it's new thinking. Just would be good to see some folks invent some new controllers other than the old kiddie plastic ones that have been around for a while.
Edited on Dec 15, 2006 05:02 GMT

Rob Terrell   (Dec 15, 2006 at 05:02 GMT)
Wow, this went up quick. I just posted this on the Mac forum, sorry for the double post.

Right now it listens to the motion sensor for X and Y axis movement, and translates that into mouse movements: SI_XAXIS and SI_YAXIS events that are fed in via Game->postEvent(event). I've started support for the A and B buttons but I wasn't sure if I should make them into some new kind of keypress, or map them onto an existing keyboard character. Right now, A = space and B = return.

I thought about implementing the Wii stuff in the joystick functions, but I'm not sure how that all ties together. There seem to be assumptions throughout the code that Macs don't support joysticks. Now that the basic stuff is working, I'll probably migrate the code over and call it a joystick.

Also I'm planning on adding sensor bar support, so navigating GUIs is easier.
Edited on Dec 15, 2006 05:11 GMT

Charles B   (Dec 15, 2006 at 05:15 GMT)
one? you must be a mac user... ;)

I was thinking of getting a bunch and making a poor man's bone/skeleton motion capture rig with duct tape.

Todd Pickens   (Dec 15, 2006 at 05:16 GMT)
That kicks butt!

Ian Roach   (Dec 15, 2006 at 05:28 GMT)
Wow this is awesome :) Now i have to go buy a wii controller :)

Edward F. Maurina III   (Dec 15, 2006 at 05:40 GMT)   Resource Rating: 4
Good job! It is fun to see new tech applied to TGE.

Rock on!
Hall Of Worlds - For Gamers
EdM|GPGT


Matthew Spindle Harris   (Dec 15, 2006 at 05:48 GMT)
By far the coolest thing I have seen.

Joshua Dallman   (Dec 15, 2006 at 05:54 GMT)
Wow, now you can make TGE games that interface with both the XB360 controller and the Wii remote! (Plus the Guitar Hero controller let's not forget)

Dreamer   (Dec 15, 2006 at 06:44 GMT)
Just curious but did this void your warranty? :D
Congrats anyways.
Regards,
Dreamer

Rob Terrell   (Dec 15, 2006 at 06:55 GMT)
@Dreamer: no need -- the Wii remote is bluetooth. It just does a bluetooth discovery and searches the device list for the remote's unique device name.

Aaron E   (Dec 15, 2006 at 08:35 GMT)
@Rob

Cool, I almost bought a wii controller the other day, just to see if I could find a use for it in TGE. Now it looks like I have no other choice.

:)

Tom Bentz   (Dec 15, 2006 at 10:14 GMT)
Whoa! that is really cool! How long did it take to implement?

Samuel Nova   (Dec 15, 2006 at 11:13 GMT)
Very cool indeed. Just what I hoped would happen, if you get sensor bar working then even more awesome.
Then someone just have to make it work with TorqueX, so we can use it with the XBox 360 ;)

Regarding "the dead-tired looking dweeb", man, he should be a poker player....

Mincetro   (Dec 15, 2006 at 11:32 GMT)
I have a feeling Nintendo are going to be selling an unusually high amount of Wiimotes in comparison to Consoles in the future ;) - Having an official PC/Mac driver set for it would be a pretty awesome move for them imo.

Anthony   (Dec 15, 2006 at 12:02 GMT)
Wow, this would be an awesome resource! Perhaps when the code has reached a more useable state you could release it??? If you can, drop me an e-mail: anthonybertolo@gmail.com . I would love to talk more about this implementation :)

Samuel Nova   (Dec 15, 2006 at 12:06 GMT)
Main issue for PC/Mac people buying WiiMotes might be to get the sensor bars. Sure people can use candles and so, but maybe there is a market for sensor bars also ;)

Rob Terrell   (Dec 15, 2006 at 13:05 GMT)
@Samuel Nova: I haven't looked through the APIs, but I kind of doubt XNA includes any kind of bluetooth discovery and device enumeration.

As for the sensor bar -- the current code doesn't use one, but I hope to add it today. I went to radio shack and bought a couple of infrared ($1.99 each) LEDs. Each is wired to its own a AA battery and taped to the top of my powerbook lid. Incredibly lousy engineering, but it should work well enough to get into the game.

@Tom: It took about two hours to get to this point, but I started from a working example (http://sourceforge.net/projects/darwiin-remote/). Most of the time was spent trying to figure out how to properly call the Cocoa bluetooth APIs from Carbon. Also, the Cocoa code throws a SIGALRM (you can see it in the console output) and I had to figure out why that was happening -- it was the innocuous timing out of the bluetooth discovery, Cocoa throws signals for all kinds of stuff -- and catch it.

Cocoa requires some initialization stuff (creating an allocation pool) that nothing else in TGE needs, so I'll probably switch the code to Carbon. I hope to make a more abstract bluetooth library that can be implemented on both platforms. Unless I get lots of free time, I'll leave the Windows implementation to somebody else. You windows guys are always leaving us Mac guys hanging on implementation of fun stuff, so now it's payback time. ;)

And I've got to get our TGB game finished. This freelancing from the project milestones is going to get me in trouble.

Anthony Rosenbaum   (Dec 15, 2006 at 14:28 GMT)
Very Cool

Paul Dana   (Dec 15, 2006 at 14:30 GMT)
I am going to smile all day about this. :-)

Donald \"Yadot\" Harris   (Dec 15, 2006 at 14:47 GMT)
Man this is so promising. I hope that GG is doing something with Nintendo and will soon get us tools to create for this wonderful system.

Adam deGrandis   (Dec 15, 2006 at 16:54 GMT)
This is insanely cool. Wicked nice work.

JamD   (Dec 15, 2006 at 16:57 GMT)
Hi. I'm just curious, has anyone played around with GlovePIE for the wiimote to control TGE games on Windoze?

Jeppie   (Dec 15, 2006 at 18:24 GMT)
Pretty neat!

Here's some good laughs for the Wee-ites

http://www.wiidamage.com/

Clint Herron   (Dec 15, 2006 at 22:22 GMT)
So very cool. :) I've been wanting to buy a wiimote so I could hack with this on my wife's Mac, but you beat me too it it seems.

Very well done!
Edited on Dec 15, 2006 22:23 GMT

Ron Yacketta   (Dec 16, 2006 at 02:29 GMT)
Well, I have seen some realy kick arse stuff in blogs but have to say this trumps them all!!

Jeff   (Dec 16, 2006 at 06:27 GMT)
I must say...for the first time in a VERY LONG time...I'm impressed :)

Casey Weidner   (Dec 16, 2006 at 20:20 GMT)   Resource Rating: 5
urge to bluetooth rising!
Edited on Dec 16, 2006 20:20 GMT

Josh Williams   (Dec 16, 2006 at 20:23 GMT)
You rock. Nice work!! Yes, you can join the Constructor Beta. :)

Hopefully you'll release a resource + tutorial once you get this thing all polished up! Kick ass!

Florian   (Dec 17, 2006 at 00:24 GMT)
wow, VERY COOL 0.o
this is totaly amazing, imagine making wii games with torque
imagine the possibilities
image the perfect first person shooter with torque 0.o
me need to get a wii-mote :D
but i have some questions
is this also windows compactible?
and are you going to post this as a resource?
And do u only need a wii-mote to get this working or some bluetooth devices or a actual wii?
and will it be legal to make a game where u need a wimote for withouth having to ask for a licence to nitendo?
keep working on this, damn awesome man :D

You must be a member and be logged in to either append comments or rate this resource.