Add API to determine if two players can play together

Table of Contents

The Challenge

Back to Top

As a Roblox developer, it is currently too hard determine if two players can play together or not.

Two players cannot play together if one player has cross-platform disabled and the other is on a different platform, for example a xbox and pc player.

This can result in buggy behaviors such as the one below:

Use Cases

Back to Top

There are many systems that would benefit from being able to determine if two players can play together.

  • Matchmaking systems
    • As there is no way to distinguish if players can play together, matchmaking with console players is impossible. For example, if you match cross-platform enabled and disabled users together, they will become separated and result in buggy behavior as described above.
  • Queue / Party systems
    • Similar to the issue above, teleporting a party or group of players which cannot play together will result in the group being split upon arrival.
  • Visiting systems
    • A lot of popular games have visiting features where you can visit other people’s island, creations, houses, etc. from other servers. Upon teleporting, some players would be in separate servers, which could result in some buddy behavior, such as duplication bugs, data corruption, and more.

The Solution

Back to Top

To fix this problem, there simply needs to be an API to check if two players can play together. That way, it’s future-proof, and not built on just the platform.

This already exists for things like chatting - see Chat:CanUsersChatAsync(id1, id2) for example. An API like Players:CanUsersPlayAsync(id1, id2) wouldn’t be that different.

Ideally, unlike CanUsersChatAsync, this should work even if two players are not in the same server, as the most common usage would be for pairing players into the same server from different ones.

However, it’s ultimately up to the engineers to decide what API works best.

If Roblox is able to address this issue, it would improve my development experience because systems could respect this value and avoid numerous buggy behaviors as described above.

Final Notes

Back to Top

Thank you for spending your time reading this.

If you’re a Roblox Engineer, please consider adding this feature. It would help promote the idea of the metaverse that Roblox is trying to create.

If you’re a Developer, please like this post to show how important this feature is. Additionally, if you have any additional use cases, leave them below or message me and I’ll add them to the list.

Thanks again,
-@ThatTimothy

Poll

Back to Top

Started 2022-05-06T11:19:00Z

Should this be added?
  • Yes
  • No

0 voters

If you said no, please send the reason below. I’m always open to any suggestions!

26 Likes

If they expose this as a value, you still need to maintain a bunch of logic yourself, and if they ever change how this value works or it requires aggregation of multiple observations on a user, you’ll have to update your code to match.

Maybe something like an API that tells you “can these players play together?” is more generic and more appropriate to solve your issue? It can be extended to cover other restrictions than just cross-platform play without you needing to adjust your code. You generally don’t want to write code on specific observations on players since this is very hard and subject to change.

High-level concepts like “can play together” can be managed by Roblox and the inner logic can be abstracted away from you, it should be easier to deal with.

2 Likes

This would be a much more future-proof solution. I was just trying to give an example that would fit the current way things work right now, but ultimately it’s up to engineers how they want to solve this problem.

The main problem is what you said - we have no way of determining if two players can play with each other. I’ll edit my request to better reflect that.

Thank you.

Did you read the post? It clearly explains there are cross-play limitations between some platforms.

1 Like

Updated to be more clear and list a current api very close to the one proposed, CanUsersChatAsync.

Also added a poll to see if anyone disagrees with this change.

1 Like

How does CanUsersChatAsync help devs with cross-platform matchmatching?

I beleve you misread my post. I say they are two similar APIs as they both would determine a relationship between two players (can chat to each other vs can play with each other)

I think this is helpful as it shows this matches the flow of current APIs, and wouldn’t be weird to add. Additionally, it demonstrates a possible way this API could be implemented.

1 Like