• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by 12boulla · Dec 23, 2015 at 05:29 PM · androidmultiplayergoogle play games

Any good/detailed Google Play Games Real Time Multiplayer setup tutorial for android?

So, I'm making an android game in Unity and need to make it multiplayer. I have Google Play Games plugin all set up and users can sign in. Now i need to know how to implement Real Time Multiplayer. I know there is documentation here:

https://github.com/playgameservices/play-games-plugin-for-unity/blob/master/RTMP.md

But i can't help but notice how complicated the documentation makes it. For example, I have no idea what the listener is and how to implement it (take into account I am only 14 :/)

So I am asking if there are any good tutorials for this as I have not been able to find any.

Any help is greatly appreciated, thanks.

Comment
EASY Studios

People who like this

1 Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image saadali211 · Sep 22, 2018 at 06:24 PM 0
Share

here is New Updated Detailed tutorials on Unity Multiplayer using Google play game services 2018.

Watch On Youtube

https://youtu.be/mzW0FokL4D4

6 Replies

  • Sort: 
avatar image

Answer by liju · Aug 26, 2016 at 09:42 AM

This will help you https://www.raywenderlich.com/86040/creating-cross-platform-multiplayer-game-unity-part-1

Comment
BrunoBelmonte
NikunjAppIndia

People who like this

2 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image hellojbb1234 · Feb 24, 2017 at 07:11 PM 0
Share

I tried that tutorial I got stuck on the second part because it wouldn't go to the game scene

avatar image

Answer by Zewde · Dec 26, 2015 at 11:15 AM

I am also looking for a similar tutorial.

For the listener, you need to inherent from RealTimeMultiplayerListener (which is where your listener is)

 public class MultiplayerScript : MonoBehaviour, RealTimeMultiplayerListener

After adding that to your code, your code editor (Microsoft Visual Studio in my case), it asked me to import some stuff:

  "using GooglePlayGames.BasicApi.Multiplayer;"

and then it added all the relative methods:

 onRoomsetupprogress, onRoomConnected etc...

If you find any nice tutorials, please let me know.

Comment
12boulla

People who like this

1 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image 12boulla · Dec 26, 2015 at 11:21 AM 0
Share

I will do, but I doubt i will find any good tutorials :( Oh well, thanks for the reply and info on how to implement the listener :) If I ever get it working, I myself will make an in depth tutorial!

avatar image

Answer by owenhuston32 · Jul 27, 2017 at 09:15 PM

https://www.youtube.com/watch?v=fM87eDzhalc - up to date tutorial

Comment
FortisVenaliter

People who like this

-1 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by subburaj · Apr 02, 2017 at 09:55 AM

Below I'm put Example For create Listener Instance For RealTimeMultiplayer

 using UnityEngine;
 using System.Collections;
 using System.Collections.Generic;
 using GooglePlayGames;
 using GooglePlayGames.BasicApi;
 using UnityEngine.SocialPlatforms;
 using GooglePlayGames.BasicApi.Multiplayer;
 using System;
 
     public class GPGLogin : RealTimeMultiplayerListener
     {
       
         private static bool showingWaitingRoom = false;
 
         //RealTimeMultiplayer Instance For calling methods listener
         static GPGLogin listener = null;
        
         public static void RandomMatch()
         {
            
             listener = new GPGLogin();//Here Your Listener Instance 
             const int MinOpponents = 1, MaxOpponents = 2;
             const int GameVariant = 0;
             PlayGamesPlatform.Instance.RealTime.CreateQuickGame(MinOpponents, MaxOpponents,
                         GameVariant, listener);
         }
 
         public void OnRoomSetupProgress(float percent)
         {
             if (!showingWaitingRoom)
             {
                 showingWaitingRoom = true;
                 PlayGamesPlatform.Instance.RealTime.ShowWaitingRoomUI()
             }
         }
 
         public void OnRoomConnected(bool success)
         {
             if (success)
             {
                  //Room Connected success 
                  //you can put your code After the Room connected
             }
             else
             {
                     //Room Connection failed 
                  //you can put your code After the Room connection failed
             }
         }
 
         public void OnLeftRoom()
         {
             throw new NotImplementedException();
         }
 
         public void OnParticipantLeft(Participant participant)
         {
             throw new NotImplementedException();
         }
 
         public void OnPeersConnected(string[] participantIds)
         {
             throw new NotImplementedException();
         }
 
         public void OnPeersDisconnected(string[] participantIds)
         {
             throw new NotImplementedException();
         }
 
         public void OnRealTimeMessageReceived(bool isReliable, string senderId, byte[] data)
         {
             //here You Receive the Message From Opponent user
         }
     }
 



Comment

People who like this

0 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by Akki-bhatt · Aug 04, 2017 at 04:13 AM

It's been late but here is the good multiplayer tutorial using google play games

http://bhattakash.com/creating-multiplayer-game-with-unity/

and a good Asset too: http://u3d.as/TGr

Comment

People who like this

0 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • ›

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

54 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

GPGS - Start the match with only even numbers of players 0 Answers

How to make randomly generated floats the same across multiplayer? (GPGS) 1 Answer

Using Random.seed to sync random generation in multiplayer (android GPGS) 0 Answers

GPGS - How To Cancel Matchmaking Properly? 1 Answer

Why can Android send commands via NetworkManager but iOS cannot? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges