This forum is in permanent archive mode. Our new active community can be found here.

Mario Kart 64 with a Wiimote on Computer

edited January 2007 in Technology
So instead of being a good student and doing my calculus homework this weekend, I learned how to hack a wiimote and wrote a script to play Mario Kart 64 on it. I plan on writing more scripts for other games/applications/uses soon. Some thoughts are a way to use the wiimote as a wireless controller for media functions on my computer (i.e controlling iTunes, internet T.V, ect).

Here is the video

Comments

  • Ok, that's cool, but I have a more challenging task in mind. Write a program for the computer that will trick the Wii itself into thinking the computer with Bluetooth is actually a Wiimote! Then you can do all sorts of crazy stuff. Control the Wii with the mouse and keyboard would be the tip of the iceberg. You could save and load infinite Miis from the Wii to the computer. You could also write scripts to do speed-runs of Wii games. Speed-runs are going to be very interesting on the Wii because of the incredibly dynamic and imprecise control scheme. This will be the key to getting the fastest possible times in games like Monkey Ball and Excite Truck. Heck, you might even be able to make Monkey Ball playable.
  • Write a program for the computer that will trick the Wii itself into thinking the computer with Bluetooth is actually a Wiimote!
    It already does that. Right now when I connect my wiimote through the bluetooth link several things occur. First off when queried by the SPD the Wiimote reports back tons of information. Here is the list of all the information that the computer recieves though the bluetooth connection. What is nice is that the wiimote follows the Bluetooth HID standard, which is the same standard that mice and keyboards use. If you want detailed information on how it works you can look at Wiili.org. While I haven't quite figured out how they got the low level communication working, I'm going to be going through the source code of the Windows applicaiton which emulates keyboard, mouse, and joystick listeners for the bluetooth connection and figure out how it takes the code and converts it into stack to communicate with the wiimote.
  • It already does that.
    Does it now? So you can play Wii games on your Wii using your computer as a controller and not a Wiimote?
  • Does it now? So you can play Wii games on your Wii using your computer as a controller and not a Wiimote?
    I misunderstood the question haha. I haven't tried it seeing as how I do not actually have a Wii, just a Wiimote. What one would have to do is figure how the wii's bluetooth drivers work and then fool it into thinking that the computer itself is an actual HID device, not a bluetooth hub.
  • Does it now? So you can play Wii games on your Wii using your computer as a controller and not a Wiimote?
    I misunderstood the question haha. I haven't tried it seeing as how I do not actually have a Wii, just a Wiimote. What one would have to do is figure how the wii's bluetooth drivers work and then fool it into thinking that the computer itself is an actual HID device, not a bluetooth hub.
    Yes, I know what you would have to do to make that work. I think what you have to do is read :)
  • edited January 2007
    *coughhalf-life2withthewiimotecough*

    [Edit] I just managed to get this to work myself with little difficulty. Did you really write the script? Because with GlovePIE, it includes a similar, Excite-Truck like control scheme for MK:64. There is also a script for controlling iTunes and Half-Life 2. Check out what is in there so as not to duplicate a game and waste your time.

    Anyway, I've found what I'm going to be doing with my Sunday! =)
    Post edited by Sail on
  • edited January 2007
    Here is my script. I had a problem with the included MK64 script in that it crashed GlovePIE when I ran it. My new script also allows you to have up to four players to play. I also looked into Scott's idea and it sounds like no one has attempted it because it's too hard. Sounds like a project for my friends and I this semester ^_^

    //This is the Analog MarioKart64 Script v1.0 for multiple players that does not use PPJoy by WaterIsPoison
    //It has only been tested in project64
    //Just configure the buttons for each player in the Options->Configure Controller Plugin... file
    //I find it easy if you save your config so you don't have to keep redoing it
    //It was modified from the Analog Racing Script 1.1 (No PPJoy required!) by Freeman Speaketh/US of Anarchy
    //Feel free to modify and redistribute, but leave this here

    //Debug and leds
    debug = "Tilt 1 = " + wiimote1.smoothpitch + ", Digital 1 = " + var.digital1 + ", Tilt 2 = " + wiimote2.smoothpitch + ", Digital 2 = " +var.digital2 + ", Tilt 3 = " + wiimote2.smoothpitch + ", Digital 3 = " +var.digital2 + ", Tilt 4 = " + wiimote2.smoothpitch + ", Digital 4 = " +var.digital2
    Wiimote1.led1 = 1
    Wiimote2.led2 = 1
    Wiimote3.led3 = 1
    Wiimote4.led4 = 1


    //Adjusts speed of steering (in percent)
    var.speed = 150
    //Adjusts minimum tilt to steer at all (in degrees)
    var.min = 5
    //Adjusts the most you want the wheel to turn (in degrees)
    var.max = 180

    //Single click the Home button to quit program, double click to exit GlovePIE (Works only with wiimote1)
    if doubleclicked(Wiimote1.Home){
    ExitPie
    else if singleclicked(Wiimote1.Home)
    ExitProgram
    }

    //Analog to Digital converter for Wiimote1
    var.digital1 = 100 / var.speed * (100 - math.abs(math.maprange(Wiimote1.smoothpitch,-var.max,var.max,-100,100)))
    //Analog to Digital converter for Wiimote2
    var.digital2 = 100 / var.speed * (100 - math.abs(math.maprange(Wiimote2.smoothpitch,-var.max,var.max,-100,100)))
    //Analog to Digital converter for Wiimote3
    var.digital3 = 100 / var.speed * (100 - math.abs(math.maprange(Wiimote3.smoothpitch,-var.max,var.max,-100,100)))
    //Analog to Digital converter for Wiimote4
    var.digital4 = 100 / var.speed * (100 - math.abs(math.maprange(Wiimote4.smoothpitch,-var.max,var.max,-100,100)))

    //This controls Wiimote1
    if Wiimote1.smoothpitch > var.min{ //right
    keyboard.Z = 1
    wait 1 ms
    keyboard.Z = 0
    wait var.digital1 ms

    else if Wiimote1.smoothpitch < - var.min //left
    keyboard.X = 1
    wait 1 ms
    keyboard.X = 0
    wait var.digital1 ms
    }


    //This controls Wiimote2
    if Wiimote2.smoothpitch > var.min{ //right
    keyboard.D = 1
    wait 1 ms
    keyboard.D = 0
    wait var.digital2 ms

    else if Wiimote2.smoothpitch < - var.min //left
    keyboard.F = 1
    wait 1 ms
    keyboard.F = 0
    wait var.digital2 ms
    }


    //This controls Wiimote3
    if Wiimote3.smoothpitch > var.min { //right
    keyboard.E = 1
    wait 1 ms
    keyboard.E = 0
    wait var.digital3 ms

    else if Wiimote3.smoothpitch < - var.min //left
    keyboard.R = 1
    wait 1 ms
    keyboard.R = 0
    wait var.digital3 ms
    }

    //This controls Wiimote4
    if Wiimote4.smoothpitch > var.min{ //right
    keyboard.2 = 1
    wait 1 ms
    keyboard.2 = 0
    wait var.digital4 ms

    else if Wiimote4.smoothpitch < - var.min //left
    keyboard.3 = 1
    wait 1 ms
    keyboard.3 = 0
    wait var.digital4 ms
    }


    //Accelerate and reverse and other buttons for Wiimote1
    Keyboard.C = Wiimote1.Two//B Buton
    Keyboard.V = Wiimote1.One//A Button
    Keyboard.B = Wiimote1.Right//D-Pad up button
    Keyboard.N = Wiimote1.Left//D-Pad down button
    Keyboard.M = Wiimote1.A//Z button
    Keyboard.A = Wiimote1.Up//L button
    Keyboard.S = Wiimote1.Down//R button
    Wiimote1.Rumble = Wiimote1.A //Rumbles when players presses Wiimote A button (uses item)


    //Accelerate and reverse and other buttons for Wiimote2
    Keyboard.G = Wiimote2.Two//B button
    Keyboard.H = Wiimote2.One//A button
    Keyboard.J = Wiimote2.Right//D-Pad up button
    Keyboard.K = Wiimote2.Left//D-Pad down button
    Keyboard.L = Wiimote2.A//Z button
    Keyboard.Q = Wiimote2.Up//L button
    Keyboard.W = Wiimote2.Down//R button
    Wiimote2.Rumble = Wiimote2.A //Rumbles when players presses Wiimote A button (uses item)

    //Accelerate and reverse and other buttons for Wiimote3
    Keyboard.T = Wiimote2.Two//B button
    Keyboard.Y = Wiimote2.One//A button
    Keyboard.U = Wiimote2.Right//D-Pad up button
    Keyboard.I = Wiimote2.Left//D-Pad down button
    Keyboard.O = Wiimote2.A//Z button
    Keyboard.P = Wiimote2.Up//L button
    Keyboard.1 = Wiimote2.Down//R button
    Wiimote3.Rumble = Wiimote2.A //Rumbles when players presses Wiimote A button (uses item)

    //Accelerate and reverse and other buttons for Wiimote4
    Keyboard.4 = Wiimote2.Two//B button
    Keyboard.5 = Wiimote2.One//A button
    Keyboard.6 = Wiimote2.Right//D-Pad up button
    Keyboard.7 = Wiimote2.Left//D-Pad down button
    Keyboard.8 = Wiimote2.A//Z button
    Keyboard.9 = Wiimote2.Up//L button
    Keyboard.0 = Wiimote2.Down//R button
    Wiimote4.Rumble = Wiimote2.A //Rumbles when players presses Wiimote A button (uses item)
    Post edited by Andrew on
  • The included one crashes for you? Hmm...weird. But I like your script better anyway =D
Sign In or Register to comment.