Wiimote plugin

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Sun Feb 15, 2009 4:56 pm

New release! Features:

- Pointing (x, y, distance from screen)
- Button presses for all buttons
- Wiimote Yaw, requires IR
- Can set screen size, important to operate correctly
- Set sensor bar location above/below screen
- Enable/disable IR tracking



I didn't think I would bother with IR tracking yet but I found out I already had a suitable "sensor" bar from my EMS Topgun lightgun. Otherwise I would've probably built my own wireless bar, it's just a few IR leds after all.

I updated the example .cap. Press 1 on keyboard to enable pointing. Press A on the remote to keep spawning physics boxes where you are pointing.

Problems:

- Button presses are continuous
- One time there was weird lag with everything and I had to restart construct. If the cursor appears very unresponsive restart construct.
- Accelerometer values near 0 are still jumpy. Dunno if this is a hardware or API limitation.

Download
B
2
S
1
G
3
Posts: 71
Reputation: 1,142

Post » Mon Feb 16, 2009 6:53 pm

Damn, damn, damn this looks so cool. I wish I could try it out :(
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Feb 16, 2009 7:55 pm

I might have to buy a wiimote just to try this...
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Mon Feb 16, 2009 8:45 pm

this is seriously.... too. awesome. :shock: :mrgreen: i want to buy a wiimote just for this!
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Tue Feb 17, 2009 12:12 am

Construct is giving me an error saying that it can't load the plugin. :?

EDIT: Blah, scratch that. I accidentally got the regular and runtime version mixed up. :P
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Tue Feb 17, 2009 12:26 am

Just tested it out. I see that the lag is mostly gone now, which is really nice, but it seems that retrieving information from the Wiimote slows things down tremendously. On my own app, I went from having a framerate of 2000 to having one of around 50 when an object is set to rotate to the roll of the Wiimote. :?
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Tue Feb 17, 2009 10:15 am

If anybody is considering buying a Wiimote (and a BT adapter and some IR leds...) for just playing in construct, I would recommend importing them from Play Asia or similar store. At least around these parts the remotes are closer to 50 which is ridiculous. It's not a bad purchase even if you don't have a Wii, there's quite a bit of cool things to play around with.

For the BT adapters, there's some kind of compatibility list here. It has to support BT 2.0. I just bought a random adapter and was lucky.

Re: Framerate drop --
I never noticed that, but then again my framerate was capped at 50. I hope it's something that can be optimized away at a later stage. The way wiiuse works I poll for events on every OnFrame() and return 1 ("keep calling"). Maybe not the best way.

In any case, I'll do the interface first and then worry about the internals and code cleanliness. Even the wiimote api can be changed at a later stage, I just picked wiiuse since it was tiny.
B
2
S
1
G
3
Posts: 71
Reputation: 1,142

Post » Tue Feb 17, 2009 1:50 pm

[quote="Luomu":gvp0e189]Imy framerate was capped at 50.[/quote:gvp0e189]
What??? Why ever turn off V-sync? You'll make it look loads worse!
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Tue Feb 17, 2009 1:53 pm

And so it begins :).
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Tue Feb 17, 2009 1:57 pm

Just a pet peeve of mine, really :) V-sync makes the display quality a lot better, I don't know why anyone would want to turn it off.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

PreviousNext

Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests