question

levet-jerome avatar image
levet-jerome asked

Different Multiplayer options

Hi there,

I'm currently integrating Playfab on a Game developped with Unity3D (2019+)

The game is cross platform (PS4, XB1, Switch, and maybe PC)

Some part of the game is an online mode, for a few players to interract in real time. (not defined yet if max player will be 10/20/50).


My first move was to handle the matchmaking stuff. Everything went well until i reached my first problem: The Matchmaking (Preview) is not handling game allocation for 1 alone player, if i undestand it correctly, Queue needs at least 2 or more players to match and allocate a GameServer. (the 1 alone player will happen during not-busy times as a small game.)
I diggued a little bit and found this Feature request. Anything new on this side? (this part can wait approx 6 months on our side)

If Matchmaking (Preview) is not/won't be an option for me. I have to search for other options

My requirements are as follows:

- a solo player should be able to enter some sort of matchmaking process to be served a GameServer to connect to with UDP sockets. (can be an already existing not full GameServer, or a newly allocated one that will be filled later on with next players requesting the same thing).

I found this API call and this one that are looking promising. Is this exactly what i'm looking for? (The ability for players to ask for a GameServer, and be served one not full, or allocating a new one?)

I think yes, but it looks like this is the 'old' legacy Multiplayer system/servers/matchmaking.
My server project (using Unity + GSDK at the moment) is properly integrated and works well on the new Servers 2.0 (preview). I'm able to (when i use the new matchmaking system with 2 users) matchmake successfully, and be served a GameServer on which i can connect with UDP sockets. Good.

Problem is this same exact Server don't seems to works on the old legacy system (Environment variable GSDK_CONFIG_FILE not defined fired at launch).

I don't find any documentation on the old system, and it seems that half topics that i read online are refering to the new one, and the other half to the old one. It's very unclear which API is the new one, which API is the old one, how do we need to integrate the agent on both options?

Any help would be welcome!

unity3dsdksMatchmaking
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Citrus Yan avatar image
Citrus Yan answered

If you need to handle game allocation for only 1 player, in my perspective, there is no need to put that player into the Matchmaking Queue waiting for a match and allocate a Game Server afterward. Instead, just like Brandon suggested, you can use the RequestMultiplayerServer API to directly allocate a Game Server for that single player and have the server use BackfillTickets to try to add more players to it. Please navigate to these docs to learn more.

The APIs you linked are for the old Matchmaker system, which doesn't apply to the new Matchmaking system.

Moreover, for the feature request you mentioned, you can vote it to help us prioritize our work.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

levet-jerome avatar image levet-jerome commented ·

Thanks for your answers!

Is using the old Matchmaking and server a problem? You are both suggesting that this is not the way to go.

If i want to summarize what you both suggest:

- Doing a custom CloudScript that my players will call, that will ListMultiplayerServers, and depending of the result (if there is an allocated GameServer with >0 free slots or not), serve it to the client, or call RequestMultiplayerServer and serve the result to the client.

In summary, using the new Servers 2.0 (preview), and completely bypassing the Matchmaking part, which, for my use case, makes completely sense.

Question about CloudScript: I don't see any documentation to write JS CloudScripts, all documentation i found looks for POST calls, or using clients SDKs (C++,C#...). Am i missing something?

Thank you again!

Jérome

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan levet-jerome commented ·

>>Is using the old Matchmaking and server a problem?

That should be fine, what I suggest was that the old Matchmaking System is not compatible with the new Matchmaking (Preview).

>>Question about CloudScript: I don't see any documentation to write JS CloudScripts, all documentation i found looks for POST calls, or using clients SDKs (C++,C#...). Am i missing something?

This tutorial might help: CloudScript.

0 Likes 0 ·
brandon@uprootstudios.com avatar image
brandon@uprootstudios.com answered

Hi, we use the GSDK with Servers 2.0 as well, so hopefully I can help answer some of your questions.

You're correct that both of the APIs you linked are for the old Matchmaker system and don't apply to the new one. What I'd suggest instead is, if you definitely need to have 1 player connected to a server, enable and use the RequestMultiplayerServer API. You can probably then have the server use Backfill tickets to try to add more players to the server. Let me know if this solution works for you!

We don't have any scenario in our game where only 1 user can join a server, but I'd imagine you can use this combination of APIs to do what you want.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

levet-jerome avatar image
levet-jerome answered

Thank you for your answers.

Is it a problem to use the old Matchmaker system + the old GameServer system? Because it may fill all my needs.

If it is, I can dig into the RequestMultiplayerServer API, combined with the ListMultiplayerServers i suppose.

- Having a custom CloudScript Calling first List, check if there is a server allocated with free slot, and return it to the Player if yes, and if no, call RequestMultiplayerServer and return the result to the client.
That solution is using the new Server 2.0 (Preview) and not the Matchmaking at all.

About CloudScript, where can i find any API/Documentation for it? Writing this JS scripts looks quite complicated, all documentation is using POST commands, and/or using a client SDK, like C++/C#.

Am i missing a CloudScript documentation somewhere?
Thank you!

Jerome

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.