This guest post was provided by Sonja Ängeslevä, SPM at Scoreloop (BlackBerry), and edited by Alex Kinsella
Games are more fun with friends, and nowadays almost everyone loves to play snack-size mobile games when idling away some free time.
Social gaming isn’t new, and board game marathons, chess masters and pinball wizards are all earlier manifestations, with social mobile games merely continuing the trend. The simple reason is based on human motivations. We are driven by different motivational factors like competition, social interaction and an urge to improve our own performance. On top of that, recent studies verify that word-of-mouth is the number one way mobile game players find the games they play, a trend that holds true on BlackBerry 10. A big chunk of top grossing games on BlackBerry 10 are social and integrate Scoreloop SDK.
To make it easier to integrate social features into a game, BlackBerry offers Scoreloop SDK and Default UI to game developers. Scoreloop SDK is a white-label SDK which provides a set of key social features to leverage long tail discoverability by turning games into social experiences and allowing players post their scores to leaderboards, brag about their achievements and play challenges against other players. BlackBerry provides samples, code snippets and demo code to make it easy to integrate social features to a game.
Default UI is complimentary to the Scoreloop SDK and provides the simplest way to integrate the Scoreloop social features into a game. Default UI has a smooth, black design to present leaderboards, awards, achievements and favorite game functions, with a focus on simplicity and a clean look to better work with any game. With Scoreloop SDK and Default UI, game developers can socialize their games quickly and easily.
To show how easy it is, I will briefly go through the process of Default UI integration using a leaderboard as an example. Default UI requires access to BPS events. If you use third party game engine, you need to create a window group.
First, you need to integrate the feature, create SC_Client and pass it into SCUI_Client. Initialize the Default UI client:
<a href="http://developer.blackberry.com/native/documentation/core/com.qnx.doc.scoreloop.lib_ref/topic/SC_Error_t.html">SC_Error_t</a> errCode;
<a href="http://developer.blackberry.com/native/documentation/core/com.qnx.doc.scoreloop.lib_ref/topic/SC_Client_h.html">SC_Client_h</a> client;
<a href="http://developer.blackberry.com/native/documentation/core/com.qnx.doc.scoreloop.lib_ref/topic/SCUI_Client_h.html">SCUI_Client_h</a> uiClient;
// Client already created during initialization. errCode = <a href="http://developer.blackberry.com/native/documentation/core/com.qnx.doc.scoreloop.lib_ref/topic/SC_Client_New.html">SC_Client_New</a>(&client, &initData, aGameId, aGameSecret, aGameVersion, aCurrency, aLanguageCode); // If SC_OK, client created. Otherwise, client creation failed.
// Create the UI client errCode = <a href="http://developer.blackberry.com/native/documentation/core/com.qnx.doc.scoreloop.lib_ref/topic/SCUI_Client_NewWithCallback.html">SCUI_Client_NewWithCallback</a>(&uiClient, client, callback, cookie) // If SC_OK, UI client created. Otherwise, UI client creation failed.
Pass event to the UI client.
// get an event
bps_get_event(&event, -1); // blocking <a href="http://developer.blackberry.com/native/documentation/core/com.qnx.doc.scoreloop.lib_ref/topic/SCUI_Client_HandleEvent.html">SCUI_Client_HandleEvent</a>(uiClient, event);
Invoke the UI and display the selected view. Find more details in the documentation. After that is done, you can focus on Default UI Leaderboard.
Make a call to SCUI_Client_ShowLeaderboardView() to show the leaderboard view.
<a href="http://developer.blackberry.com/native/documentation/core/com.qnx.doc.scoreloop.lib_ref/topic/SC_Error_t.html">SC_Error_t</a> errCode; <a href="http://developer.blackberry.com/native/documentation/core/com.qnx.doc.scoreloop.lib_ref/topic/SCUI_Client_h.html">SCUI_Client_h</a> uiClient;
// Optionally, call this method to scroll-down to the user's current position
errCode = <a href="http://developer.blackberry.com/native/documentation/core/com.qnx.doc.scoreloop.lib_ref/topic/SCUI_Client_SetLeadearboardFlags.html">SCUI_Client_SetLeadearboardFlags</a>(uiClient, SCUI_LEADERBOARD_FLAGS_SHOW_RANGE_FOR_USER); errCode = <a href="http://developer.blackberry.com/native/documentation/core/com.qnx.doc.scoreloop.lib_ref/topic/SCUI_Client_ShowLeaderboardView.html">SCUI_Client_ShowLeaderboardView</a>(uiClient, modeSelected, listSelected, optionalScore); // Pass @c Null as optionalScore to not post a score. // If SC_OK, view will be displayed. Else, failed to show favorites view, no callbacks will be issued then.
// Optionally, wait for a callback notification called just before displaying a view (set via SCUI_Client_SetViewEventCallback()).
// Wait for the MyViewResultCallback().
It is possible to specify a score along with other leaderboard parameters.
<a href="http://developer.blackberry.com/native/documentation/core/com.qnx.doc.scoreloop.lib_ref/topic/SC_Score_h.html">SC_Score_h</a> score = <a href="http://developer.blackberry.com/native/documentation/core/com.qnx.doc.scoreloop.lib_ref/topic/sc_types.h_defines.html">NULL</a>;
errCode = <a href="http://developer.blackberry.com/native/documentation/core/com.qnx.doc.scoreloop.lib_ref/topic/SC_Client_CreateScore.html">SC_Client_CreateScore</a>(client, &score); errCode = <a href="http://developer.blackberry.com/native/documentation/core/com.qnx.doc.scoreloop.lib_ref/topic/SC_Score_SetResult.html">SC_Score_SetResult</a>(score, value); errCode = <a href="http://developer.blackberry.com/native/documentation/core/com.qnx.doc.scoreloop.lib_ref/topic/SC_Score_SetMode.html">SC_Score_SetMode</a>(score, mode); // Request view by passing score to show leaderboard view method.
// Release the score retained by SCUI_Client_ShowLeaderboardView(). <a href="http://developer.blackberry.com/native/documentation/core/com.qnx.doc.scoreloop.lib_ref/topic/SC_Score_Release.html">SC_Score_Release</a>(score);
Include a link to the Default UI screen from your game’s main menu. That can be the entry point to the range of Scoreloop features. Quick and hassle free implementation of the Default UI screens gives a faster “go live” opportunity.
It has been proven time and again that games which take advantage of social features perform better than their social-less peers. Give the Scoreloop SDK and Default UI a try to see if your game can be socialized!