[lib] Easy integration of Play Games, Game Center and others

Any community contributions to libgdx go here! Some may get included in the core API when permission is granted.

[lib] Easy integration of Play Games, Game Center and others

Postby MrStahlfelge » Mon Jul 03, 2017 8:29 pm

Hi,

I published my first libGDX extension on GitHub for easy integration of game services like Google Play Games.

When I wrote my first libGDX game, I realized there was no good library for Google Play Games (GPGS) integration available. So I implemented all the stuff myself, like many of you before.
When I then published my HTML5 release to hosters like GameJolt, I realized they had their own achievement and highscore APIs, some even with implementations for libGDX - but without a game service independant layer. So I implemented some of them, too, of course against my interface that I made for Gpgs.

Now I extracted the whole game service stuff from my game project to use it in other projects. I used TomGrill's extension template and hope I done everything right - at least it is working in my demo app and in my game. :D

Image

The basic concept of the library is simple: It provides an interface IGameServiceClient that you reference in your core code. Your platform-dependant launchers instantiate an actual implementation of the interface. The wiki has a lot of information for setting up the actual Game services.

You can find the project on Github: https://github.com/MrStahlfelge/gdx-gamesvcs

Feedback is very welcome. I hope some of you will try the lib. :)
Last edited by MrStahlfelge on Sun Feb 17, 2019 10:44 am, edited 3 times in total.
MrStahlfelge
 
Posts: 121
Joined: Thu Jun 15, 2017 6:40 am

Re: [lib] Easy integration of game services (Google Play Gam

Postby thorthur » Thu Jul 06, 2017 8:03 pm

Very nice work here!

As we previously discussed I also spent time on some similar integration lib (shameless plug), yours is by far more feature-complete especially for HTML5 games. And the demo app and wiki are very precious help.

Congrats!
thorthur
 
Posts: 2
Joined: Tue Aug 02, 2016 9:07 am

Re: [lib] Easy integration of game services (Google Play Gam

Postby MrStahlfelge » Sat Jul 22, 2017 9:55 pm

I've added an implementation for Amazon GameCircle to the current snapshot version.

Surprise for me: GameCircle works also on Non-Fire devices without installing any extra services. This is interesting for testing purposes.
MrStahlfelge
 
Posts: 121
Joined: Thu Jun 15, 2017 6:40 am

Re: [lib] Easy integration of game services (Google Play Gam

Postby mgsx » Sun Jul 23, 2017 9:11 am

That's funny, I just implemented that kind of abstraction layer in my game recently.

I just implemented google play games for desktop application using the REST API version, maybe this feature could also have a place in your extension ? If you're interested, i could send you a PR.

The REST API could also be used for html5 target.
mgsx
 
Posts: 13
Joined: Wed Oct 26, 2016 11:01 am

Re: [lib] Easy integration of game services (Google Play Gam

Postby MrStahlfelge » Sun Jul 23, 2017 9:29 am

Probably 50% of the libGDX developers implemented such an interface in the past... I hope instead of that we can combine our strengths in the future. :D

And yes, of course I am very interested in your Play Games implementation. I've thought it is only useable in HTML5 because of the authentication problem. Being able to use it in HTML projects alone would be great, using it even in Desktop clients would be terrific!
MrStahlfelge
 
Posts: 121
Joined: Thu Jun 15, 2017 6:40 am

Re: [lib] Easy integration of game services (Google Play Gam

Postby mgsx » Sun Jul 23, 2017 9:54 am

Indeed, GPGS provides several authentification methods. The one I implemented is what they called "Installed application" (it automatically open a browser page and open a socket inside the client application to get back the token). All the underlying tech stuff is implemented by their own java libs so it only requires few lines of code.

Some links :
https://developers.google.com/api-clien ... talled-app
https://developers.google.com/api-clien ... s/games/v1

Note : I also implemented the GPGS/Drive to save / load game data.

Note : Sadly, google will stop some GPGS features at march 2018 (Events and Quests) : see https://developers.google.com/games/ser ... pts/quests

I'll give a try to integrate it in your extension when I have time.
mgsx
 
Posts: 13
Joined: Wed Oct 26, 2016 11:01 am

Re: [lib] Easy integration of game services (Google Play Gam

Postby MrStahlfelge » Sun Jul 23, 2017 10:28 am

That is really cool. Didn't see that pages, very interesting!

I'm looking forward to your addition. :)
MrStahlfelge
 
Posts: 121
Joined: Thu Jun 15, 2017 6:40 am

Re: [lib] Easy integration of game services (Google Play Gam

Postby mgsx » Thu Jul 27, 2017 10:52 am

I tried your library for my Android project and I get it finally working! :-) and the API seams good to me as of now.

As a side note :
* I'm using eclipse and get troubles with AAR dependencies which I solved with few manual steps.
* I also had problems with DEX 64K max method limit and had to remove drive and google+ dependencies ... :-( but nothing related to your lib.

I fixed minor things and I'd prefer to PR these changes instead of talking about it here, are you OK with that ?

As we discussed, I plan to implement the GPGS Desktop connector and again I prefer to use Github issue tracker to discuss about it, I think to draft something out soon.
mgsx
 
Posts: 13
Joined: Wed Oct 26, 2016 11:01 am

Re: [lib] Easy integration of game services (Google Play Gam

Postby MrStahlfelge » Wed Aug 09, 2017 4:52 pm

Released v0.1.1 and pushed it to central repository.

Now supporting Amazon GameCircle with cloud sync.
MrStahlfelge
 
Posts: 121
Joined: Thu Jun 15, 2017 6:40 am

Re: [lib] Easy integration of game services (Google Play Gam

Postby MrStahlfelge » Mon Aug 14, 2017 8:31 pm

Working version 0.2.0-SNAPSHOT does now provide support for Google Play Games in your desktop clients.

This was made possible by mgsx - thank you for the contribution!

To point it explicitely out, it is possible to synchronize game state data between your Android and desktop clients via GPGS, a feature not many games can provide. :D
MrStahlfelge
 
Posts: 121
Joined: Thu Jun 15, 2017 6:40 am

Next

Return to Libgdx Contributions

Who is online

Users browsing this forum: No registered users and 1 guest