I am creating a game using Libgdx and would like to integrate player, Leaderboard, high score on both iOS and Android devices. Ideally I would use Google Play Game Services but I could be convinced to use other technologies (like Parse).
There are tutorials to use Google Play services for Android devices: (http://theinvader360.blogspot.co.uk/2013/10/google-play-game-services-tutorial-example.html). But as far as I understand, this will not work for iOS devices (according to this:https://developers.google.com/games/services/integration/)
There are also tutorials to do so on iOS devices, using RoboVM: http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=11424 but as far as I understand this will only work for iOS devices.
Since one of libgdx benefit is to write once but to run cross platforms,
my Question is the following:
How do I integrate with Google Play Game Services and run on iOS and Android.
It seems to me that the answer is to use the REST API (https://developers.google.com/games/services/web/api/) since this is technologically agnostic, but that means that I then need to implement quite a few things (login, notifications...)
I cannot imagine I am the first one to be facing this but it seems there are no examples available on the subject.
You don't have to use the REST API for this, even though that would certainly be an option.
The easier way is the use of platform specific code via interfacing.
Everything that is not directly integrated into libGDX won't work via "write once, run everywhere". This also applies to achievements, leaderboards and other things that Google Play Game Services offer. However, you are lucky that GPGS unites these features within one framework for at least Android, iOS and Web.
So what you would do, is adding the platform specific library dependencies to the platform specific projects you have generated. Then implement a generic interface, e. g. AchievementHandler with methods like unlockAchievement(String achievementId).
Then you would implement this interface via AndroidAchievementHandler that makes use of GPGS. The same will work with an IOSAchievementHandler.
In your core code, you will only use AchievementHandler and each platform will use its own implementation of this.
Related
I would like to add the multiplayer functionality to my Android game. In particular it must be turn-based. I don't want to reinvent the wheel, so i need a framework/API or whatever that avoid to write the server side. It is just a personal project of mine, so i have not special requirements. Now, i know 3 possibilities:
Google Play Services API for Turn-Based game
SmartFoxServer
Parse
I would like to know if there are other technologies or if any of the ones that i've written above is good.
https://developers.google.com/games/services/android/turnbasedMultiplayer
As someone said in comments, Google Play services is cross-platform and will work for iOS if you ported it in that direction. Also, the support in the way of tutorials and documentation is very great for this.
On top of that, you can integrate other Google goodies like high scores, badges, etc.
I am planning to develop a game both for Android and for IOS. My engine of choice is Unity as it is supposed to support both OSs. Is there going to be any difference at all in the development phase? For example, should I consider the OS in things like storing data like high score, or in things like input type? Or does unity provide an abstraction level for these things, and takes care of everything in the build phase?
Once you make a game in unity you can deploy that on many platform without doing any significant changes. However there will be sometime when you will need some part of your code only run on some specific platform, which you can do like this. Regarding saving data, this may depend on how you want to implement things in your code. You can use playerpref which is supported on all platforms or you can use third party sdk. I think this may have cleared your doubt.
A quote from the Unity website:
There are so many platforms you can deploy to with the Unity game engine, and their number is growing all the time. Build your content once and deploy at a click across all major mobile, desktop and console platforms plus the Web. Use the official Facebook SDK for Unity to integrate cross-platform games with ease, experiment with the Oculus Rift and more.
If I have a website and an android application, it is correct to build a Rest API service to use it in both (web and app).
This way is more flexible to make changes one time right?
I'm using Hapijs and Catbox-Redis to handle the session store, also I am working on separated projects to deploy the API and Web projects on separated servers.
It is correct to use one API service for the Android Application and the Webpage?
It is absolutely appropriate. This is one of the big advantages of a services layer. It is very likely you will need some things that are specific to each, but most things will be common.
The really great thing will be when you have to write the THIRD interface that you don't know about yet (Google glass, apple TV, android watch, SOAP, who knows)
I created a game in Java using Libgdx framework. Now I would like to know if it is possible to use Google Play Game Services in a desktop (java/.jar) game, or is it meant just for mobile devices?
As I am faced with the same question, I do not have a complete answer, but I think the short answer is yes, you can.
But you'll have to use the rest API instead of a nice java API, and some features are not available (such as the real-time online multiplayer support). You can see the reference here:
https://developers.google.com/games/services/web/api/index
As you can see, the major stuff like anchievements, leaderboards, and turn-based multiplayer services should be available (and you can even see there is stuff like joining rooms, but they are marked as "For internal use by the Games SDK only."), so I guess the REST API covers the major needs.
I have yet to test this on a desktop aplication and for sure you'll want some support library to help with the quirks of the HTTP-REST protocol, but I think it is feasible.
EDIT: Since this API is meant for the web, you may still need some kind of initial JavaScript interaction with the user (using google's JavaScript libraries) in order to authenticate the user first, but the rest of the interaction can be done "server-side" (and in any language you want). Read this for more details:
https://developers.google.com/games/services/web/serverlogin
I have programming experience with Java and Actionscript 3.0 but for now Im looking for lib/framework or engine for ActionScript 3.0 since I want to make games for android and ios. This dosen't seems to be that easy.
I have tryed flashpunk, starling, citrus-engine. I like flashpunk but seems like it dosen't run good at mobile phones at all. And starling where kind of complex and confusing might be that I diddn't use enough time on it but before going any further I need to know what I shall do.
I use Starling and Flash CS6 to publish games in App Store, Google play and Amazon store. It is relative easy if you use project with shared libs and different fla files to target all platforms.