Skip to main content

Cross-platform friends overview

EOS Online Subsystem provides a cross-platform friends system that goes beyond the functionality that the EOS SDK provides. Of note:

  • The plugin includes local friends (such as those from Steam and consoles) in the friends list, and you can invite these friends to parties and sessions with no additional code.
  • The plugin caches local friends in Player Data Storage. This means if a player starts playing on another platform, they can see all their local friends from any platform they've previously played on. They can also invite these cached friends to sessions and parties, as long as those cached friends have previously played the game before.
  • The plugin implements the "blocked players" and "recent players" functionality of the online friends interface. It also automatically tracks which players you see on multiplayer servers, and syncs them to the "recent players" list for you.
  • The plugin allows you to invite any EOS user to your friends list, and accept or reject invites from any player. You don't need Epic Games accounts for this to work.
info

Local platform friends are not cached into Player Data Storage on console platforms, nor are cached friends from other platforms displayed on console platforms. You can still manually add any EOS user to the cross-platform friend list via SendInvite though.

Prerequisites

In order for the cross-platform accounts system to work, there are some prerequisites that must be met:

  • The client policy used by the game must permit access to Player Data Storage. This is where the plugin stores the user's cross-platform friends list, blocked players and recent players.
  • The client policy used by the game must permit access to P2P. This is how the plugin communicates friend invites, as well as acceptance and rejection messages.
  • The client policy used by the game must allow users to read user information about any other EOS user. This is used to load information about friends on the cross-platform friends list.
  • For any local subsystems you want to display friends from, you need to add those subsystems as delegated subsystems.

How the friends list is generated

To present the friends list to users, the plugin reads friends from all available sources (such as local subsystems and Epic Games), combines this with any friends directly added to the cross-platform friends system, and then unifies friends into a single list. For the purposes of this process, Epic Games is considered an "always included" delegated subsystem, as long as the user is signed into an Epic Games account.

The process that happens every time you call ReadFriendsList is as follows:

  1. The plugin calls ReadFriendsList on any delegated subsystem where the local user is also signed in.
  2. For all the delegated subsystems where the ReadFriendsList operation succeeds, the plugin calls GetFriendsList and fetches all of that subsystem's friends.
  3. On non-console platforms, we fetch the avatar URLs of all of the friends we were able to retrieve. This is so we can store the avatar URL in the cache and then fetch it later when displaying the cached friends on another platform.
  4. On non-console platforms, for every subsystem we were able to fetch friends for, we store a cached copy of those friends back to Player Data Storage so we can fetch them on other platforms later.
  5. On non-console platforms, for any subsystem that the user has cached friends for, that we didn't manage to read friends for directly through the process above, we add those cached friends to the list of friends fetched.
  6. For all of the friends fetched (from local subsystems, Epic Games and the cache), we ask the EOS SDK to look up the EOS product user ID based on the external account ID for the friend we fetched. An external account ID can be e.g. a Steam ID of a Steam friend.
  7. For some friends, we'll get back a valid product user ID. These friends have played the game before, as they generated an EOS product user ID when they signed in for the first time. For the remaining friends, we'll get back no product user ID. Those friends have not played the game before.
  8. We unify the friend entries based on the EOS product user ID.
    • For example, if we fetched friends from both Steam and Discord, and a given Steam ID and a given Discord user ID both have the same EOS product user ID associated with them, then we know this is the same person. That friend has played the game on both Steam and Discord, so we can present that friend as a single entry to the player, rather than having duplicate entries.
  9. We read the list of both inbound and outbound pending invites from Player Data Storage, and add these pending users to the friends list. These users will have their invite status set to PendingInbound or PendingOutbound so you know they aren't full friends yet. Friends which have accepted invites or friends from delegated subsystems will have an invite status of Accepted.
  10. We now have a full list of unified friends, plus the inbound and outbound friend invites. This final list is the list of friends you'll receive when calling GetFriendsList.

Accessing and modifying the friends list

For information on how to actually read and modify the friends list from within your game code or blueprints, refer to the Subsystems APIs -> Friends section of the documentation.