question

rob avatar image
rob asked

GetCurrentGames is a bit sketchy

We have a lobby list of games for players to join which is created by calling GetCurrentGames. Unfortunately we've noticed that games will often show up as having slots available when they don't or having some data set when it shouldn't be. And if you refresh the lobby list a few times the games will often switch between saying they are full or they are open (despite nobody joining or leaving). It takes a minute or two before it stabilises after any change to game data or number of players. It doesn't make for a great user experience if they're constantly being shown open games in the lobby and trying to join only to be told they are full.

Is there anything we can do about this?

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

Can you provide some specifics on your repro case? The GetCurrentGames call returns the set of servers and slots based on what's in the matchmaker, so it should always be up-to-date.

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.

rob avatar image rob commented ·

In that case hopefully it's something we're doing wrong so we can fix it.

I have been able to reproduce using Postman.

1. Create a new game.

2. Set some GameServerData (or a tag or something, it all has the same effect).

3. Call GetCurrentGames and see that the GameServerData is set as it should be.

4. Make a change to the GameServerData.

5. Call GetCurrentGames. It takes a few attempts before the new GameServerData is reflected but that's acceptable. Note that the new GameServerData has now been set.

6. Call GetCurrentGames a few times. GameServerData will switch randomly back and forth between the old and the new data before eventually settling on the new data after a minute or two.

Worth pointing out that the 'RunTime' variable returned with the game data in GetCurrentGames increases with every successive call as you would expect.

0 Likes 0 ·
brendan avatar image brendan rob commented ·

Got it - thanks. The results of GetCurrentGames are pulling from a cache, so there can be up to a 10 second lag in the info being up-to-date with the latest changes. It sounds like that's specifically what you're seeing in this case - that you make a change, and immediately query for the latest info, and get a 50/50 chance of that change being in the new data (for a few seconds). If you're showing a display to the player, in order to let them choose a game, the data is going to be out-of-date by the time you can display it, so while I grant that the 10 second cache means that you'll have some data that could be "fresher", you're always going to have the problem that a player might click on a game only to find that it's not available anymore. In general, my recommendation would be to use the matchmaker to get players into games as quickly as possible, rather than showing them a list of potential games and waiting on them to choose one.

0 Likes 0 ·

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.