Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
How to use "Gaming" plugin? - Page 2 — Gideros Forum

How to use "Gaming" plugin?

2

Comments

  • Apollo14Apollo14 Member
    edited September 2018
    1) I've uploaded Gideros Player apk to GooglePlay console, released it as 'alpha'.
    2) Enabled 'Google Drive' API in google dev console
    3) Added my own email adress to the list of testers in 'Google Play Console -> App releases -> Internal track test'
    First day I couldn't download my own alpha version from Google Play, as alpha tester.
    Next day I was able to access it.

    Guys how to show auth info during authorizing? (like on screenshot below, it isn't shown in my app, though authorization is successful)



    How to access all user's info? (I've attached two screenshots)
    When I authorize in my freshly exported app, it does not ask "access to your age and language data" (while it requires that permission when I authorize in @totebo 's NoBrakes.io)
    print(googleplay:getPlayerName()) --it works
    local playerAvatar=googleplay:getPlayerPicture() --it crushes app
    How to get more info? User's age, country, etc?
    Screenshot_2018-08-31-14-25-13-918_com.google.android.gms.png
    1080 x 1920 - 157K
    Screenshot_2018-09-02-09-55-05-876_com.google.android.gms.png
    1080 x 1920 - 192K
    Screenshot_2018-09-02-09-57-12-281_com.playdemic.golf.android2.png
    400 x 711 - 34K
    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
  • That may be in an update, I noticed the same issue, it was fixed, but that fix may be in the current internal test version - not in the actual release, I'm not sure.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • @Apollo14 I've pm'ed you. :)
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • Apollo14Apollo14 Member
    edited September 2018
    Hey guys! There's one more arcanum to make 'Gaming' plugin work:
    http://forum.giderosmobile.com/discussion/comment/42515/#Comment_42515
    We have to manually edit our app's ID in 'ids.xml' before apk export (otherwise apk won't authorize in Google Play)
    C:\Program Files (x86)\Gideros\All Plugins\gaming\source\Android\res\values\ids.xml

    Can we add Player's avatar to stage as bitmap?
    playerAvatar=googleplay:getPlayerPicture()
    print(playerAvatar)
    --prints string "content://com.google.android.gms.games.background/images/28fc1e35/715"
    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
  • hgy29hgy29 Maintainer
    You don’t need to modify ids.xml by yourself in the template, and in fact you really shouldn’t do that since it will break plugin export. Export systems replaces the app id in there by the one you set up in gaming plugin configuration when you export your project.

    For avatar, unfortunately gideros doesn’t know yet how to open ‘content’ URLs.

    Likes: dreiko65

    +1 -1 (+1 / -0 )Share on Facebook
  • hgy29 said:

    You don’t need to modify ids.xml by yourself in the template, and in fact you really shouldn’t do that since it will break plugin export. Export systems replaces the app id in there by the one you set up in gaming plugin configuration when you export your project.

    For avatar, unfortunately gideros doesn’t know yet how to open ‘content’ URLs.

    Great!
    I guess I had this issue because I've exported Gideros player only (blank project).
    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
  • @Apollo14 I make a player in Gideros for each project with all it's specific plugins, etc - signed with the production key.

    All you do is export the project as you would do for production, but just have the selector set to player.

    I then copy it to a dropbox folder on my pc called 'players' and then on my phone or device I have dropbox installed, I go to the players folder and install the apk.

    Likes: Apollo14

    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
    +1 -1 (+1 / -0 )Share on Facebook
  • hgy29 said:

    For avatar, unfortunately gideros doesn’t know yet how to open ‘content’ URLs.

    Can we get user's gender? (is it male or female playing our game)

    How to access user's information?
    googleplay:getPlayerInfo()
    googleplay:addEventListener(Event.PLAYER_INFORMATION_COMPLETE , function()
    	print"Player info received"
    end)
    After this call some information is received, but what kind of information was received and how to access it? Is it saved to some table somewhere?
    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
  • @Apollo14 As privacy laws invade the 'gaming space' you will see less and less information being given, for example Amazon have closed all of their social gaming stuff, facebook give less information, etc. I wouldn't use anything other than the person's nickname/handle and their public avatar image - anything else will most likely be gone soon.

    Likes: Apollo14

    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
    +1 -1 (+1 / -0 )Share on Facebook
  • Google Play tend to use the avatar images, which are not that personal, so maybe they have/will allow those to be pulled.
    My Gideros games: www.totebo.com
  • thanks everyone
    Công ty rut ham cau gia re giá rẻ dịch vụ rút hầm cầu giá rẻ tận tâm
  • olegoleg Member
    Is there a simple example for multiplayer games?
    how to create a room and connect 2 players correctly?
    gaming:autoMatch(2,2)
    gaming:invitePlayers(1,1)
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • Apollo14Apollo14 Member
    edited June 2019
    oleg said:

    Is there a simple example for multiplayer games?
    how to create a room and connect 2 players correctly?

    gaming:autoMatch(2,2)
    gaming:invitePlayers(1,1)
    @oleg 'Gaming' plugin is not very reliable (at least for my nerve cells), but try it, if it doesn't work for you, probably you should use Photon (Photon is overcomplicated and not well documented, it'll take some time to figure out how things work there and make your game prototype).

    Also, "IO" games usually have fake multiplayer with bots. You should tune auto-matching to match real players vs bots when there's lack of real humans.
    require "gaming"
     
    gp=Gaming.new("googleplay")
     
    gp:login()
     
    gp:addEventListener(Event.LOGIN_COMPLETE,function (e)
     
    --gp:loadState(1)
    --gp:logout()
    print("LoggedIn")
    gp:autoMatch(1,1)
    --gp:showLeaderboard()
     
    end)
     
    gp:addEventListener(Event.LOGIN_ERROR, function(event)
    	print("LOGIN ERROR:", event.error)
     
    gp:addEventListener(Event.ROOM_CREATED,function (e)
    	print("Room created:",e.roomId)
    	gp:showWaitingRoom(1)
    end)
     
    gp:addEventListener(Event.ROOM_CONNECTED, function(event)
    	print("roomConnected, room ID:"..event.roomId)
    end)
     
    gp:addEventListener(Event.GAME_STARTED, function()
    	print("gameStarted")
    end)
     
    gp:addEventListener(Event.DATA_RECEIVED, function(event)
    	printR("dataReceived: "..event.data.." from "..event.senderId)
    end)
     
    end)

    Likes: MoKaLux, oleg

    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
    +1 -1 (+2 / -0 )Share on Facebook
  • olegoleg Member
    @Apollo14

    ps. ---- Event.CONNECTED_TO_ROOM
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • olegoleg Member
    got it

    image.png
    587 x 217 - 17K
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
    +1 -1 (+2 / -0 )Share on Facebook
  • Apollo14Apollo14 Member
    edited June 2019
    oleg said:

    got it

    OK now try to figure out how to leave room after you played one session :D (there's no api call 'Gaming:leaveRoom()')
    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
  • olegoleg Member
    Apollo14 said:



    OK now try to figure out how to leave room after you played one session :D (there's no api call 'Gaming:leaveRoom()')

    gaming:logout() ;)
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • olegoleg Member
    edited June 2019
    In this team, I have an error that I'm doing wrong?
    gaming:loadPlayerCenteredScores("CgkIwqXCmPkEEAIQAQ",gaming.ALL_TIME,gaming.ALL_PLAYERS,25)
    the command is outdated, I figured out ..
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • olegoleg Member
    121212.PNG
    403 x 260 - 12K
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • oleg said:
    But you will have to re-login to GooglePlay after command 'gaming:logout()'?
    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
  • olegoleg Member
    edited June 2019
    Apollo14 said:


    But you will have to re-login to GooglePlay after command 'gaming:logout()'?

    To get out of the room you need to run: autoMatch (2,2)

    I found that in the plugin there is a
    leftRoom (me, roomId) command
    but it's inactive in gideros,, we will have to try to complete the plugin

    Likes: antix, Apollo14

    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
    +1 -1 (+2 / -0 )Share on Facebook
  • olegoleg Member
    edited July 2019
    what format time in leaderboard?
    local my_time=((s/60+m)/60+h)/24
    --local my_time=s+m*60+h*60*60
    --local my_time="34:17:30"
    gaming:reportScore(google_top.leaderboardEasy,my_time, true)
    I tried different options, the time is not correctly displayed ..
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • olegoleg Member
    edited July 2019
    Time leaderboards present scores in hours / minutes / seconds / hundredths of a second format. You must submit scores as milliseconds, so 66032 would be interpreted as 1:06.03.https://developers.google.com/games/services/common/concepts/leaderboards
    (1*60+06)*100+03= 6603 where did they take 66032 ???


    did so:
    local my_time=((m*60+s)*100+(ms*10))*10
    now the time is showing correctly

    Likes: Apollo14, MoKaLux

    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
    +1 -1 (+2 / -0 )Share on Facebook
  • olegoleg Member
    I can not understand how these teams work.
    gaming:invitePlayers(1,8)  
    gaming:showInvitations()
    how to use them?
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • Apollo14Apollo14 Member
    edited July 2019
    oleg said:

    I can not understand how these teams work.

    gaming:invitePlayers(1,8)  
    gaming:showInvitations()
    how to use them?
    If I remember correctly, 'gaming:showInvitations()' opens Google's interface window, they see what's happening, who is connecting.

    But you shouldn't show this window to them, because you will have to mix players with bots (even top publishers have bots in their "multiplayer" games).

    Just call 'gaming:invitePlayers(1,8) and show your own custom loading window. If there's not enough human players, then start game with humans+bots.
    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
  • olegoleg Member
    @Apollo14
    I know what these commands mean
    I do not know how to get them to work

    gaming:showInvitations() -gaming: showInvitation () turns on the bluetooth and does not find the players

    players only sees when I put-gaming: invitePlayers (1.1) -but not always and randomly ..
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • oleg said:

    @Apollo14
    I know what these commands mean
    I do not know how to get them to work

    gaming:showInvitations() -gaming: showInvitation () turns on the bluetooth and does not find the players

    players only sees when I put-gaming: invitePlayers (1.1) -but not always and randomly ..

    sorry, it was my mistake, actually "Gaming:showWaitingRoom()" is waiting room I was talking about

    Then I don't know about gaming:showInvitations(), you should ask @hgy29
    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
  • Apollo14Apollo14 Member
    edited July 2019
    @oleg maybe you should just use
    gaming:autoMatch(minPlayers, maxPlayers) --create a quick game between randomly selected players
    P. S. there's better docs on Gaming api inside old plugin's folder: C:/Program%20Files%20(x86)/Gideros/All%20Plugins/googleplay/reference.html
    googleplay:login() --login
    googleplay:logout() --logout
    googleplay:showSettings() --show settings screen
    googleplay:showLeaderboard(leaderboardId) --show leaderboard screen
    googleplay:reportScore(leaderboardId, score [,immediate]) --post score to service
    googleplay:showAchievements() --show achievements screen
    googleplay:reportAchievement(achId [, numSteps, immediate]) --achievement unlocked or progressed by specified amount of steps of total defined steps
    googleplay:loadAchievements() --retrieve all defined achievemenets
    googleplay:loadScores(leaderboardId [,timespan, participants, maxResults]) --retrieve all scores for specific leaderboard ina specific timespan for specific participans
    googleplay:loadPlayerCenteredScores(leaderboardId [,timespan, participants, maxResults]) --retrieve all scores for specific leaderboard ina specific timespan for specific participans
    googleplay:autoMatch(minPlayers, maxPlayers) --create a quick game between randomly selected players
    googleplay:invitePlayers(minPlayers, maxPlayers) --allow user to invite players to a game
    googleplay:joinRoom(invitationId) --joins the game you've been invited to
    googleplay:showInvitations() --show screen for managing invitations
    googleplay:showWaitingRoom(minPlayers) --show waiting room before the game with the list of players
    googleplay:sendTo(playerId, data, isReliable) --send data to specific user by id
    googleplay:sendToAll(data, isReliable) -- send to all users
    googleplay:getPlayerName() --get your current user name
    googleplay:getPlayerId() --get your current user id
    googleplay:getPlayerScore() --dispatches PLAYER_SCORE_COMPLETE event
    googleplay:getAllPlayers() --retrieve information (id and name) for all users involved in game
    googleplay:loadState(key) --load app state from slot key from the cloud
    googleplay:updateState(key, data[, immediate]) --update app state for slot key with data bool immediate if it needs to be saved immediately
    googleplay:deleteState(key) --delete app state for slot key
    googleplay:resolveState(key, version, data) --resolve state conflict for slot key with version and data
     
     
    Properties
    GooglePlay.UNLOCKED --achievement state unlocked
    GooglePlay.REVEALED --achievement state available to user
    GooglePlay.HIDDEN --achievement state unknown to user
    GooglePlay.ALL_TIME --leaderboard timespan all time
    GooglePlay.WEEK --leaderboard timespan week
    GooglePlay.TODAY --leaderboard timespan today
    GooglePlay.FRIENDS --leaderboard participants
    GooglePlay.ALL_PLAYERS --leaderboard participants
     
     
    Events
    Game Events
    Event.DATA_RECEIVED
    event.sender
    event.data
    Event.GAME_STARTED
    Event.REPORT_ACHIEVEMENT_COMPLETE
    event.achievementId
    Event.LOAD_ACHIEVEMENTS_COMPLETE
    event.achievements
    event.achievements[].id
    event.achievements[].name
    event.achievements[].description
    event.achievements[].status
    event.achievements[].currentSteps
    event.achievements[].totalSteps
    event.achievements[].lastUpdate
    Event.REPORT_SCORE_COMPLETE
    Event.LOAD_SCORES_COMPLETE
    event.name
    event.leaderboardId
    event.scores
    event.scores[].name
    event.scores[].timestamp
    event.scores[].formattedScore
    event.scores[].score
    event.scores[].rank
    event.scores[].playerId
    Event.PLAYER_SCORE_COMPLETE
    event.rank
    event.formattedScore
    event.score
    event.timestamp
    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
  • SinisterSoftSinisterSoft Maintainer
    If you could update the docs in the Wiki with that information then that would be handy. :)
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
Sign In or Register to comment.