[Closed] Google Play Game Services Multiplayer feature

I noticed that at the bottom of this Corona Docs page, it has a link to “sample code for real time multiplayer” – it is linked to:

https://github.com/coronalabs/plugins-sample-gameNetwork-google-gemwars

Very exciting.  But… there’s no real docs explaining what piece does what.  I’m wiling to read up on Google docs, but it would really help if I’m given some basic explanations on how Corona plugin maps out with GPGS, or, at the very least, a laundry list of Corona plugin APIs related to google multiplayer feature with some basic information on each.  And if not, maybe some more comments in sample code, explaining what’s doing what.

Meanwhile, since I have a valid googlePlayGamesAppId (which my app successfully uses for GPGS leadearboards and achievements), I went ahead and tried out the sample code as follows:

  1.  Renamed the sample code project folder to that of my app’s project folder

  2.  Plugged in the googlePlayGamesAppId of my app to build.settings of the sample code

  3.  Enabled real-time multiplayer in Google Dev Console (under GPGS linked app)

  4.  Generated a device build of the sample code using my app’s keystore

  5.  Deleted my app from a couple of Android test devices

  6.  Installed the sample project device build on the test devices

  7.  Launched the sample app on each device and signed in to Google+ (success!)

  8.  Tapped on “Join Match”, which shows “You have no invitation.”

  9.  Tapped upper left corner to return to the app

  10.  Error alert: “Room Error:  Sorry there was an error when trying to create/join a room”

  11.  Closed the error message and tapped on “Create Match”

  12.  It showed a screen with ME listed as Players

  13.  Tapped on Auto-pick player on the same screen, which added Auto pick to the list of players

  14.  Tapped on “Play” button, which sent me back to the app, but another error alert: “Room Error:  Sorry there was an error when trying to create/join a room.”

I’ve tried creating and joining matches in different order but I cannot go beyond this error message no matter what I do with two of my devices with two test users.  Is the sample code meant to work without this error?  If so, what am I doing wrong?  What am I missing?

So… here’s what I want to do, and I’d like to know if it’s possible (and I think it would be, based on what I’ve gathered so far, but I could be very wrong):

*  The app would send a json string when a user creates a match, which will be shared by all players.  The json string will contain data that will generate an identical game board for all players participating in the match.   So, upon joining a match game, the app would need to receive a json string before the participating user can start the game.

* When each participating player comes to the end of the game (i.e., when the time’s up), the app would send the game result (two variables, score and additional data) to GPGS.

*  And then, I’d like to receive back a json string that contains consolidated results, including player profile of some sort.  It would be nice if GPGS also sorts the result by highest score to the lowest before sending back the result (just like Facebook score API does.)

That’s all I need.  I’d like to know if this is totally achievable.  And if so, I’d so appreciate any pointers and suggestions.  If there are specific APIs that I should really look and figure out what they do, it would help quite a bit too.

Naomi

Edit:  Looking around, I see the laundry list of APIs!  I’ll investigate further.  (And it looks pretty comprehensive at the first glance.)  Meanwhile, if anyone has any suggestions as to where I should start and what to watch out for, I’d love to hear about it.

http://docs.coronalabs.com/daily/plugin/gameNetwork-google/request.html

So apparently, the sample code does not work with automatch.  Here’s the feedback I received from Danny Chan who authored the code (thank you, Danny):

What you have to do is to have multiple Google+ accounts which are in each others circles.  They also have to be on the list of testers on the Google Developers page.  Once they are friends then you can select them in the create match screen.  Once a friend is invited then they can join the room that was created and then when both players are there then the game should start automatically.

Naomi

So apparently, the sample code does not work with automatch.  Here’s the feedback I received from Danny Chan who authored the code (thank you, Danny):

What you have to do is to have multiple Google+ accounts which are in each others circles.  They also have to be on the list of testers on the Google Developers page.  Once they are friends then you can select them in the create match screen.  Once a friend is invited then they can join the room that was created and then when both players are there then the game should start automatically.

Naomi