Wiimote plugin: the second coming

This forum is currently in read-only mode.
1 favourites
From the Asset Store
This is a Dungeon Master tool & the 1st of 12 Combat Engines from the Building Combat Engines for Browser Games workshop
  • Download here! Contains plugins and a test .cap. Link Updated 15. Jun 2010

    Source code here!

    Earlier this year I made a plugin that enables using a Wii remote in construct applications via bluetooth. Mostly it worked well but there was also issues I couldn't overcome. In addition, the Wiiuse API I used stopped being updated.

    I have started again, with cleaner code and a new API, Wiiyourself. It doesn't provide as nice readily-processed data as Wiiuse but has more functionality and is still in development. I didn't reuse anything from the old plugin so it's back to square one. No extra .dll is required any more.

    Requirements:

    • Wii remote
    • A bluetooth adapter
    • Wii sensor bar or similar infrared source for pointer functionality

    (two candles should work... )

    I have a cheapo Billionton bluetooth adapter. It uses the Toshiba bluetooth stack. I can't give instructions for every adapter out there but the procedure is usually similar: Hold 1+2 on your Wiimote until the lights begin to blink and tell your adapter to look for new BT devices. It's a relatively painless procedure but must be done every time you start your PC. The connect command on the plugin itself takes only a second.

    This first release has support for all the remote buttons (can be used as controls) and raw data from accelerometer + IR pointer. While gesture recognition (shaking, swinging) would be nice it's not trivial.

    Known issues:

    • Pointer does not correct for rotation
    • Values could be smoother

    Also worth noting: unlike the Xbox360 pad plugin, you need to add a new Wiimote plugin for each remote. This avoids have a controller number parameter in every ACE.

    (ACE list in next post)

  • == Actions ==

    Connect (connect to the first available remote)

    Disconnect

    Set report level (buttons only/+accelerometer/+infrared, higher settings use more power, balance board does not use this setting)

    Set rumble (on/off)

    Set LEDs (1/0 for each led)

    Set joystick deadzone (0.0 - 1.0, default 0.03, 1.0 would filter out everything )

    Reset weight calibration (recalibrate BB at rest)

    == Conditions ==

    Connected

    Connection lost

    Button pressed

    Button down

    Button released

    Nunchuk connected

    Is balance board (checks if this remote is actually a BB)

    == Expressions ==

    Pitch (In degrees -180 to 180)

    Roll (In degrees, -90 to 90, 0 is level, remote can't detect upside-down)

    Orientation X

    Orientation Y

    Orientation Z

    Acceleration X

    Acceleration Y

    Acceleration Z

    Battery level (percentage)

    IR X (interpolated 0-1.0 from all leds)

    IR Y (same as above)

    IR Z (Estimated led size, very rough)

    Raw IR X (led number 1-4)

    Raw IR Y (led number 1-4)

    IR Report level

    LED status (Sensor bar led groups seen, bar has 2 but remote can track 4)

    Update age (in milliseconds, if age is too much orientation data might be

    unreliable)

    Joystick X

    Joystick Y

    Nunchuk pitch

    Nunchuk roll

    Nunchuk acceleration X

    Nunchuk acceleration Y

    Nunchuk acceleration Z

    Nunchuk Orientation X

    Nunchuk Orientation Y

    Nunchuk Orientation Z

    Nunchuk Update age

    Nunchuk Deadzone X

    Nunchuck Deadzone Y

    Total weight (in KG)

    Top left weight

    Top right weight

    Bottom left weight

    Bottom right weight

  • Very nice! I'm glad you switched libraries; Wiiuse was slow as Hell. Do you have any plans to implement motion plus support since this library supports it?

    Keep up the good work.

  • I can definitely expose the raw data from Motion Plus, though someone else has to test as I don't have a MP yet.

  • Wow, this is awesome. I didn't try the first plugin because I didn't have a wiimote... But looking at this I'm probably gonna have to buy one just for the hell of using it in construct.

  • Oh man, this is really cool. I might have to give this a try.

  • nunchuck data would be awesome, also.

  • Brilliant, absolutely brilliant!

  • Hi, is it possible that someone would write a tutorial or walk through for this. It sounds really good... But it would be much easier if there was some sort of an example with explanation or tutorial how to use it in game. Many thanks if anyone will write it.

  • Hi, is it possible that someone would write a tutorial or walk through for this. It sounds really good... But it would be much easier if there was some sort of an example with explanation or tutorial how to use it in game. Many thanks if anyone will write it.

    There is an example included, which shows how it all works.

  • I've seen example and had a small testdrive, but a proper in game thing would be really helpful.

  • Updated this for 99.82: Wiimote-1.01.zip

    This version adds Nunchuk support. Updated ACE list:

    == Actions ==

    Connect (connect to the first available remote)

    Disconnect

    Set report level (buttons only/+accelerometer/+infrared, higher settings use more power)

    Set rumble (on/off)

    Set LEDs (1/0 for each led)

    Set joystick deadzone (0.0 - 1.0, default 0.03, 1.0 would filter out everything )

    == Conditions ==

    Connected

    Connection lost

    Button pressed

    Button down

    Button released

    Nunchuk connected

    == Expressions ==

    Pitch (In degrees -180 to 180)

    Roll (In degrees, -90 to 90, 0 is level, remote can't detect upside-down)

    Orientation X

    Orientation Y

    Orientation Z

    Acceleration X

    Acceleration Y

    Acceleration Z

    Battery level (percentage)

    IR X (interpolated 0-1.0 from all leds)

    IR Y (same as above)

    IR Z (Estimated led size, very rough)

    Raw IR X (led number 1-4)

    Raw IR Y (led number 1-4)

    IR Report level

    LED status (Sensor bar led groups seen, bar has 2 but remote can track 4)

    Update age (in milliseconds, if age is too much orientation data might be

    unreliable)

    Joystick X

    Joystick Y

    Nunchuk pitch

    Nunchuk roll

    Nunchuk acceleration X

    Nunchuk acceleration Y

    Nunchuk acceleration Z

    Nunchuk Orientation X

    Nunchuk Orientation Y

    Nunchuk Orientation Z

    Nunchuk Update age

    Nunchuk Deadzone X

    Nunchuck Deadzone Y

  • That's it! I'm going out to buy a wiimote just for this.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Sweet! I'm glad you're still working on this.

    Have you considered putting Motion Plus support in? I could always help out with testing in case you don't have one.

    EDIT: Looks like the download link is broken, so I can't try out the latest version.

  • Awesome work!

    Now.. about that balance board..

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)