Friday 16 March 2007

Wiimote and Nunchuk applications on the PC

I have had a couple of days spare between jobs and I thought about some viral marketing for our sister website for fun and useful applications to experiment with. Partly because it is always good for a company, but also because it gives me a chance to write something funky and fun.

Games are always a passion of mine, and I have gained some skills recently with the Truevision 3D games engine, specifically to do with First Person Shooter (FPS) style gameplay. While looking around I became amazed by the breakthrough that has been made with getting the nintendo wii controls to work on a PC. There seems to be a few drivers emerging now and I have had a look at them to see what would aid me the best in a C# set of PC 3D games.

The best used wiimote driver has to be the GlovePIE set up.
I have found problems with this, in that you have to run the GlovePIE program and run a script before you can run your own program. This is too fidly for me. I then saw that somebody had embedded a wiimote driver inside a Half Life 2 mod which looked much better. They havent released their source code yet, so I have had to look elsewhere.
At the moment I am settling on one of two solutions:
1- A C++ driver that I should be able to translate to C# and embed
2- A C# driver.

I think I will go for the C# one because I believe that includes nunchuk support.

I think these drivers will be getting better and more robust. If they could attempt an auto pair setup with the wiimotes then that would be excellent but for now, you have to go through pairing the wiimote yourself before running any code. A quick hint on doing this is hold down the wiimote buttons 1+2, and add bluetooth device, then skip pairing and click finish, the wiimote should now be useable with your PC (I know some bluetooth stacks have had problems with this but I now think that these issues are fixed).

Anyway onto the game. The control is excellent, I have played around with oscillators and seen exactly what the PC reads when the wii is held in all manor of positions and moved.
I am not using the sensor bar for the main reason that I would like it if somebody could just go and buy a wiimote for around £30 and start using it on the PC. The sensor bar is only for steadying the pointer anyway so it isnt needed for the types of games I am thinking of doing.

This does lead me to think that there could be a whole new market opening up here for the PC gaming market. Nintendo have recently announced that they are selling their games development kits for around $2000, which while it is a lot cheaper than development kits for other consoles, it still isn't as cheap as Visual C# Express for the PC (its free). This means there is guaranteed to be a lot more homebrewers ready to develop games on the PC platform but using the wiimote's original input style. It also means there is a much bigger audience for the games.
While trying to find out the legalities with this and what Nintendo may try and do about it, I have come to the conlcusion that if I write a game for the PC, but it also caters for wiimote and nunchuk controlling then that should keep me legal as far as releasing any games to the masses.

I didnt want to get bogged down with the 3D graphics, and game design yet until I was sure that all pieces of the puzzle would work together. So for my first test I have so far put together a little world that you can run around, and in front of you are two objects: A wiimote, and a banana. These items were grabbed from the Google sketchup warehouse, there is no nunchuk there so that is why I chose a banana as it is a similar shape. At the moment the objects mimmick what the user is doing with the wiimote and nunchuk so I am now at a stage where I can introduce objects and physics and rules into the world to come up with some games.
My world screens:



I will keep my findings updated here and on my nintendo wii PC DOTNET section of our sister website. Next I will start to introduce some more objects, and physics and rules.

I dont want to list the ideas as I want to be the first to do them.

Cheers,

altFusion team.


1 comment:

Zygote said...

Yes the C# wiimote implementation on my site does contain nunchuck support.

I dont know how to do the "pairing" manually so I have left this as a TODO and released the source so one could modify it once this magic has been identified :)


Thanks,

Ziggy
www.ziggyware.com XNA News and Tutorials