Ali Şahan Yalçın
DocsFriends and presence

Social and platform

Friends and presence

Friends list, avatars, and the Rich Presence that puts a Join Game button on your name.

The friends list

Get Friends on the SteamForge Friends subsystem returns a resolved list:

FieldMeaning
Steam IdTheir ID
Persona NameTheir Steam name
NicknameThe nickname the local player gave them, if any
Display NameNickname when set, otherwise the Steam name. Use this one.
StateOnline, Away, Busy, Offline and so on
RelationshipFriend, incoming request, blocked and so on
In GameWhether they are playing something
Playing App IdWhat they are playing. Compare against your App ID to find people you can play with.
LobbyTheir lobby, when they are in one you could join
Steam LevelTheir community level

The Filter input decides which slice you get:

FilterWho
FriendsActual friends. The normal choice.
In This GameEveryone playing your game, friends or not
BlockedBlocked accounts
Incoming RequestsPending friend requests
EveryoneAll of the above
INFO: Show Display Name, not Persona Name. If the player gave someone a nickname, that is how they think of that person, and showing the Steam name instead is mildly jarring every time.

Avatars

Get Player Avatar (Async) returns a texture, at Small, Medium or Large.

It is a latent node because Steam caches avatars for friends but downloads strangers on demand. The synchronous version works in testing, where your friends are cached, and fails for the lobby full of strangers you wanted it for.

Cache the result against the Steam ID. A list rebuilt every tick will allocate a texture per player per tick.

Players Steam does not know yet

A Steam ID that came from a lobby, a leaderboard or a server may return an empty name, because Steam only pre loads friends.

Call Request User Information, then wait for On Persona State Changed before reading.

WARNING: Request User Information returns true to mean "a download started", which is to say the data is not ready. Reading it as success and using the name immediately is exactly what it invites.

Rich Presence

Rich Presence is a small set of keys you publish about the local player. Steam shows them on their profile and to their friends.

Two keys are special and Steam treats them as protocol rather than text:

KeyEffect
statusThe sentence friends see next to your name
connectA command line that puts a Join Game button on your entry

Convenience nodes for both, since those exact spellings are the whole feature:

  • Set Presence Status sets status.
  • Set Presence Connect String sets connect.
  • For a lobby, the connect string is +connect_lobby followed by the lobby ID. Whoever clicks Join Game gets that string back, and SteamForge reports it as On Lobby Join Requested whether their game was already running or the click launched it.

    Call Clear Rich Presence when the player leaves a match.

    Reading a friend's presence

  • Get Friend Rich Presence reads one key.
  • Get All Friend Rich Presence returns everything they published.
  • Request Friend Rich Presence is needed first for friends playing a different game. Within your own game Steam distributes it for free.
  • The answer arrives as On Friend Rich Presence Updated.

    Recent players

    Set Played With adds someone to Steam's Recent Players list, which is where players go to add somebody they enjoyed a match with.

    One call at the end of a session. It is the kind of thing only shipped games remember to do.