h1

Goodbye GlovePIE, Holla Java!

September 12, 2008

So, last night I rolled up a noob toon on Deathwhisper named Thules, just to test out my set up on Tortage.

 

Yeah…and… it actually worked! Minus a few bugs it was fairly successful. I ran around the island slicing left, right, down all the while bonking alligators with the giant broken oar I had. It didn’t quite get my heart pounding, but I can see a lot of potential for this.

 

If I can figure out a way to create a mechanism that makes your character jog when you jog, and turn right or left when you do (hehe, and jump when you jump!) it definitely would be better. And I know I am not going to accomplish this with the Dance Pad, so I’m going to have to retire it. But what would replace it?

I really wish the guys at http://virtualproductsllc.com/ would respond to the emails I send them, because that looks like something I could use. In the end I will probably do something like create a Wiimote/Nunchuck belt that responds to the up & down motion of jogging, and turning etc.

 

Even though I was able to use my rudimentary bonking and running abilities on Tortage, for some reason the IR mouse in my left hand was being stubborn, and none of the buttons on EITHER Wiimote were working properly. I think that my script is simply too complex for GlovePIE, or I am doing it wrong. Either way, I believe at this point it would be better to ‘borrow’ some projects done by others, and basically weave them together to make what I want. In that way, I would only have to learn a minimal amount of scripting/coding in Java instead of trying to start from scratch with GlovePIE. I’m going to use Java because theoretically it is a cross-platform language, and the gesture recognition library I want to use is written in Java as well.

 

So, looking at Java APIs for the Wiimote, I have these three so far:

 

WiiUseJ

A very simple Java based API for the Wiimote with a graphic UI that is fairly intuitive. It’s very similar to WiinRemote in that it can set commands for all the buttons, and do IR Mouse application. Aside from that, it doesn’t really support gesture recognition so I would have to figure out how to add WiiGee to it for swing recognition support.

 

Motej

“Motej is a slim Java library for Wiimote communication” according to their website.

It simply allows for Wiimote communication and the data from the Wiimote is as unchanged as possible. There seems to be several ‘packages’ that come with it that I don’t completely understand yet. Here are the features comprehensively listed though.

  • Discover and connect to Wiimote devices
  • Wiimote IR Camera in both basic and extended mode
  • Wiimote Accelerometer
  • Wiimote rumble feature
  • Wiimote player LEDs
  • Wiimote buttons
  • Read Wiimote EEPROM memory
  • Write Wiimote registers
  • Wiimote Status Information
  • Wiimote Calibration Data

So it definitely allows for comprehensive data gathering from a Wiimote. Now to interpret that data into actual key strokes might be a different monster all together.

 

Also, there is no graphic UI, so I might have to add that myself? (gulp) Although it provides several ‘demos’ with it.

 

Wiimote Simple

I’m not exactly sure how ‘Simple’ this API is. Although it claims to have “less functionality than WiiremoteJ” the features it lists are the same as Wiiremotej

The features listed are:

  • Read accelerometer data, useful for responding to dynamic swinging actions.
  • Read infrared camera data, useful for cursor pointing.
  • Respond to button pushes.
  • Vibrate Wiimote.
  • Set lights on the Wiimote
  •  

    The one thing that interests me is the “useful for responding to dynamic swinging actions” in that it mentions “swing” and not “flick” because so far the only action that I can read or interpret from the Wiimote is an almost-instantaneous flick action.

     

    In the end, I want to combine one of these API’s with the WiiGee Java-Based Recognition Library so that I can have button interpretation, an IR mouse, AND complex gesture recognition so that both Wiimotes will be able to properly & comprehensively communicate with AoC. So for now I’m dumping GlovePIE. It was great while it lasted, but unless I’m scripting retarded with it, I’m pretty sure that the language is a bit too limiting for what I want to do. Therefore, on to Java!

    I guess when I get home I’ll install Java and the Bluetooth Java Library etc and see how it all works. Maybe I know more about Java than I think I do.

    Advertisements

    5 comments

    1. You might find it tricky to feed keystroke events to AoC from Java; it very explicitly tries to avoid having to do things that require knowledge of the underlying hardware. You’ll probably end up having to link in a ‘C’ library to do that.

      I’m not a .NET programmer, so I can’t say this for sure, but I believe that .NET allows closer interaction with the underlying OS, since it’s Windows only. Once you’re in the .NET environment, you can program a quickie UI in Visual BASIC and then use their Java-variant to do the programming. Or just do the whole thing in VB.

      And as long you’re in the .NET world anyway, might as well just do the thing in C# for some creamy resume goodness.

      Good luck! Now that you’ll have a real language and all the events, doing gesture recognition should be TONS easier.


    2. Thanks Tipa, I appreciate it your advice a lot! My ‘big issue’ is that I would like to stand on the shoulders of giants who wrote the WiiGee library. While learning a bit of Java doesn’t sound that intimidating, learning how Hidden Markovian Models work is a bit over my head I believe. Also, I would love to be able to do 90% accurate gesture recognition, as that would introduce a whole different playing field for what I want to do.


    3. Well, just before you get too far, confirm you can feed keystrokes to AoC from your Java program. It would be very sad if you went through all the work and then couldn’t connect it to AoC.


    4. Beware the sniffers! You run the risk with ANY program that can control an MMO of being nailed as a cheater, *even if you aren’t*. If you can program something to attack a monster when you swing a wooden sword, then you can program something to attack a monster when you’re not even there.


    5. Ooh, thank you. I didn’t think about that.

      Well I was just going to have something that recognizes “Down Swing” and simply registers it as a keyboard press. Sort of like a Nostromo pad, but with a 3d environment. If anything it should make the game harder to play lol.

      I understand the issue of making macros etc, so I’m not going into the realm of packet sniffing. I simply want to re-route keyboard keys to be activated by a different controller on a 1:1 basis.



    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out / Change )

    Connecting to %s

    %d bloggers like this: