Wii controller

Has anyone had any success using a Wii controller with their games?



I want to be able to control a player using the infra red direction on the Wii, if this is not possible easily is there a way to do it it nicely with a mouse and use another application to interact with the wii to simulate the mouse?



Ideally like one of those old fashioned space games (x wing vs) where the player moves after the mouse for realism.



I can include the code to date if that helps?

I once made a simplistic moonbuggy style game with jME and the WiiMote using http://carl.kenner.googlepages.com/glovepie as a WiiMote->mouse pointer translator. GlovePIE works great on windows but does not support any other platform :’(

Thats great! Cheers!



Using the normal mouse controllers the thiung jumps like crazy! what did you use within jMonkey as the actual mouse controller?

it's very simple…

surprisingly so…


  1. get a native implementation of javax.comm, google it for whatever platform you are on, on mac i use



    http://www.rxtx.org/


  2. get a java implementation of the blue tooth stack…i use



    http://bluecove.sourceforge.net/


  3. get wiiremotej



    http://www.wiili.org/index.php/WiiremoteJ



    there is source in there to show you how to use it…

    plugging into jme is simple, add an "action" buffer to the wiiremote implementation and just poll that every update…

In fact, you could pretty easily create a custom GameControl (WiiGameControl?) to work with it and then you could allow control customizations for people that have a Wiimote and also allow people with just a mouse/keyboard/joystick to still play.

The player still jumps like crazy, how do i control the mouse element of the input handler…?



As in speed, accerlaration etc…

You can also use WiiUseJ, Api not so good, but works fine.



getting the wiimote under Control is a real hard thing,

there are only accelerometer inside, when you are quite still with the wii you can the Force, this you could put in an own written Joystick to use.

But when you make a fast Move, the Force is completly wrong, and you can only guess it.



Using the accelarion is much more harder, because the wii never known exalty where the ground is. Some People said always, you could calculate every Movement and Transformation, But all these guys have never programmed with the wii. 

as a hint to all this innovative GameControllerThing, we can advert the GameTrak-Controller here.

In the first tests it has shown quite nice results, for the absolute positions of your hands. (But only positions, no orientation)

The 2nd edition of the GameTrack will come up as a wireless controller this year… based on supersonic technology.

I don't know if it will support 6DOF… but hope so :wink:

greetz 2 hellg…

:smiley:

peace und lange haare!

I'm telling you…GameControls were designed for this and would very likely make it all a lot easier…it has joystick, keyboard, and mouse support already.  Adding Wii controls should be trivial…you would then be able to provide Wii support or use a mouse instead and your game wouldn't have to even think about the distinctions as it would simply be using a GameControl defined in your GameControlManager (which there's an example of a graphical control editor as well).

OK guys, I have taken your advice and used a custom GameControl



currently working on an algorithm for forwards backwards, but how do I set up absolute mouse control.


   public WiiInputController(Spatial m_character){
   this.m_character = m_character;
   GameControlManager manager = new GameControlManager();
    GameControl forward = manager.addControl("Forward");
    forward.addBinding(new KeyboardBinding(KeyInput.KEY_W));
    GameControl backward = manager.addControl("Backward");
    backward.addBinding(new KeyboardBinding(KeyInput.KEY_S));
    GameControl turnRight = manager.addControl("TurnRight");
    turnRight.addBinding(new MouseAxisBinding(MouseAxisBinding.AXIS_Y, true));
    turnRight.addBinding(new KeyboardBinding(KeyInput.KEY_A));
    GameControl turnLeft = manager.addControl("TurnLeft");
    turnLeft.addBinding(new KeyboardBinding(KeyInput.KEY_D));
    turnLeft.addBinding(new MouseAxisBinding(MouseAxisBinding.AXIS_Y, true));



and then


    t = new ThrottleController(m_character, forward, 1.0f, backward, -1.0f, 0.05f, 0.5f, 1.0f, false, Axis.Z);
    r = new RotationController(m_character, turnLeft, turnRight, 0.5f, Axis.Y);
    a = new ActionController(manager.getControl("Sail In"), sheetIn);



wierdly the keyboard controls for A and D work to control the player, but the mouse doesn't? any thoughts?

Tigger

Oh and I tried commenting out the A and D options, which still did not work

You could follow the same paradigm for the implementation of mouse support in GameControls and then have a custom Controller that takes a GameControl (if I recall, actually two…one for each axis) that uses the changes to move the mouse.  If you just get an absolute position on the screen back from it you could determine the change by keeping the previous position in memory and going from that.



However, GameControls may not be perfectly suited for absolute mouse…I've never tried this myself. I could understand how it would be useful though. You could actually modify your controls to move the mouse cursor with the wiimote, the mouse, and/or arrow keys without knowing any of the specifics in your code.