Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Hello from BlackBerry, and a special promotion!

Discussion in 'BlackBerry' started by PBernhardt, Oct 9, 2013.

  1. PBernhardt

    PBernhardt

    Joined:
    Oct 9, 2013
    Posts:
    5
    Hello Folks!

    I wanted take the time to introduce myself to everyone here. My name is Paul Bernhardt, and I am an Application Development Consultant on the Developer Relations team at BlackBerry. I'll be hanging out on these forums in order to make things easy for you get your games onto the BlackBerry 10 platform. I'm a big gamer myself, and I think Unity is awesome, so I'm pretty excited to be helping out!

    Enough about me though. I thought it might be worthwhile to make sure you were all aware of the gamepad promotion we recently launched.

    Basically, if you build a game that's using our Gamepad API (which Unity does if you use gamepad controls) and submit it to BlackBerry World in draft mode by December 24th (and are one of the first 250 people to do so) we'll hook you up with a MOGA Pro and SteelSeries gamepad for free.

    When your app is approved, we'll put it into a gamepad-enabled feature in BlackBerry World.

    So, two free gamepads, and free feature placement, all for using something that's built into Unity. Sounds like a pretty good deal to me. You can get the full scoop here: http://devblog.blackberry.com/2013/09/gamepad-support-rewards/

    Also, I am always on the lookout for good gamepad games in general, both personally because I like to play them, and professionally because they make really good demos at conferences, so if you have one (now or after the offer) please let me know either here or on Twitter (@PBernhardt).

    Thanks, and happy coding!
     
  2. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,288
    Hi Paul - welcome aboard the Unity bus!
     
  3. WaterlooErik

    WaterlooErik

    Joined:
    Jul 22, 2013
    Posts:
    89
    Hello everyone, following Paul's example I too would like to introduce myself (I did briefly on another thread but this seems like a good place.) My name is Erik Oros and I too am on the Developer Relations team here at BlackBerry with Paul. My primary focus is HTML5 and Native gaming, and I'm excited to take part in these forums. Having come from Direct3D and WebGL roots, Unity is something like a holy grail for 3D developers and the titles that I've seen so far have been nothing short of brilliant.

    I too come bearing an offer. As most BlackBerry developers are likely already aware, we have a Built For BlackBerry certification program that you can apply for (once your application is reviewed in BlackBerry World) to help you further stand out in the storefront.
    https://developer.blackberry.com/builtforblackberry/

    One of the requirements for acceptance into the program is the integration of a BlackBerry service; Gamepad support being one of the criteria that can meet that requirement. We also offer In-App-Payment and Scoreloop plugins that you can read about here:
    http://forum.unity3d.com/threads/199823-BlackBerry-IAP-and-Scoreloop-Plugins-released!

    So, my offer to the community, if anybody is interested in the Built For BlackBerry program and would like a "pre-screening" of their application, feel free to fire me an email (eoros@blackberry.com) and we'll evaluate the application against the Built For BlackBerry criteria.
    https://developer.blackberry.com/builtforblackberry/documentation/criteria.html

    We'll also provide feedback on any areas that may need to be addressed in order to achieve the Built For BlackBerry designation. Know that this isn't an official review, and you will still need to undergo review through BlackBerry World. The goal here is to give you an idea of where you stand before submitting to the official review and iron out any potential issues to (hopefully) get your certification through on the first try.

    It's great to meet everyone and don't hesitate to reach out with any BlackBerry related questions.

    Cheers!
     
  4. PuneetK

    PuneetK

    Joined:
    Sep 2, 2013
    Posts:
    75
    Really want to use ScoreLoop plugin but the documentation is not clear for Unity. If you could get up a good looking tutorial on how to use ScoreLoop in Unity (not just include scoreloop as given in the ppt, but actually code for it) that would be great!
    Also, read somewhere on the forums that scoreloop is having some issues right now, any note on this?
     
  5. WaterlooErik

    WaterlooErik

    Joined:
    Jul 22, 2013
    Posts:
    89
    I'll see what I can do for a "Hello World" / Scoreloop sample. If anyone else in the community has something they'd like to share in the meantime, that's great as well.

    I'm not aware of any general Scoreloop issues, if you point me at the posts I might be able to provide more information / look into specifics, but as far as I know it should be just fine.
     
  6. Jmonroe

    Jmonroe

    Joined:
    Jul 7, 2012
    Posts:
    87
    Man I just saw your offer to pre-screen for built for Blackberry certification. If I get rejected, I'll ask you to take a look before trying again. Thanks and welcome to the forum guys!
     
  7. PuneetK

    PuneetK

    Joined:
    Sep 2, 2013
    Posts:
    75
    That would be great Eric!

    I'll tell you the basic issue me and a few other members of the community have faced regarding scoreloop.

    The documentation provided (ppt) gives the details of how to set up a scoreloop account, on the website, and how to set up achievements on the website, etc. The best possible slide, is the one that shows us how to include scoreloop in our unity code using the header file
    What we really require though, is HOW to program scoreloop INSIDE our code.
    Say for example

    if (condition)
    {
    levelcomplete = true;
    scoreloop achievement #1 unlocked << we need to code for this
    }
     
  8. WaterlooErik

    WaterlooErik

    Joined:
    Jul 22, 2013
    Posts:
    89
    Understood, I'll do my best to get as much of it in there as I can. I've also reached out to some of my colleagues on the gaming side to see if we already have something. Will keep you posted here.
     
  9. dberroa

    dberroa

    Joined:
    Dec 16, 2012
    Posts:
    141
    Hello to both of you.

    I have two questions:

    1. Is Blackberry going to make an official Ad SDK to help developers monetize their apps?

    2. Semi regarding the previous question, is there a way to access cascade classes in Unity Blackberry plugins? The native Ad SDK is not as well supported as the cascades version so our ads and plugin capabilities are not very good without cascade integration and our apps would look better and more "blackberry" if we were using the same classes as the native apps for the platform. If we had this then we would make our own Ad SDK off of the cascades ads.

    Thank you.
     
  10. EvilDingo

    EvilDingo

    Joined:
    May 7, 2011
    Posts:
    189
    Hi Erik,

    My games are doing about as well on Blackberry as they are on other platforms which keeps me very interested in the platform as a whole. I've been receiving emails about adding gamepad support to my games from players and would love to take you guys up on gamepad offer. I've edited my app's keywords to include gamepad and uploaded a draft release (my app is already on Blackberry world.) Is this enough to participate in the gamepad offer?

    Cheers!
     
  11. WaterlooErik

    WaterlooErik

    Joined:
    Jul 22, 2013
    Posts:
    89
    @dberroa: I'm not aware of an official plugin currently underway to tie into our Ad SDK. I have seen a community plugin (http://u3d.as/content/reign-studios/reign-bb10-support/5ys) if you're willing to spend a bit of money. That being said, given time/resources there definitely is value in providing such a plugin and I will reach out to my colleagues to see if anything is in the works. Plugins in general are a little outside of my area of expertise, but I'll try and find the answer regarding Cascades access.

    @EvilDingo: Can you put basically that same message into an email to BlackBerryDeveloperProgram@blackberry.com and CC me as well? (eoros@blackberry.com) I believe that should be enough to qualify initially (of course, ultimately leading to full Gamepad support inside your games) but it's best that we get the Program team in the loop to ensure the existing applications will get picked up in this way as well.
     
  12. EvilDingo

    EvilDingo

    Joined:
    May 7, 2011
    Posts:
    189
    Hi Erik,

    I've sent the email. For some reason, I forgot to add a subject line.

    Anyway, of course the point is to add gamepad support. Blackberry has a leg up on Android and iOS here as Unity supports gamepad input "out of the box" for Blackberry. Android and iOS require additional work to get input working.

    Thanks
     
  13. dberroa

    dberroa

    Joined:
    Dec 16, 2012
    Posts:
    141
    I own that plugin and it works quite well. I was asking in hopes of hearing that a cascades version was possible or in the makes as that one is native only atm as that is all that seems to be exposed.
     
  14. WaterlooErik

    WaterlooErik

    Joined:
    Jul 22, 2013
    Posts:
    89
    Glad we're getting some of these program questions resolved. If anyone else has questions about offers relating to shipments, etc. please feel free to email BlackBerryDeveloperProgram@blackberry.com and include me on the thread; we'll do our best to get it sorted ASAP.

    Regarding the question of Cascades APIs inside of a Unity plugin; the initial feedback appears to be "No". I'm digging further with our development teams to confirm and see if it is on the roadmap.

    And as for the Scoreloop plugin usage; I'm currently in the process of creating a sample application. So far I've gotten an "exploratory" landscape with Gamepad support. The next step is to get a proper Github repo to share it with, and following that (in the meantime) I will work on the Scoreloop integration. This area of Unity is quite new to me so I do appreciate your patience. I'm hoping to have something up in Github with Scoreloop integration over the next 1-2 weeks but hopefully sooner if all goes well.

    Cheers!
     
  15. dberroa

    dberroa

    Joined:
    Dec 16, 2012
    Posts:
    141
    Without Cascades support it seems that it is really hard to get any revenue for free games without trying to force in app purchases. If the native Ads have horrible fill rates and less functionality, it is almost pointless to use it.

    I haven't received an email yet for gamepad support (I added gamepad to my keywords on draft submission), so I emailed support and will get back on that here.
     
  16. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,085
    Not being funny, but the thing stopping me releasing BlackBerry versions of my games is not having a blackberry to test them on! I'm not yet willing to take a punt and buy one just to test my games on.
     
  17. dberroa

    dberroa

    Joined:
    Dec 16, 2012
    Posts:
    141
    They have given out Z10s in a few of their promotions. I personally haven't seen any promotions for Q10s and I feel like this would be better to have a test device for to make sure your game still works on a lower size and to test the keyboard inputs. I'm sure the Q10 users feel left out that there are less games for them, when we (developers) want to make games for them but we might not have the funds to buy a bunch of devices.

    Side note: If you guys are also looking into bugs, I may have found one: http://forum.unity3d.com/threads/206170-Playerprefs-not-working
     
  18. WaterlooErik

    WaterlooErik

    Joined:
    Jul 22, 2013
    Posts:
    89
    @dberroa: Are you seeing different fill-rates between the native and Cascades APIs? Technically, they should be using the same service on the back-end and really behave the same. Is this something you've seen yourself? If so, were you using the same Zone IDs or different? The main functionality I can see the Cascades APIs adding is the resizing of the returned ads, but the actual content should be the same. The fill-rates overall are something our native teams are working to improve; any improvement there would apply to Cascades as well.

    I saw the email come through about the Gamepad offer and will poke the Developer Program team on it.


    @arkon: Do you by chance already own a Unity Pro license? If so, check out this offer here: http://devblog.blackberry.com/2013/...free-version-now-fully-support-blackberry-10/. The offer includes the BlackBerry Pro license add-on as well as a Z10, which you can qualify for by uploading an application in Draft mode (i.e. doesn't need to go up for sale immediately.) I'm also happy to do general testing, as well as Built-For-BlackBerry pre-screening (i.e. more in-depth testing) and provide feedback to any developer that doesn't have access to a device.

    That being said, I know how much a device in-hand can help (the simulators are a good start, but sometimes you just need to see it running on a physical device.) We've had a stock of developer devices in the past and I'll check to see what we have available. If we have any on hand that we can send out I'll let you know.


    On a side note; will anyone be joining us at GDC Next in two weeks?
     
  19. dberroa

    dberroa

    Joined:
    Dec 16, 2012
    Posts:
    141
    Does the stock you mention have any Q10s?
     
  20. WaterlooErik

    WaterlooErik

    Joined:
    Jul 22, 2013
    Posts:
    89
    They would likely be Dev Alpha B (Z10-equivalent) and Dev Alpha C (Q10-equivalent) devices. They are developer phones which have comparable hardware to the in-market devices.
     
  21. WaterlooErik

    WaterlooErik

    Joined:
    Jul 22, 2013
    Posts:
    89
    I've been doing some digging and had a discussion with my colleagues; I was curious, which PPT exactly are you referring to?

    After installing the Scoreloop plugin from the Asset Store, I did find a ScoreloopSocial.pdf (under Assets > ScoreloopSocial) that explains the majority of account setup online, with initialization code:

    And a link to the online API documentation:
    http://docs.unity3d.com/Documentation/Components/net-SocialAPI.html

    If you create a new Project and import the ScoreloopSocial asset, you should also be able to open the default test scene file to get a look at a sample implementation.


    For updating achievement progress, you an leverage the ReportProgress API:
    http://docs.unity3d.com/Documentation/ScriptReference/Social.ReportProgress.html

    I am still working on a more complete sample of my own that I hope to make available in the Asset Store, but wanted to share my findings thus far.
     
  22. dberroa

    dberroa

    Joined:
    Dec 16, 2012
    Posts:
    141
    I got the email today for the gamepad offer to ship them. Thank you for your help.
     
  23. BrUnO-XaVIeR

    BrUnO-XaVIeR

    Joined:
    Dec 6, 2010
    Posts:
    1,687
    Welcome to the forums mr. Bernhardt.
     
  24. dberroa

    dberroa

    Joined:
    Dec 16, 2012
    Posts:
    141
    I got the gamepads from the offer and I have tried to integrate the Moga gamepad via analog stick and directional buttons. The button names listed here:

    http://devblog.blackberry.com/2013/06/blackberry10-gamepad-unity3d/

    Do not return anything and are not an option in the Unity input manager. For example, it seems there is no "Joystick1Button0"

    In the thread about Blackberry being dead, someone else mentioned that this isn't working for them as well.

    Any ideas?
     
  25. WaterlooErik

    WaterlooErik

    Joined:
    Jul 22, 2013
    Posts:
    89
    Hi dberroa, here is what I am using in my project. You are correct that the DevBlog article is different from what I needed to implement as well. I've sent this feedback to our team here to find out why this change occurred and will update the DevBlog article accordingly.

    This implementation works for me on both the Moga Pro and SteelSeries Free. Note that the Moga Pro must be in Mode B, while the SteelSeries Free must be in Gamepad mode (i.e. double-blink.) I haven't tested out the triggers yet but will give that a try today.

    Here are my Input Settings.

    $inputs.jpg

    L-X refers to the Left Joystick, X-Axis and the naming continues that way. I do also have Mouse input enabled to simplify testing on my PC between deployments, but it is not required.

    Here is the hierarchy for my project. The two important objects are Player (a capsule) and Main Camera (an associated first-person camera.)

    $hierarchy.jpg

    Player has two scripts attached. LookHorizontal.cs:

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class LookHorizontal : MonoBehaviour {
    5.     private float axisRaw = 0.0f;
    6.    
    7.     // Use this for initialization
    8.     void Start () {
    9.     }
    10.    
    11.     // Update is called once per frame
    12.     void Update () {
    13.         axisRaw = (Input.GetAxisRaw("R-X") + Input.GetAxisRaw("Mouse-X")) * 2.0f;
    14.         transform.Rotate(0.0f, axisRaw, 0.0f);
    15.     }
    16.    
    17.     void OnGUI() {
    18.         GUI.TextArea(new Rect(0, 0, 250, 40), "R-X: " + axisRaw);
    19.     }
    20. }
    And Movement.cs. This is a little more involved but the important pieces are the calls to Input.GetAxisRaw to read Joystick input and Input.GetKey / Input.GetKeyDown for the button controls.

    For me, the mappings used from the KeyCode values were the same as identified in the DevBlog post.

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class Movement : MonoBehaviour {
    5.     public float runSpeed = 0.4f;
    6.     public float walkSpeed = 0.2f;
    7.     public float slideSpeed = 0.3f;
    8.    
    9.     private Vector3 axisRaw = Vector3.zero;
    10.     private CharacterController controller = null;
    11.     private bool doubleJump = true;
    12.    
    13.     private Vector3 contactPoint = Vector3.zero;
    14.     private bool sliding = false;
    15.     private float slideLimit = 0.0f;
    16.    
    17.     private float raycastDistance = 0.0f;
    18.     private RaycastHit raycastHit;
    19.    
    20.     // Use this for initialization
    21.     void Start () {
    22.         controller = GetComponent<CharacterController>();
    23.         slideLimit = controller.slopeLimit - 0.1f;
    24.         raycastDistance = controller.height * 0.5f + controller.radius;
    25.     }
    26.  
    27.     // Update is called once per frame
    28.     void Update () {
    29.        
    30.         /* Gamepad movement. */
    31.         axisRaw.x = Input.GetAxisRaw("L-X");
    32.         axisRaw.z = Input.GetAxisRaw("L-Y");
    33.        
    34.         /* Keyboard movement. */
    35.         if (Input.GetKey(KeyCode.A)) { axisRaw.x -= 1.0f; }
    36.         if (Input.GetKey(KeyCode.D)) { axisRaw.x += 1.0f; }
    37.         if (Input.GetKey(KeyCode.W)) { axisRaw.z += 1.0f; }
    38.         if (Input.GetKey(KeyCode.S)) { axisRaw.z -= 1.0f; }
    39.        
    40.         /* Movement modifier. */
    41.         if (Input.GetKey(KeyCode.Joystick1Button2) || Input.GetKey(KeyCode.LeftShift)) {
    42.             axisRaw.x *= runSpeed;
    43.             axisRaw.z *= runSpeed;
    44.         } else {
    45.             axisRaw.x *= walkSpeed;
    46.             axisRaw.z *= walkSpeed;
    47.         }
    48.        
    49.         /* Allow movement even in the air. */
    50.         axisRaw = transform.TransformDirection(axisRaw);
    51.        
    52.         /* [Double] Jump mechanics. */
    53.         if (controller.isGrounded) {
    54.             sliding = false;
    55.             doubleJump = true;
    56.            
    57.             if (Physics.Raycast(transform.position, -Vector3.up, out raycastHit, raycastDistance)) {
    58.                 if (Vector3.Angle(raycastHit.normal, Vector3.up) > slideLimit) {
    59.                     sliding = true;
    60.                 }
    61.             } else {
    62.                 Physics.Raycast(contactPoint + Vector3.up, -Vector3.up, out raycastHit);
    63.                 if (Vector3.Angle(raycastHit.normal, Vector3.up) > slideLimit) {
    64.                     sliding = true;
    65.                 }
    66.             }
    67.            
    68.             /* We've lost our footing. */
    69.             if (sliding) {
    70.                 doubleJump = false;
    71.                 Vector3 hitNormal = raycastHit.normal;
    72.                 axisRaw = new Vector3(hitNormal.x, -hitNormal.y, hitNormal.z);
    73.                 Vector3.OrthoNormalize (ref hitNormal, ref axisRaw);
    74.                 axisRaw *= slideSpeed;
    75.             } else {
    76.                 if (Input.GetKeyDown(KeyCode.Joystick1Button0) || Input.GetKeyDown(KeyCode.Space)) {
    77.                     axisRaw.y = 0.8f;
    78.                 } else {
    79.                     axisRaw.y = -0.20f;
    80.                 }
    81.             }
    82.         } else if (doubleJump) {
    83.             if (Input.GetKeyDown(KeyCode.Joystick1Button0) || Input.GetKeyDown(KeyCode.Space)) {
    84.                 doubleJump = false;
    85.                 axisRaw.y = 0.8f;
    86.             }
    87.         }
    88.  
    89.         axisRaw.y -= 0.02f;
    90.         controller.Move(axisRaw);
    91.     }
    92.    
    93.     void OnControllerColliderHit(ControllerColliderHit hit) {
    94.         contactPoint = hit.point;
    95.     }
    96.    
    97.     void OnGUI() {
    98.         GUI.TextArea(new Rect(0, 80, 250, 40), "L-X: " + axisRaw.x + " " + doubleJump);
    99.         GUI.TextArea(new Rect(0, 120, 250, 40), "L-Y: " + axisRaw.z + " " + sliding + " " + raycastDistance);
    100.     }
    101. }
    Finally, the Main Camera object has the LookVertical.cs script attached.

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class LookVertical : MonoBehaviour {
    5.     private float axisRaw = 0.0f;
    6.    
    7.     // Use this for initialization
    8.     void Start () {
    9.     }
    10.    
    11.     // Update is called once per frame
    12.     void Update () {
    13.         axisRaw = (Input.GetAxisRaw("R-Y") + Input.GetAxisRaw("Mouse-Y")) * 2.0f;
    14.         transform.Rotate(axisRaw, 0.0f, 0.0f);
    15.     }
    16.    
    17.     void OnGUI() {
    18.         GUI.TextArea(new Rect(0, 40, 250, 40), "R-Y: " + axisRaw);
    19.     }
    20. }
    Again, both Gamepad and Mouse inputs are being used to simplify my testing, but the Mouse values are not required for Gamepad implementation.
     
    Last edited: Oct 30, 2013
  26. EvilDingo

    EvilDingo

    Joined:
    May 7, 2011
    Posts:
    189
    Hi Erik,

    Can you confirm if the gamepad name is "MOGA Pro" for the MOGA Pro or does it show as "SteelSeries FREE"? Use the GetJoystickNames function to return what was detected. My experience is none of the buttons map as they're shown in the instructions (there is no Joystick1Button0 for example) and the trigger axis on the MOGA Pro aren't mapped. Also the digital pad only has the X axis. Do those all work for you?

    All of those issues might be explained if Unity is applying a SteelSeries profile to a MOGA Pro controller and what seems like dozens of issues, might just be one simple one.

    Of course the MOGA Pro is in mode B. It won't connect to the Z10 in mode A at all.
     
  27. dberroa

    dberroa

    Joined:
    Dec 16, 2012
    Posts:
    141
    I've attached an image of my input settings. What I am trying to do is similar to the prebuild way the axis is handled for the keys on the keyboard. On the top of the image you can see the built in Unity one that has A and D and Left and Right mapped to horizontal. I'm trying to do that with the gamepad so joystick left and right and the joystick buttons for the directional button all correspond to "horizontal". If I type in "Joystick1Button0" in the input manager it doesn't take it. I managed to get it to take the new one I have in the image, but it doesn't work.

    I haven't tried your code, but if it does work for me, that means I would have to be like "if right button pressed add 1, else if left button -1 etc" for the buttons instead of having unity handle it via the input manager (then again I could be completely misinterpreting something).

    $unity input.png
     
  28. AlexThibodeau

    AlexThibodeau

    Unity Technologies

    Joined:
    Jul 23, 2013
    Posts:
    309
    Unity actually isn't doing anything special based on which gamepad is detected. We're using the same button mapping for both controllers. In the next release of Unity though the mapping (in particular the moga pro) will match up to the xbox 360 controller button mapping.

    EvilDingo please submit a bug report with your project and either I or our QA guy will take a look at it for you.
     
    Last edited: Oct 31, 2013
  29. dberroa

    dberroa

    Joined:
    Dec 16, 2012
    Posts:
    141
    Is the mapping you are talking about the reason why my above settings do not work?
     
  30. EvilDingo

    EvilDingo

    Joined:
    May 7, 2011
    Posts:
    189
    Hi Alex,

    I've submitted a bug. If both controllers map the same, my project might be playable, but it took some input hacks to get it to work correctly, particularly the fact that a slight push on the stick registers a full push and a full push registers as a small one. Also, the controller input rests at whatever value was put into the sensitivity field in the InputManager. If I put 1 as the axis sensitivity, the neutral position (without touching the controller) registers 1. This causes the game to interpret the user as pressing the stick all the way to the side.
     
  31. WaterlooErik

    WaterlooErik

    Joined:
    Jul 22, 2013
    Posts:
    89
    For me, when I have my Moga Pro connected, it is displaying as:
    Android Controller Gen-2(ACC)

    The majority of my testing has been on-device, but I will implement the same controls and test the Moga Pro / PC combination today.


    EDIT 1

    After further testing, here is what I found under the Android Controller Gen-2(ACC) profile.

    Buttons
    • X, Y, A, B map to Button2, Button3, Button0, Button1; respectively.
    • R1, L1 map to Button5, Button4; respectively.
    • Start, Select map to Button7, Button6; respectively.

    Axes
    • Left Joystick Left/Right, Up/Down map to X axis, Y axis; respectively.
    • Right Joystick Left/Right, Up/Down map to 3rd axis, 4th axis; respectively.
    • D-Pad Left/Right, Up/Down map to 5th axis, 6th axis; respectively.

    This maps everything except R2 and L2; this may be a Windows driver issue based on some readings online. These should technically be Axes since they are pressure sensitive. But they do not appear to be mapped given the Android Controller Gen-2(ACC) profile on the PC.


    The SteelSeries FREE showed up as simply Gamepad on my PC. The Axes were the same as the Moga Pro, but the buttons differed:
    • X, Y, A, B equivalents (1, 2, 4, 3) map to Button3, Button4, Button0, Button1; respectively.
    • R1, L1 map to Button7, Button6; respectively.
    • Start, Select map to Button11, Button12; respectively.

    A screenshot of my test app mapping all KeyDown events, Joystick names, and Axes values.

    $Untitled.jpg

    I will validate the same mappings against the Moga Pro running on a BlackBerry 10 device (10.2).

    EDIT 2

    Testing the MOGA Pro on a BlackBerry 10 device, my profile is coming up as BlackBerry Gamepad :: SteelSeries FREE. The mappings were as follows.

    • X, Y, A, B map to Button2, Button3, Button0, Button1; respectively.
    • R1, L1 map to Button5, Button4; respectively.
    • Start, Select map to Button7, Button6; respectively.
    • Right Joystick Left/Right, Up/Down map to 4th axis, 5th axis; respectively.
    • D-Pad Left/Right, Up/Down map to 6th axis, 7th axis; respectively.

    R2 and L2 still do not register under any identifiable Button or Axis.


    Final comparison, actually using a SteelSeries FREE gave me the same profile on my BlackBerry 10 device as the Moga Pro; specifically: BlackBerry Gamepad :: SteelSeries FREE

    All Buttons and Axes on the SteelSeries FREE matched that of the Moga Pro; which is not surprising since they share the same profile.


    I have a meeting with the BlackBerry team in charge of Unity next week and will provide them with these findings (and test application) to see what their feedback is.


    EDIT 3

    Final edit I hope. For reference, the code I am using within OnGUI to display all of these details is as follows.

    Code (csharp):
    1.     void OnGUI() {
    2.         /* Button details. */
    3.         Array values = Enum.GetValues(typeof(KeyCode));
    4.         for(int x = 0; x < values.Length; x++) {
    5.             GUI.Label(new Rect((x % 6) * 180.0f, (x / 6) * 20.0f, 180.0f, 20.0f), Input.GetKey((KeyCode)values.GetValue(x)) + ": " + values.GetValue(x).ToString());
    6.         }
    7.        
    8.         /* Joystick name details. */
    9.         int index = 0;
    10.         string[] names = Input.GetJoystickNames();
    11.         foreach(string name in names) {
    12.             GUI.Label(new Rect(100.0f, index * 20.0f, 360.0f, 20.0f), index + ": " + name);
    13.             ++index;
    14.         }
    15.        
    16.         /* Axis details. */
    17.         GUI.Label(new Rect(1100.0f, index * 20.0f + 20.0f, 360.0f, 20.0f), Input.GetAxisRaw("X axis") + ": X axis");
    18.         GUI.Label(new Rect(1100.0f, index * 20.0f + 40.0f, 360.0f, 20.0f), Input.GetAxisRaw("Y axis") + ": Y axis");
    19.         GUI.Label(new Rect(1100.0f, index * 20.0f + 60.0f, 360.0f, 20.0f), Input.GetAxisRaw("3rd axis") + ": 3rd axis");
    20.         GUI.Label(new Rect(1100.0f, index * 20.0f + 80.0f, 360.0f, 20.0f), Input.GetAxisRaw("4th axis") + ": 4th axis");
    21.         GUI.Label(new Rect(1100.0f, index * 20.0f + 100.0f, 360.0f, 20.0f), Input.GetAxisRaw("5th axis") + ": 5th axis");
    22.         GUI.Label(new Rect(1100.0f, index * 20.0f + 120.0f, 360.0f, 20.0f), Input.GetAxisRaw("6th axis") + ": 6th axis");
    23.         GUI.Label(new Rect(1100.0f, index * 20.0f + 140.0f, 360.0f, 20.0f), Input.GetAxisRaw("7th axis") + ": 7th axis");
    24.         GUI.Label(new Rect(1100.0f, index * 20.0f + 160.0f, 360.0f, 20.0f), Input.GetAxisRaw("8th axis") + ": 8th axis");
    25.         GUI.Label(new Rect(1100.0f, index * 20.0f + 180.0f, 360.0f, 20.0f), Input.GetAxisRaw("9th axis") + ": 9th axis");
    26.         GUI.Label(new Rect(1100.0f, index * 20.0f + 200.0f, 360.0f, 20.0f), Input.GetAxisRaw("10th axis") + ": 10th axis");
    27.     }
    Of course, this assumes the Input Settings have an existing Axis created for each Joystick Axis; named to match the Axis it represents.

    It's not pretty, but it got me the info I needed.
     
    Last edited: Nov 15, 2013
  32. dberroa

    dberroa

    Joined:
    Dec 16, 2012
    Posts:
    141
    Evil, with the settings set to what I have in the picture in my above post, I am able to get my analog sticks on my moga pro to handle a slight push.

    Analog sticks are working fine for me, its the directional buttons that don't seem to be when using the above input manager.
     
  33. WaterlooErik

    WaterlooErik

    Joined:
    Jul 22, 2013
    Posts:
    89
    dberroa, I added additional information regarding the PC mappings for the Moga Pro given the profile that I am seeing. Do the 5th and 6th axes register for your directional buttons as they did for mine?
     
  34. dberroa

    dberroa

    Joined:
    Dec 16, 2012
    Posts:
    141
    I added another two entries for the 6th and 7th axis and those detect the directional pad buttons fine.

    For my game, I'm only controlling the character via analog sticks, direction buttons, and using the A Button for menu input. With the axis setup as first, second, sixth, and seventh axis I get all the analog sticks and directional buttons, and NGUI properly detects the A button.

    The only issue I am having now with the controller is when I first tested these I paired my moga pro and tested and it worked. I then paired my steelseries and it worked as well. I had them both connected at once and everything was good. I turned off both controllers and now when I turn them on, both will connect via bluetooth but only the moga is detected by my game. All the inputs on the steelcase is not getting detected by my game.

    I tried holding the a and b button on the steel series to change it from one blink light mode to two but it doesn't seem to help.

    Any ideas?
     
  35. dberroa

    dberroa

    Joined:
    Dec 16, 2012
    Posts:
    141
    Also I can't remember if this was mentioned but:

    "Assuming your Bluetooth is turned on and the gamepad is in the pairing mode, you should be able to detect a gamepad by simply checking Input.GetJoystickNames() in your script’s update() for “BlackBerry Gamepad”."

    The article mentioned that, but it doesn't seem Blackberry Gamepad is getting returned when I call that function.
     
  36. WaterlooErik

    WaterlooErik

    Joined:
    Jul 22, 2013
    Posts:
    89
    Great to hear it's coming along, and I do apologize for the input mapping confusion. I'm in the midst of writing a blog post to clarify the correct implementation and we'll update the original article as well with that information. In the meantime, the mappings mentioned in my post above should work.

    I did make a mistake earlier. I can't recall where, but I mentioned the use of double-blink mode for the SteelSeries Free, that is incorrect. The single-blink mode is the correct HID Profile that you need for compatibility with our devices. Can you please verify whether the single-blink mode on the SteelSeries Free pairs with your device using the HID profile and that it still does not get detected by your game?

    Note that the full profile name that I saw returned was BlackBerry Gamepad :: SteelSeries FREE so if you are checkign for "BlackBerry Gamepad", makes sure you are checking whether the name contains that string, not that they're equal, otherwise the name may actually contain more content and an equality check will fail.
     
  37. dberroa

    dberroa

    Joined:
    Dec 16, 2012
    Posts:
    141
    The single blink mode was on before and it didn't pair, HOWEVER for some reason now it is immediately when I turned it on. Sheesh. I probably was doing something wrong or something.

    In terms of the name, I was doing a string.equals on "BlackBerry Gamepad". Changing that to String.Contains made it work. Thank you!

    I have submitted my app to the store.
     
  38. dberroa

    dberroa

    Joined:
    Dec 16, 2012
    Posts:
    141
    Can anyone tell me where the Gamepad Enabled part of the store is? My game was approved and I wanted to see if it showed up there but I can't actually find that area in the Blackberry World app.

    Thanks.
     
  39. WaterlooErik

    WaterlooErik

    Joined:
    Jul 22, 2013
    Posts:
    89
    The Gamepad Enabled category isn't live just yet. This week we'll be reaching out to developers that submitted gamepad enabled applications with feedback. Those that met all the criteria will be included in the category, those that did not will still be able to fix any issues and be a part of the category. I have a meeting with the program team this week and will try to confirm the official launch date.
     
  40. icreate

    icreate

    Joined:
    Jul 13, 2012
    Posts:
    25
    For whoever working on gamepad support, Unity 4.3 has two specific features for Blackberry.
    -an option to mark the game as it has support for gamepad.
    -mapping the triggers to match xbox 360
     
  41. AlexThibodeau

    AlexThibodeau

    Unity Technologies

    Joined:
    Jul 23, 2013
    Posts:
    309
    icreate you beat me to it. :)
     
  42. WaterlooErik

    WaterlooErik

    Joined:
    Jul 22, 2013
    Posts:
    89
    Great information :) I'll be sure to add the Gamepad Support config option into the upcoming blog (set to go live in the next few days.)

    Regarding the Xbox 360 controls, do you mean that there are axis/button mappings now for the controller that you can configure your Input settings with? Or do you mean that there is some additional Xbox 360 "mode" you can enable within the configuration? I can't seem to find specific information beyond the default Input mappings.
     
  43. AlexThibodeau

    AlexThibodeau

    Unity Technologies

    Joined:
    Jul 23, 2013
    Posts:
    309
    It was an ease of use change for users who already have mappings for other games that already had controller support for the xbox 360 controller on other platforms. This makes it so they don't need to change their mapping based on the platform that they are deploying for.

    The Mapping:

    [table="width: 500, align: left"]
    [tr]
    [td]No.[/td]
    [td]Button Name[/td]
    [td]KeyCode[/td]
    [td]Axis#[/td]
    [td] Comments [/td]
    [/tr]
    [tr]
    [td]1[/td]
    [td]A (Green)[/td]
    [td]JoystickButton1[/td]
    [td]N/A[/td]
    [td][/td]
    [/tr]
    [tr]
    [td]2[/td]
    [td]B (Red)[/td]
    [td]JoystickButton2[/td]
    [td]N/A[/td]
    [td][/td]
    [/tr]
    [tr]
    [td]3[/td]
    [td]X (Blue)[/td]
    [td]JoystickButton2[/td]
    [td]N/A[/td]
    [td][/td]
    [/tr]
    [tr]
    [td]4[/td]
    [td]Y (Yellow)[/td]
    [td]JoystickButton3[/td]
    [td]N/A[/td]
    [td][/td]
    [/tr]
    [tr]
    [td]5[/td]
    [td]Left Stick[/td]
    [td]JoystickButton8[/td]
    [td]Axis 1 (X) - Horizontal, Axis 2 (Y) - Vertical[/td]
    [td]Range [-1; 1][/td]
    [/tr]
    [tr]
    [td]6[/td]
    [td]Right Stick[/td]
    [td]JoystickButton9[/td]
    [td]Axis 4 - Horizontal, Axis 5 - Vertical[/td]
    [td]Range [-1; 1][/td]
    [/tr]
    [tr]
    [td]7[/td]
    [td]Dpad[/td]
    [td]N/A[/td]
    [td]Axis 6 - Horizontal, Axis 7 - Vertical[/td]
    [td]Set {-1, 0, 1}[/td]
    [/tr]
    [tr]
    [td]8[/td]
    [td]Back[/td]
    [td]JoystickButton6[/td]
    [td]N/A[/td]
    [td][/td]
    [/tr]
    [tr]
    [td]9[/td]
    [td]Start[/td]
    [td]JoystickButton7[/td]
    [td]N/A[/td]
    [td][/td]
    [/tr]
    [tr]
    [td]10[/td]
    [td]Left Trigger[/td]
    [td]N/A[/td]
    [td]Axis 9[/td]
    [td]Range [0; 1][/td]
    [/tr]
    [tr]
    [td]11[/td]
    [td]Right Trigger[/td]
    [td]N/A[/td]
    [td]Axis 10[/td]
    [td]Range [0;1][/td]
    [/tr]
    [tr]
    [td]12[/td]
    [td]Left Bumper[/td]
    [td]JoystickButton4[/td]
    [td]N/A[/td]
    [td][/td]
    [/tr]
    [tr]
    [td]13[/td]
    [td]Right Bumper[/td]
    [td]JoystickButton5[/td]
    [td]N/A[/td]
    [td][/td]
    [/tr]
    [/table]



    The left is the mapping that was followed and is the current mapping you'll get when using the moga pro. (Unless I typoed something)
     
  44. PuneetK

    PuneetK

    Joined:
    Sep 2, 2013
    Posts:
    75
    This is the mapping if we mimic the X360 controls?
    Also, where is the option to mimic x360 controller mapping?

    Another question,
    what's the best way to get input from the joystick? I'm having issues with getAxisRaw.
     
  45. TuesdayNinja

    TuesdayNinja

    Unity Technologies

    Joined:
    Apr 23, 2013
    Posts:
    17
    Guys -

    If you're still having trouble with your controller, try dLing 4.3. I think we've fixed most of the issues that were brought up here.

    Thanks,
     
  46. PuneetK

    PuneetK

    Joined:
    Sep 2, 2013
    Posts:
    75
    Had a huge discussion with Erik on this, but the Steelseries FREE does not seem to work at all in the Unity editor (both 4.2 and 4.3). It works fine on the Blackberry devices, but in editor it has many bugs.
    Please look into it if possible.
     
  47. WaterlooErik

    WaterlooErik

    Joined:
    Jul 22, 2013
    Posts:
    89
    Just to expand a little, using Unity 4.3, I reproduced the issues using a SteelSeries Free gamepad connected in single-blink mode. I used this script to output the values of the various axes (matching those of the same name in the Input manager).

    Code (csharp):
    1.     void OnGUI() {
    2.         GUI.Label(new Rect(0.0f, 0.0f, 100.0f, 20.0f), "X axis: " + Input.GetAxisRaw("X axis"));
    3.         GUI.Label(new Rect(0.0f, 20.0f, 100.0f, 20.0f), "Y axis: " + Input.GetAxisRaw("Y axis"));
    4.         GUI.Label(new Rect(0.0f, 40.0f, 100.0f, 20.0f), "3rd axis: " + Input.GetAxisRaw("3rd axis"));
    5.         GUI.Label(new Rect(0.0f, 60.0f, 100.0f, 20.0f), "4th axis: " + Input.GetAxisRaw("4th axis"));
    6.         GUI.Label(new Rect(0.0f, 80.0f, 100.0f, 20.0f), "5th axis: " + Input.GetAxisRaw("5th axis"));
    7.         GUI.Label(new Rect(0.0f, 100.0f, 100.0f, 20.0f), "6th axis: " + Input.GetAxisRaw("6th axis"));
    8.         GUI.Label(new Rect(0.0f, 120.0f, 100.0f, 20.0f), "7th axis: " + Input.GetAxisRaw("7th axis"));
    9.         GUI.Label(new Rect(0.0f, 140.0f, 100.0f, 20.0f), "8th axis: " + Input.GetAxisRaw("8th axis"));
    10.         GUI.Label(new Rect(0.0f, 160.0f, 100.0f, 20.0f), "9th axis: " + Input.GetAxisRaw("9th axis"));
    11.         GUI.Label(new Rect(0.0f, 180.0f, 100.0f, 20.0f), "10th axis: " + Input.GetAxisRaw("10th axis"));
    12.     }
    On launching the sample, all values are at rest at 0; as expected.

    Any movement though and X, Y, 3rd, and 4th will default to -1.

    From there, tilting any Joystick down or right will cause the corresponding axis to value between -1 and 1.

    Tilting any Joysticks left or up will make the value jump to 1 for the entirety of the movement.

    Releasing resets the inputs back to -1.

    The d-pad did function properly, it's only for the Joysticks that I saw this.

    Configuring axes to read values from all joysticks, or just individual joysticks at a time, didn't affect the behaviour.
     
  48. EvilDingo

    EvilDingo

    Joined:
    May 7, 2011
    Posts:
    189
    My gamepads haven't arrived yet (been a few weeks) but I'd hate to miss out on this promotion. I'm going to see if 4.3 fixes the axis issues I was having with the MOGA Pro. The game is greatly improved with gamepad support.
     
  49. WaterlooErik

    WaterlooErik

    Joined:
    Jul 22, 2013
    Posts:
    89
    Did you submit the email to request the gamepads? Or did that email not arrive either?

    Best bet is to reach out to BlackBerryDeveloperProgram@blackberry.com. CC me on there (eoros@blackberry.com) and we'll take a look into it.
     
  50. EvilDingo

    EvilDingo

    Joined:
    May 7, 2011
    Posts:
    189
    Yep, I completed all of that. It sent me to a website link to claim them but I haven't heard anything since. I got a MOGA Pro in the meantime, so I should still be able to get this rolling, but I wanted to test the SteelSeries FREE too.