Game controller

59 views
Skip to first unread message

Jeremy Kahn

unread,
Jul 31, 2012, 11:13:14 AM7/31/12
to pine-d...@googlegroups.com
At some point, we will need to think about game controllers. Since this project has a budget of nothing, designing our own controller is off the table (at least for the moment). Instead, I think we should go with a pre-existing PC controller. At first I wanted to use Xbox controllers, but they're $40, which is more than the cost of the Raspberry Pi. A controller that is more expensive than the computer it controls seems... flawed.

I'd like to discuss alternative controller ideas. We need some homogenous standard for Pine, something that developers can target. We can go with a Logitech controller that's been around for years (http://www.newegg.com/Product/Product.aspx?Item=N82E16826104402), or something cheaper if it's of decent quality.

What are your controller suggestions?

Jeremy Kahn

unread,
Jul 31, 2012, 11:17:02 AM7/31/12
to pine-d...@googlegroups.com

Scott Elcomb

unread,
Jul 31, 2012, 12:21:44 PM7/31/12
to pine-d...@googlegroups.com
Unless you're looking to package & ship PINE units, I wouldn't settle
on any specific controller, but rather a minimum-supported definition.
The controller you note above would be a good "base" definition to
work from.

An alternative might be to do things the Wii way, such that each game
specifies the minimum requirements for the controller (ie, 1 digital
pad + 2 buttons, or 2 analog pads + 4 buttons)

I'll start another thread to introduce myself a bit later, but I'll
note here that I am rather interested in helping see this project to
fruition.

Best regards,
- Scott.


--
Scott Elcomb
@psema4 on Twitter / Identi.ca / Github and more

Atomic OS: Self Contained Microsystems
http://code.google.com/p/atomos/

Member of the Pirate Party of Canada
http://www.pirateparty.ca/

Jeremy Kahn

unread,
Jul 31, 2012, 11:57:37 PM7/31/12
to pine-d...@googlegroups.com
At the moment, Pine is a software project.  While I would love to build and ship physical units, we are a long way off from that point.  That being said, my vision for Pine is to have a standard profile that hardware adheres to, much like you suggested.  I think that consistency across the userbase is extremely important for a game console, so it makes sense to have one "standard" controller.  I don't love the Wii approach of having different controller layouts for different games, as it goes against that consistency that I want Pine to achieve.

I think we should just "assume" a controller layout like the Logitech F310, minus the analog sticks.  That's a piece of complexity we can worry about later.

Luke Stebner

unread,
Aug 1, 2012, 2:39:56 AM8/1/12
to pine-d...@googlegroups.com
I'm sort of with Scott here, I don't think we have to regulate controllers at all. The Xbox controller has pretty much become the PC standard and is widely supported. Lots of gamer friends of mine have them just for PC gaming without even owning Xbox's. I think coming up with a way to show supported controllers in the marketplace is worthwhile, but trying to get developers to support certain ones isn't really our concern. 

Jeremy Kahn

unread,
Aug 1, 2012, 11:10:40 AM8/1/12
to pine-d...@googlegroups.com
That's a fair point. I think we can just specify a minimum set of buttons, and users can choose any controller that provides that set.  I'd like to eventually create a standard controller, but again that's something we will approach much later. 

I think the "standard" configuration should be that of the SNES, minus the select button: D-pad, start, 4 action buttons and two shoulder buttons.

On Jul 31, 2012, at 11:39 PM, Luke Stebner <luke.s...@gmail.com> wrote:

I'm sort of with Scott here, I don't think we have to regulate controllers at all. The Xbox controller has pretty much become the PC standard and is widely supported. Lots of gamer friends of mine have them just for PC gaming without even owning Xbox's. I think coming up with a way to show supported controllers in the marketplace is worthwhile, but trying to get developers to support certain ones isn't really our concern. 

--
You received this message because you are subscribed to the Google Groups "Pine" group.
To post to this group, send email to pine-d...@googlegroups.com.
To unsubscribe from this group, send email to pine-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/pine-discuss/-/S9RhymOVX5YJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Luke Stebner

unread,
Aug 1, 2012, 2:39:11 PM8/1/12
to pine-d...@googlegroups.com
Did you see the game controller API Alex had posted in one of the other threads? I think as long as developers support this and we note controllers that we know work with it then we will have enough of a standard; unless we get to the point of packaging a Pine with a controller.

Jeremy Kahn

unread,
Aug 1, 2012, 8:27:17 PM8/1/12
to pine-d...@googlegroups.com
That makes a lot of sense. Let's work to adhere to the Gamepad API. It's better to stick to a real standard than invent our own.

On Aug 1, 2012, at 11:39 AM, Luke Stebner <luke.s...@gmail.com> wrote:

Did you see the game controller API Alex had posted in one of the other threads? I think as long as developers support this and we note controllers that we know work with it then we will have enough of a standard; unless we get to the point of packaging a Pine with a controller.

--
You received this message because you are subscribed to the Google Groups "Pine" group.
To post to this group, send email to pine-d...@googlegroups.com.
To unsubscribe from this group, send email to pine-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/pine-discuss/-/3TLo0Fc5IpsJ.

Alex Wilson

unread,
Aug 1, 2012, 9:34:12 PM8/1/12
to pine-d...@googlegroups.com
Hi guys, sorry I've been so busy this week. I think having games specify what controllers they need is something we should look into, but supporting the game controller API should be sufficient to get us rolling. Supporting that API lets projects like gamepad.js be used, which considerably simplifies the API and makes it easy to detect what controller is being used. It might even be a good idea to offer an API like gamepad.js in the future to make it easier on game developers.

Jeremy Kahn

unread,
Aug 1, 2012, 10:30:29 PM8/1/12
to pine-d...@googlegroups.com
I'm hesitant to promote multiple controllers.  I don't think it benefits gamers to necessitate buying different hardware for different games.  Ultimately, this is something that we cannot and should not enforce - game developers can require whatever they like.  We can suggest best practices for Pine development, but there's little value in strictly policing other people's projects.  Our only job is to provide a bridge between games and hardware.

I definitely like the idea of rolling our own Gamepad API library if existing solutions don't work for us.  That's something we can make generic and reusable for other projects.

On Wed, Aug 1, 2012 at 6:34 PM, Alex Wilson <arex...@gmail.com> wrote:
Hi guys, sorry I've been so busy this week. I think having games specify what controllers they need is something we should look into, but supporting the game controller API should be sufficient to get us rolling. Supporting that API lets projects like gamepad.js be used, which considerably simplifies the API and makes it easy to detect what controller is being used. It might even be a good idea to offer an API like gamepad.js in the future to make it easier on game developers.

--
You received this message because you are subscribed to the Google Groups "Pine" group.
To post to this group, send email to pine-d...@googlegroups.com.
To unsubscribe from this group, send email to pine-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/pine-discuss/-/dirOb7VEavkJ.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Scott Elcomb

unread,
Aug 13, 2012, 1:05:14 PM8/13/12
to pine-d...@googlegroups.com
On Wed, Aug 1, 2012 at 10:30 PM, Jeremy Kahn <jerem...@gmail.com> wrote:
> I'm hesitant to promote multiple controllers. I don't think it benefits
> gamers to necessitate buying different hardware for different games.
> Ultimately, this is something that we cannot and should not enforce - game
> developers can require whatever they like. We can suggest best practices
> for Pine development, but there's little value in strictly policing other
> people's projects. Our only job is to provide a bridge between games and
> hardware.
>
> I definitely like the idea of rolling our own Gamepad API library if
> existing solutions don't work for us. That's something we can make generic
> and reusable for other projects.

I tried using the gamepad API on hardware, using
<http://www.html5rocks.com/en/tutorials/doodles/gamepad/> as a base.
It looks like Hexxeh's Chromium build is based on v22 which this
library doesn't take in to account. The library targets Chrome v21
and a special build of Firefox.

At least I suspect that's the case and that it's not a driver issue
because I do see my $5 Microsoft Sidewinder being discovered correctly
at boot time. From the developer's console in Chrome, I also see
navigator.webkitGamepads exists - so the browser does support it.
With v22, I believe the Chromium developers are trying to support
gamepad events (ala Firefox) rather than the polling required in v21.

Anyway, I didn't add my test app to the repo, but if anyone wants it
just ping me and I'll forward it to you. (After loosing a bunch of
time to fixing auto-pine, I threw together a quick replacement for
tester.js and gave it a UI that looks like it came right out of the
70's =D)

--
Scott Elcomb
@psema4 on Twitter / Identi.ca / Github & more

Jeremy Kahn

unread,
Aug 14, 2012, 12:44:00 AM8/14/12
to pine-d...@googlegroups.com
Would it be difficult to change Chromium versions on your test RPi?  Switching back to Chromium v21 will tell us very quickly if it is a Chromium version issue.  Aside from that, we may have to dive into the Chromium docs to see what is needed at a low level to make the Gamepad API work.

I did a quick Google search and found this.  It seems like a good smoke test at the very least.  I'm hoping that there isn't some weird USB susbsystem that needs to be wired together, and checking some simple stuff like this should help at least narrow down the issue.

--
You received this message because you are subscribed to the Google Groups "Pine" group.
To post to this group, send email to pine-d...@googlegroups.com.
To unsubscribe from this group, send email to pine-discuss...@googlegroups.com.

Scott Elcomb

unread,
Aug 14, 2012, 9:12:16 AM8/14/12
to pine-d...@googlegroups.com
On Tue, Aug 14, 2012 at 12:44 AM, Jeremy Kahn <jerem...@gmail.com> wrote:
> Would it be difficult to change Chromium versions on your test RPi?
> Switching back to Chromium v21 will tell us very quickly if it is a Chromium
> version issue. Aside from that, we may have to dive into the Chromium docs
> to see what is needed at a low level to make the Gamepad API work.
>
> I did a quick Google search and found this. It seems like a good smoke test
> at the very least. I'm hoping that there isn't some weird USB susbsystem
> that needs to be wired together, and checking some simple stuff like this
> should help at least narrow down the issue.

Not sure how difficult it'll be just yet; will see if I can get
something working this week and report back.

Jeremy Kahn

unread,
Sep 20, 2012, 12:25:14 AM9/20/12
to pine-d...@googlegroups.com
Revisiting this again...

I just took a quick peek at some Gamepad API docs.  It seems that the controller with the best support is the Xbox 360 wired controller, so let's standardize on that for this stage of the project.  I'll go out and buy one soon.

chris mccormick

unread,
Sep 20, 2012, 11:29:33 PM9/20/12
to pine-d...@googlegroups.com

Jeremy Kahn

unread,
Sep 20, 2012, 11:37:40 PM9/20/12
to pine-d...@googlegroups.com
Hi Chris, welcome to Pine. Thanks for the link! The price for those
controllers is certainly appealing, have you used any of them with the
HTML5 Gamepad API yet?

chris mccormick

unread,
Sep 28, 2012, 10:20:08 PM9/28/12
to pine-d...@googlegroups.com
Hi Jeremy,

Wow, HTML5 is moving fast, I didn't know there was a GamePad API already! Just found the flag in my browser and turned it on - super excited! Will do some testing with my Logitech USB Gamepad today.

I've just ordered this one from Shenzen:

It will take two to six weeks to get here. I'll let you know how well it works, build quality etc. once I receive it. My experience with previous orders on aliexpress is the quality of most products has been generally fine so I am pretty optimistic this would be a good option for Pine users. Will let you know.

Incidentally, I am the author of the jsGameSoup library: http://jsgamesoup.net/ - will definitely be adding gamepad support now. :)

Cheers,

Chris.

Jeremy Kahn

unread,
Sep 28, 2012, 10:42:36 PM9/28/12
to pine-d...@googlegroups.com
Wow, jsGameSoup looks really slick!  The demos and documentation are solid.  I tried to get my Logitech RumblePad 2 to play nicely with Chrome on some Gamepad API demos, but I didn't have any luck - hopefully you'll fare a little better.

Definitely let us know how your new controller works out.  I'd love to be able to standardize on a controller that costs less than a Raspberry Pi. :)

--
You received this message because you are subscribed to the Google Groups "Pine" group.
To post to this group, send email to pine-d...@googlegroups.com.
To unsubscribe from this group, send email to pine-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/pine-discuss/-/NKWLcWlazcwJ.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

chris mccormick

unread,
Sep 29, 2012, 10:21:18 AM9/29/12
to pine-d...@googlegroups.com
Hi!

I just issued a pull request to the gamepad.js maintainer for my Logitech Dual Action controller working on Chrome under Linux. Will do the same for the cheapo-controller when it arrives.

Cheers,

Chris.

Jeremy Kahn

unread,
Sep 29, 2012, 12:54:16 PM9/29/12
to pine-d...@googlegroups.com
Awesome, I didn't even know about gamepad.js!  I'll test your patch on my Mac and let you know how it goes as well.  Looks like I'll have to tweak it for the "isLinux" check.  Thanks for making the Pull Request, I will keep an eye on it!

Scott Elcomb

unread,
Oct 4, 2012, 10:22:49 PM10/4/12
to pine-d...@googlegroups.com
On Fri, Sep 28, 2012 at 10:20 PM, chris mccormick <mcco...@gmail.com> wrote:
> Incidentally, I am the author of the jsGameSoup library:
> http://jsgamesoup.net/ - will definitely be adding gamepad support now. :)

Odd as it sounds... I'm looking forward to playing with your soup! =D

Jeremy Kahn

unread,
Oct 25, 2012, 11:14:49 PM10/25/12
to pine-d...@googlegroups.com
I just added a small HTML5 Gamepad demo. It's just a fork of a demo by Raymond Camden.  It only works on Webkit, but so does Pine.  This demo works just fine with my three-year-old Logitech RumblePad 2.

Now I need to build Gamepad-based "escape" functionality into pine.env.js.  I'll get started on that soon.

Jeremy Kahn

unread,
Oct 29, 2012, 12:09:20 AM10/29/12
to pine-d...@googlegroups.com
I just pushed gamepad support for the Pine menus.  So that's kinda neat.  The usability is a little wonky and could use some fine-tuning, and I'll get to that at some point.  Right now it only supports my specific controller, but it's easy to add mappings to support whatever controllers we need.

Jeremy Kahn

unread,
Oct 30, 2012, 10:36:12 PM10/30/12
to pine-d...@googlegroups.com
I just added game exit functionality into the Standard Pine Library (that's what I'm calling the files in /api). When the user presses L1 + R1 + start, they are redirected back to the Pine app.

Jeremy Kahn

unread,
Oct 31, 2012, 1:27:31 AM10/31/12
to pine-d...@googlegroups.com
One last gamepad update - I just updated all of the demos and benchmarks to be controllable via a gamepad.  Now the the whole app can be controlled without a keyboard or mouse.

chris mccormick

unread,
Oct 31, 2012, 9:04:36 PM10/31/12
to pine-d...@googlegroups.com
The gamepad I bought from Shenzen for $6.90 (free shipping) arrived:


The build could be considered slightly on the "plasticky" side but the quality is basically fine otherwise.

Jeremy, I have a stupid question.

Where do I find the instructions to build and launch Pine so I can integrate this gamepad?

Cheers,

Chris.

PS I also found there is someone on the aliexpress site selling a Raspberry Pi unit so that is an interesting option.

Jeremy Kahn

unread,
Oct 31, 2012, 11:31:29 PM10/31/12
to pine-d...@googlegroups.com
Great, thanks for the update!  At the moment there are no instructions for actually setting up the dev environment, which is failing on my part.  I will document that more thoroughly ASAP.  Here' s a quick and dirty walkthrough (assumes you are using BASH):
  1. $: git clone https://github.com/jeremyckahn/pine.git
  2. $: cd pine/ui
  3. $: npm install
  4. $: node dev-server.js
  5. In Chrome, navigate to localhost:5000.  You are now looking at the Pine app.
  6. You'll need some info about your gamepad.  Click on "Gamepad Demo" in the menu.  It brings you to a little app.
  7. For me, this app can be flakey (I think it's an issue with Chrome).  You might have to refresh a few times, mash on the gamepad, and maybe wait a minute before the browser recognizes the controller and anything shows up.  Not sure why this is, but eventually you'll see a live readout of the controller state.
  8. The first line is the controller ID.  You will need this.  All of the other lines are the indexes that refer to each button.  Here's an example of what you should see.  Each button has a unique index.
  9. To add support for your controller, you need to add a mapping entry.  Take a look at the mapping for my Logitech controller and it should make sense.  The numbers correspond to the button indices in the Gamepad Demo page.
  10. To test your mapping, navigate to http://localhost:5000/sample_game/
Hopefully that helps.  Let me know if you'd like more clarification.  If you can get your controller working, please submit a Pull Request so we can improve support!

--
You received this message because you are subscribed to the Google Groups "Pine" group.
To post to this group, send email to pine-d...@googlegroups.com.
To unsubscribe from this group, send email to pine-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/pine-discuss/-/zaiHLrw11p0J.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jeremy Kahn

unread,
Nov 1, 2012, 12:16:59 AM11/1/12
to pine-d...@googlegroups.com
Oops, swap steps 2 and 3 in that last.  Sorry.

Jeremy Kahn

unread,
Nov 1, 2012, 12:57:17 AM11/1/12
to pine-d...@googlegroups.com
Okay, a more permanent home for the instructions are here: https://github.com/jeremyckahn/pine/wiki/Developer-Guide

chris mccormick

unread,
Nov 1, 2012, 1:34:43 AM11/1/12
to pine-d...@googlegroups.com
Nice one! Tomorrow during my 10% time I will have a crack at this.

Cheers,

Chris.
gamepad-shenzen-smaller.png

Jeremy Kahn

unread,
Nov 1, 2012, 1:38:20 AM11/1/12
to pine-d...@googlegroups.com
Cool!  And, uh, my correction was wrong.  The original instructions were correct.  You should just use the wiki link.  I need to stop doing development work at night. =p

--
You received this message because you are subscribed to the Google Groups "Pine" group.
To post to this group, send email to pine-d...@googlegroups.com.
To unsubscribe from this group, send email to pine-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/pine-discuss/-/QVVZ9cpGN0cJ.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

chris mccormick

unread,
Nov 2, 2012, 5:20:13 AM11/2/12
to pine-d...@googlegroups.com
Hey Jeremy,

I have this up and running now - awesome stuff! Thanks.

I've been trying to add my gamepad and I have a couple of comments:

 * Seems like gamepad.js uses just the Vendor and Product IDs - this would be a bit less flaky as the rest of the string might not always match 100%.

 * My controller has multiple buttons connected to a single 'axis' on the d-pad. E.g. "button" 6 reports -1 if the left D-pad is pressed and a positive 1 if the right one is. Your existing code doesn't map well to this. Gamepad.js has a solution to this.

 * Why not just use gamepad.js? You could have it as a git submodule. Then I don't have to add gamepad mappings to two different places. :)

If I did the work of integrating gamepad.js would you merge it?

Cheers,

Chris.

Jeremy Kahn

unread,
Nov 2, 2012, 11:17:20 AM11/2/12
to pine-d...@googlegroups.com
I was initially thinking that having such a long ID might be brittle too, but theoretically every gamepad of the same model should have the same ID string. I figured that specificity is better than ambiguity in this case, because we should only be making minimal assumptions about what gamepads users might have. 

Yeah, I haven't figured out a solution for gamepad axes yet. I took a look at Gamepad.js the other day in Chrome, and it told me that my browser was unsupported. I'm not married to my current gamepad solution (although I do like the current API), and if you can get Gamepad.js working, I'd be happy to merge it. It would be great if we could avoid reinventing the wheel. 
To view this discussion on the web visit https://groups.google.com/d/msg/pine-discuss/-/6OI8QzC2MFoJ.

Jeremy Kahn

unread,
Nov 3, 2012, 6:58:37 PM11/3/12
to pine-d...@googlegroups.com
FYI, if you're having trouble getting Chrome to recognize your controller, try unplugging it and plugging it back in.  That seems to do the trick for me.  The Chrome Developers are going for an old-school experience, clearly.
Reply all
Reply to author
Forward
0 new messages