# What is multiplayer mode?
Multiplayer mode allows 2 to 4 players to experience your story together, each embodying a different role. Each player can have their own steps, their own choices, and their own variables, while sharing a common narrative universe. This is a unique feature of Livre Arbitre that opens the door to collaborative and immersive experiences.
A new narrative paradigm
# Enabling multiplayer mode
To enable multiplayer mode, go to your story settings (Configuration tab). There you will find the option to set the number of players (between 2 and 4) and configure multiplayer session settings.
Open story settings
From your story dashboard, click on the "Configuration" tab in the sidebar menu.
Enable multiplayer
Turn on the "Multiplayer mode" option and set the desired number of players (2, 3, or 4).
Configure roles
Assign a name or description to each player role so participants know which character they are playing.
# Assigning players to steps
Each step in your story can be associated with a specific player through the associatedPlayer field. This means only the designated player will experience that step. Unassigned steps are shared by all players.
Player labels
# Player-specific conditions
You can use the CurrentPlayer condition on links between steps to create different branches depending on the active player. For example, the same starting point can lead to different scenes depending on whether the reader is player 1 or player 2.
| Condition type | Description | Example |
|---|---|---|
| CurrentPlayer | Checks which player is currently reading | CurrentPlayer = 1: only player 1 sees this link |
| Global variable | Variable shared among all players | team_score >= 10 |
| Player variable | Variable specific to a particular player | player1_inventory contains 'key' |
# Shared and private variables
In multiplayer mode, variables can have two different scopes:
- Global variables — Shared among all players. Useful for tracking the general state of the story (e.g., an unlocked door, an eliminated NPC).
- Per-player variables — Specific to each player. Useful for individual inventory, personal stats, or private choices.
Watch out for conflicts
# Invitation system
To join a multiplayer game, players use the invitation system. The first player creates a game session, then invites other players by sharing a link or invitation code. Each player receives a notification and can accept or decline the invitation.
Create a session
The first player starts reading the multiplayer story and automatically creates a game session.
Invite players
From the waiting screen, the session creator can invite other players by username or share an invitation link.
Accept the invitation
Invited players receive a notification and can join the session with a single click.
Start the game
Once all players are connected, the session creator can launch the adventure.
# Automatic matchmaking
If you don't know anyone to play with, automatic matchmaking connects you with other players interested in the same story. The system searches for available players and automatically forms a group once the required number is reached.
# Best practices for multiplayer design
- Balance playtime — Make sure each player has a similar number of steps to go through to avoid some players waiting too long.
- Create convergence moments — Plan shared steps where all players come together to share their discoveries.
- Use global variables wisely — They allow one player's actions to have a visible impact on the others.
- Test with the right number of players — Verify that all paths are accessible and consistent for each role.
- Document the roles — Give each player a clear description of their character and objectives.
