DEVELOPERS BLOG

Default User Interface for Key Social Features

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:

SC_Error_t errCode; SC_Client_h client; SCUI_Client_h uiClient; // Client already created during initialization. errCode = SC_Client_New(&client, &initData, aGameId, aGameSecret, aGameVersion, aCurrency, aLanguageCode); // If SC_OK, client created. Otherwise, client creation failed. // Create the UI client errCode = SCUI_Client_NewWithCallback(&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_event_t *event; bps_get_event(&event, -1); // blocking  SCUI_Client_HandleEvent(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.

SC_Error_t errCode; SCUI_Client_h uiClient;     // Optionally, call this method to scroll-down to the user's current position   errCode = SCUI_Client_SetLeadearboardFlags(uiClient, SCUI_LEADERBOARD_FLAGS_SHOW_RANGE_FOR_USER);  errCode = SCUI_Client_ShowLeaderboardView(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. SC_Score_h score = NULL;   errCode = SC_Client_CreateScore(client, &score);  errCode = SC_Score_SetResult(score, value);  errCode = SC_Score_SetMode(score, mode);  // Request view by passing score to show leaderboard view method.    // Release the score retained by SCUI_Client_ShowLeaderboardView(). SC_Score_Release(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!

About alexkinsella1