Player relationships
TL;DR
Talo's Player Relationships API is the easiest way to build friends lists, follower systems, party invites and other social features that need player-to-player connections.
Player Relationships work by creating subscriptions between players, notifying them when there's a new message. Each subscription is a stored relationship you can query and use however your game needs. Request flows, real-time messaging between linked players and notifications are automatically handled for you.
Subscription-based connections
Player relationships work through a simple pub/sub model. When Player A subscribes to Player B and the subscription is confirmed, Player A receives all messages that Player B sends. Player B publishes, Player A subscribes - creating persistent subscriptions between players.
This publish-subscribe pattern is completely flexible. You can use it for friends lists, guilds, messaging systems, or any scenario where players need to connect. Players can send messages about achievements like beating a level or finding a rare item, and all subscribers receive them instantly.
Building co-op features? Players can subscribe to their party members. Verify who's in the party by checking subscriptions, send messages when players trigger events, or show online statuses for the group using player presence. The subscription persists across sessions, so the party stays connected.
All this happens with just a few lines of code. Search for players, create subscriptions, and let Talo handle the persistence and querying.
Real-time messaging
Once connected, players can publish messages to all their subscribers. You can choose to send plain text, JSON data, or whatever format works for you (as long as it can be converted to a string).
Players can send messages about availability status, high scores, rare item finds, or any custom game event. All subscribers receive them in real-time, so there's no polling or manual checking. You can easily show notifications and trigger UI in your game in response to these events.
Flexible relationship types
Talo Player Relationships are designed to be flexible and supports both one-way and two-way relationships so you can build what makes sense for your game.
One-way relationships work like following someone on Twitter/X. Player A subscribes to Player B, but it doesn't go both ways. This is useful for situations where the subscribed-to player doesn't need to know about their subscribers.
Two-way relationships work like traditional friend lists. When both players accept, they're automatically subscribed to each other. Great for co-op games where you want matched pairs - send a friend request, they accept, and now you both see when the other is online and ready to play.
Managing connections
Since subscriptions are persistent relationships, you can query them like any other game data. Check if a subscription exists between two specific players, list all of a player's subscriptions, or filter to show only confirmed subscriptions.
You can query subscriptions to see who a player is subscribed to, check if a subscription exists between two players or filter to find mutual subscriptions. These queries make it easy and intuitive to build UI for your social features.
Our Godot plugin and Unity package both include a complete friends list demo showing the full flow: searching for players, creating subscriptions, accepting requests, displaying online status and messaging between players. You can easily drop the sample into your project and adapt the UI to fit your needs.
Real-time notifications
Your game gets notified instantly when relationship events happen through the Talo Socket. No polling, no manual checking - here are some of the events you can listen for:
- Request received - Another player sent you a relationship request. This includes their player information so you can identify who wants to connect.
- Request confirmed - Someone accepted your relationship request. The subscription is now active and both players can exchange messages.
- Request cancelled - A pending relationship request was deleted before being confirmed, either by the person who sent it or the recipient.
- Relationship ended - A subscription was deleted by one of the players. This includes info about which player ended it.
- Message received - A message arrived from a player you're subscribed to. Delivers both the sender's info and the message content.
All events fire in real-time as they happen. Your game can respond immediately - update UI, trigger gameplay events, display notifications or handle the data however fits your design.
Frequently asked questions
1.How do player relationships work in Talo?
Player relationships are based on player-to-player subscriptions. One player searches for another and sends a subscription request. Once confirmed, they can broadcast messages to each other in real-time through the Talo Socket.
2.What's the difference between one-way and two-way relationships?
One-way relationships work like traditional social platform follows - Player A subscribes to Player B, but not vice versa. Two-way relationships automatically create reciprocal subscriptions, like traditional friend lists where both players are connected to each other.
3.Can I build a friends list system with player relationships?
Yes. The Godot plugin includes a complete friends list demo showing how to search for players, send friend requests, accept them, display online status and send messages between friends.
4.How do real-time notifications work?
All player relationship events fire through the Talo Socket in real-time. Your game receives instant notifications without polling, so you can update your UI immediately as social interactions happen.
5.Can players unsubscribe from relationships?
Yes, however only the subscriber can revoke a relationship - if you subscribe to someone, you can unsubscribe anytime. However, if someone subscribes to you, only they can remove that subscription.
6.What kind of data can I send in broadcast messages?
You can send any data that converts to a string - plain text, JSON objects, or custom formats. This flexibility lets you build any social messaging your game needs.