The Turbulenz Game Services allow games to interact with the live services provided by the Turbulenz game site. The services can be used via the web-based Turbulenz Services API or through the Turbulenz Services JavaScript Library (Included in jslib).
The Turbulenz Services Library is a set of JavaScript objects for communicating with the Turbulenz Services API. AJAX calls are used to communicate with Turbulenz Services. No prior understanding of AJAX is required to make use of these services. Simply target the interface provided by the JavaScript library.
Note
To use any of these services, the game must be run on one of: Turbulenz local development server, Turbulenz Hub or Turbulenz Game Site. These services are not available when games are run directly from the file system.
Turbulenz Services allow games to save a player’s progress. This data is saved on remote servers, which means the player can login later from a different location and continue their game. The space available is measured per user, per game and can also be used to save user-specified settings.
For information about implementing saving and loading, see the UserDataManager. Here are a few hints and tips when using the UserDataManager:
Your game may include some kind of high score or ranking system. To allow players to view their high scores and compare with other friends, Turbulenz Services provide a ranked leaderboard system. The system allows the game to record the best scores set by each player and calculates how that player compares to other players on the system. The resulting rank can be queried by the game and is also displayed on the Turbulenz game site. A player can see who is above them and below them in the ranks and what their next target is to improve.
The LeaderboardManager is the JavaScript interface for the game to access this functionality. Here are a few hints and tips when using the LeaderboardManager:
Badges are the name for Turbulenz’ achievement system. They represent game-based targets and challenges a player can aim towards. Turbulenz provides a comprehensive system of badges which accumulate across the Turbulenz game site. Badges can be worked towards (e.g. collecting a certain number of items) or directly awarded for passing a milestone.
The BadgeManager is the JavaScript interface for the game to access this functionality. Here are a few hints and tips when using the BadgeManager:
Each user on the Turbulenz game site will have a profile that games can access to obtain a user’s screen name, nationality, language etc. More information from the profile will become available to the game over time, subject to user permissions settings.
The UserProfile is the JavaScript interface for the game to access this server functionality. Here are a few hints and tips when using the UserProfile:
Each of these Turbulenz Services are available from the Turbulenz local server, Turbulenz Hub or Turbulenz game site. When testing on the local server, data is stored locally in the folder:
*SDKINSTALLDIR*/devserver/localdata
The local server requires no login and acts as the user logged onto the system. Your username for the local server is automatically set to the same as the user logged onto the machine. To test the behavior of multiple users, you should upload your game to the Hub.
To reset the local data generated by the Leaderboard or Badges API, you can remove the data for a specific game from one of:
- *SDKINSTALLDIR*/devserver/localdata/leaderboards
- *SDKINSTALLDIR*/devserver/localdata/userbadges
- *SDKINSTALLDIR*/devserver/localdata/userdata
where individual games are identified by the slug name. Resetting this data is equivalent to starting as a new user.
Warning
Do not attempt to manually edit data in these files. Editing the files could cause data corruption and undefined behavior from the local server. You should attempt to use the interfaces to debug this information and only view this data as a last resort.