question

rob avatar image
rob asked

Max players is always null

Whenever I call PlayFabClientAPI.GetCurrentGames to get a list of games, the returned GameInfo always has MaxPlayers set to null. I have set up Game Modes in the back end and have set max players there so I would have thought that would be enough to retrieve that information. Other information on the GameInfo such as LobbyId is correct.

10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

When you call GetCurrentGames, we pull the information for each active game, but that information is set on the running game instance when it is started - so changes to the Game Modes afterwards won't be reflected. Is that what you're running into? If not, can you provide us with a repro case, and confirm that we can test this out in your title?

22 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.

rob avatar image rob commented ·

That doesn't seem to be the issue since my Game Modes have been set up for several builds now. Just tested on a new server build, same problem. It definitely seems to recognise my game modes because if I try to call StartGame with a Game Mode that doesn't exist it will not work. And when I call GetCurrentGames the returned info has the correct Game Mode, but it doesn't seem to matter which Game Mode I choose, max players is always null.

What would you need from me in order to test this on my title? I'm happy for you to do that. As far as reproducing it, I'd say I'm not doing anything fancy. Just a simple server (with calls to RedeemMatchmakerTicket/NotifyMatchmakerPlayerLeft to keep track of players), launched by a client call to PlayFabClientAPI.StartGame (with GameMode, Region and BuildVersion set in the request). Then requesting the rooms with GetCurrentGames with no parameters.

0 Likes 0 ·
brendan avatar image brendan rob commented ·

To be clear, I was saying that changes to a Game Mode after starting a game instance wouldn't be reflected in the running instance - not doubting that the Game Mode was there, as you are correct that you wouldn't even be able to start the instance with an invalid Game Mode.

For the repro, all we're asking is for permission to start a game instance in your title, using your build setup, so that we're testing your exact configuration. If that's okay, just let us know what times you'll be testing, so that we avoid doing our tests when you need the server.

0 Likes 0 ·
rob avatar image rob brendan commented ·

Hi Brendan, that's fine, I will not be using it until Monday now.

0 Likes 0 ·
Show more comments
nickpruehs avatar image nickpruehs commented ·

We are running into a similar issue.

Our setup is as follows:

- We want to use an external game server (as explained in

https://api.playfab.com/docs/tutorials/external-game-servers) before moving to Playfab Custom Game Servers, mostly for testing and cost reasons.

- We are using Unreal Engine 4 dedicated servers, which are calling RegisterGame and RefreshGameServerInstanceHeartbeat as expected. They show up in the "Active Games" section.

- Both a build and a game mode have been properly (?) set up in the Playfab backend.

Now, I'm running a server locally (for testing purposes). The server shows up in Active Games. However, clients calling Matchmake receive a MatchmakeStatusNoAvailableSlots error from the Playfab Unreal SDK. Calling GetCurrentGames instead and writing its response to the log yields the following results:

BuildVersion: 0.1.570

GameMode: SKM

GameServerStateEnum: Open

LobbyID: 3040746764956521693

MaxPlayers: 0

pfRegion: 2

ServerHostname: 127.0.0.1

ServerPort: 7777


I suspect MaxPlayers being zero is not where we want it to be. We've tried setting the game mode Min Player Count and/or Max Player Count to 2, but none of these combiniations helped.

Are we missing something?

0 Likes 0 ·
brendan avatar image brendan nickpruehs commented ·

The max player count in the Game Mode is indeed what tells us how many player slots exist in a given game session, so that should be greater than zero, yes. What's your Title ID, so that we can have a look at the setup?

0 Likes 0 ·
nickpruehs avatar image nickpruehs brendan commented ·

Hey @Brendan, thanks for the quick answer! Our title ID is A821. I hope you can help!

0 Likes 0 ·
Show more comments
Show more comments

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.