- Home /
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.
here is New Updated Detailed tutorials on Unity $$anonymous$$ultiplayer using Google play game services 2018.
Watch On Youtube
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
I tried that tutorial I got stuck on the second part because it wouldn't go to the game scene
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.
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!
Answer by owenhuston32 · Jul 27, 2017 at 09:15 PM
https://www.youtube.com/watch?v=fM87eDzhalc - up to date tutorial
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
}
}
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
Your answer
Follow this Question
Related Questions
GPGS - How To Cancel Matchmaking Properly? 1 Answer
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
Google Cloud PlayerPrefs Plugin 0 Answers