RealBridge Config Files

What is a config file?

(Updated 08/03/2021)

A config file (short for "configuration file") is a text file in a specific format. It contains information used by RealBridge about a session. Some of this is information that is available via the RealBridge application; some of it can only be viewed via the config file.

The main purpose is to allow you to run events over multiple sessions. However, the same config-file mechanism can also be used to create more sophisticated or custom configurations that can't be achieved using the RealBridge front-end directly, or to obtain additional information about the format of the event.


Main uses of a config file

Multi-session events

In a multi-session event, a config file is used by RealBridge to carry forward data from one session to the next session:

  • The config file tells the second and subsequent sessions the names of the contestants, where they should sit, and the current scores.
  • In a Round Robin event, the draw is set at the start of the first session. The config file gives each subsequent session the assignments for the remaining rounds.
  • In a Swiss event, the config file tells each subsequent session which contestants have already played each other.
  • In a Howell or Mitchell that is split across sessions, the config file tells each subsequent session where to restart the movement.

If you are simply using a config file as part of a multi-session event, for the transition from one session to the next, you do not need to understand the details of the config file. You can just use the config file, and it will work. For details, see:

https://realbridge.online/how-to-run-multi-session-teams.html
https://realbridge.online/how-to-run-multi-session-pairs.html

Initial configuration

For single-session events (or the first session of a multi-session event), you can use the config file to:

  • Restrict the event to particular players.
  • Pre-assign the starting positions or team numbers.
  • Set the names of teams in advance (but this can also be done, more easily, via the RealBridge application).
  • Specify the draw in a Round Robin.
  • Specify the first-round assignments in a Swiss.

This approach is useful for developers who wish to integrate RealBridge with their own front-end.

If you are creating config files manually, RealBridge recommends that you use this method only when necessary. Creating the config file manually is time-consuming, and it is easy to make a mistake in the configuration

Viewing future assignments

In a Round Robin teams, if you want to know what the future assignments will be, you can generate a config file and view the assignments for the entire event.


Loading and exporting a config file

Config files are loaded and exported from the Advanced menu.

If you are loading a config file, you should do this before you open the session for the players.

In a multi-session event, at the end of each session you must export the config file, before the session is destroyed.  At the beginning of the next session you load the config file. For more details, see:

https://realbridge.online/how-to-run-multi-session-teams.html
https://realbridge.online/how-to-run-multi-session-pairs.html

Before the start of a round robin, you can export a config file so as to find out what the assignments will be.

Important

If you have loaded a config file, or if you have saved the config file before the start of a Round Robin, do not subsequently change the number of tables. If you do this by mistake, reboot the session and then reload the config file.


Config file examples

The config file is in JSON format. The following examples demonstrate the use the file. A full list of allowed attributes and values is given later in this document. All components of the config file are case-sensitive.

Example 1: Single round-robin teams

The file will be ready to download in the chat box in the lobby:

    {
        "num_tables":5,
        "scoring_method":17,
        "vp_scale":2,
        "team_names":["Barcelona","Madrid","Valencia","Seville","Malaga"],
        "use_screens":true,
        "self_alert":true,
        "time_per_round":7800,
        "time_display":0,
        "boards_per_round":16,
        "match_assignments":[
            [ 2, 1, 5, 4, 3],
            [ 3, 4, 1, 2, 5],
            [ 5, 2, 4, 3, 1],
            [ 1, 3, 2, 5, 4],
            [ 4, 5, 3, 1, 2]
        ]
    }
	

Most of the elements are self-explanatory.

scoring_method:17 means round-robin IMP teams.

team_names lists the teams in order of table number, so Barcelona is at Table 1, Madrid is at Table 2, etc.

The match_assignments element works like this:

  • Each row is a round. The first row is round 1, the second row is round 2, etc.
  • Each column is the opponents for a given team. The first column is Team 1’s opponents. The second column is team 2’s opponents, etc.
  • If a team is shown as drawn against themselves, that means that they have a bye.

Hence this should be read as:

  • Round 1: 1 plays 2, 2 plays 1, 3 plays 5, 4 plays 4, 3 plays 5.
    That is: 1 v 2, 3 v 5, 4 has a bye
  • Round 2: 1 plays 3, 2 plays 4, 3 plays 1, 4 plays 2, 5 plays 5.
    That is: 1 v 3, 2 v 4, 5 has a bye
  • etc

For an explanation of the other elements in the config file, see later in this document.

This config file can be used in two ways:

  • Usually you will leave RealBridge to create the assignments. You may want to see what the assignments will be. To do this, immediately before starting the event, export the config file.  The match_assignments will contain the assignments for the entire round robin.
  • If you want to set the assignments yourself, you create a file like this before the event starts, and load it into RealBridge before the start of the first session. Then RealBridge uses your match_assignments data to determine the assignments.

Example 1a: After the first round is over

If you save the config from Example 1 at the end of Round 1, you will see several differences:

  1. The assignments element will have been split:

        "match_assignments":[
                [ 3, 4, 1, 2, 5],
                [ 5, 2, 4, 3, 1],
                [ 1, 3, 2, 5, 4],
                [ 4, 5, 3, 1, 2]
            ]
            "previous_match_assignments":[
                [ 2, 1, 5, 4, 3]
            ]
    		
    

    previous_match_assignments shows the round that has already been played.

    match_assignments shows the rounds that have not yet been played.

    After the second round, the next row from match_assignments would be moved into previous_match_assignments.

  2. The pairs that have played for each team will be listed:

            "co_lineups":[
                {"pairs":[["Alan Adams","Brian Birt","0"],["Caren Charles","Danni Downs","1"]},
                {"pairs":[["Ed Evans","Frank Fullerton","2"],["George Good","Harriet Howe","3"]}
                {"pairs":[["Ive Ince","James Jones","4"],["Karen Knight","Lisa Lowe","5"]}
                {"pairs":[["Mike Mill","Norman Nott","6"],["Ophelia Ord","Peter Piper","7"]}
                {"pairs":[["Quentin Quick","Richard Rice","8"],["Sara Smith","Tonya Town","9"]},
            ],
    
    

    The first array lists the players in Team 1, the second array lists the players in team 2, etc. If a team has had more than two pairs, all the pairs in the team will be listed.

    If you plan to use the config file in a subsequent session:

    • Do not delete or add any pairs.
    • You can edit a player’s name to correct an error. If the player’s name appears in more than one place, make exactly the same changes to every instance of the player’s name.

  3. Score information will have been added, in elements called co_pair, co_pair_den, co_total. Do not edit or delete this information.

Example 2: Double round-robin teams

To play a double-round robin, we simply add more assignments:

    {
        "num_tables":5,
        "scoring_method":17,
        "vp_scale":2,
        "team_names":["Barcelona","Madrid","Valencia","Seville","Malaga"],
        "use_screens":true,
        "self_alert":true,
        "time_per_round":7800,
        "time_display":0,
        "boards_per_round":16,
        "match_assignments":[
            [ 2, 1, 5, 4, 3],
            [ 3, 4, 1, 2, 5],
            [ 5, 2, 4, 3, 1],
            [ 1, 3, 2, 5, 4],
            [ 4, 5, 3, 1, 2],
            [ 1, 4, 5, 2, 3],
            [ 4, 5, 3, 1, 2],
            [ 5, 3, 2, 4, 1],
            [ 2, 1, 4, 3, 5],
            [ 3, 2, 1, 5, 4]
        ]
    }
	

Note that the second round-robin does not have to be the same as the first round robin.

Example 3: Teams of eight

Starting with the config file from a teams of four event, you can edit the matchups in the config file so that fours from the same eight never play against each other. You can then load this file and start the session. At the end, add the scores from the two fours of each team to get the teams-of-eight results.

Rules for specifying round-robin assignments

If you specify match assignments then you should do so for (at least) all the rounds that you plan to play in this session. (If you don’t, when you get to the end of the predefined assignments, RealBridge will do a random draw, which may involve rematches.) It’s simplest to include assignments for all the matches that you plan to play in the event.

For each round, you must ensure that the assignments match. For example, if you specify that 1 plays 4, you must also specify that 4 plays 1.

Example 4: Swiss Teams

For Swiss events, you can specify match assignments for any number of rounds. In particular, you can specify a fixed draw for the first round instead of using the default random draw. Once all specified rounds have been played, RealBridge will create a Swiss draw for each round based on the current scores.

    {
        "num_tables":20,
        "scoring_method":33,
        "vp_scale":2,
        "team_names":["Barcelona","Madrid","Valencia","Seville","Malaga", ... ],
        "use_screens":true,
        "self_alert":true,
        "time_per_round":7800,
        "time_display":0,
        "boards_per_round":16,
        "match_assignments":[
            [ 4, 17, 9, 1, ... ]
        ]
    }
	

The configuration looks exactly the same, except that the scoring method is 33 (which means Swiss Teams), and you only specify assignments for one round (or you could preassign more than one round if you wanted to).

In this example, 1 plays 4, 2 plays 17, 3 plays 9, 4 plays 1, etc.

Example 5: Seat assignments in a pairs event

Another customisation possible with the config file is to "reserve seats" by name. When a player logs in with a name that matches a seat reservation, they will automatically be taken to the correct table and seat. (It can be helpful to combine this option with customised links per player, so that their name is encoded in the link parameters - this ensures that the names match.)

Seating assignments are used automatically in multi-session pairs events, to ensure the pairs start in the correct place to continue the movement. They can also be used for a single-session event (or the first session of a multi-session event), using a config file created outside RealBridge.

    {
        "num_tables":2,
        "seat_assignments":[
            {"n":"Alice","s":"Bob","e":"Clare","w":"Doris","table":1},
            {"n":"Ed","s":"Fiona","e":"Geoff","w":"Henrietta","table":2}
        ]
    }
	

This simple example assigns players to seats assignments for two tables.

You will see the keys ew_pair and  ns_pair in an exported config file, you do not need to set these, they are assigned internally.

Example 6: Seat assignments in a teams event

In a teams event, you can either use the same "table":n method, or use "team":"team name". If you do this, you must also use a team_names element to define the team-names:

    {
        "num_tables":5,
        "scoring_method":17,
        "vp_scale":2,
        "team_names":["Barcelona","Madrid","Valencia","Seville","Malaga"],
        "seat_assignments":[
            {"n":"Alice","s":"Bob","e":"Clare","w":"Doris","team":"Valencia"},
            {"n":"Ed","s":"Fiona","e":"Geoff","w":"Henrietta","team":"Madrid"}
        ]
    }

Seat assignments are not automatically created in multi-session teams events. This is because a team may want to change its lineup or switch directions.

If you have your own mechanism for teams to submit line-ups for a session, you can create a config file to ensure that players sit in their allotted seats.

Notes about seat assignments

You are not obliged to assign players for every seat, or for every table. For example, this assigns the NS pair at table 2 but leaves EW open:

    {"n":"Ed","s":"Fiona","table":2}

This can be used when you have a sitout, or when you only know about some of the players.

Even if some seats have been preassigned, you can still add tables as normal.

Clicking the "Minus" button will remove missing pairs, even if a pair is preassigned to the seats. This may result in changes to the initial positions of other pairs, as they are moved to fill in the gaps.

If a player logs in with a name that is not assigned to a seat, by default they will arrive in the lobby as normal. They will not be able to sit in a seat that has been pre-assigned. If they should have been preassigned, ask them to log in again, using exactly the same form as the preassigned name. Note that player-names are case-sensitive.

You can prevent unassigned players from logging in by setting the parameter prevent_unreserved_login to true. Note that this only works if there are no seats that have not been assigned a player. If you have a mixture of unassigned and assigned seats, a player will still be able to log in. This is so that, if a player is having trouble logging in with the name you used in the config file, you can remove the assigned name and allow the player to log in.

From the lobby, a pre-assigned seat will initially be shown as occupied, but in pale green to indicate that the player has not yet arrived. When the player logs in, the seat will appear as occupied in the normal colour.

If you want to open a pre-assigned seat to somebody else, use the "kick player to lobby" mechanism to remove the preassignment. Then another player can take that seat from the lobby. In the "kick player to lobby" drop-down, a seat which is reserved but currently empty will appear as "RESERVED", followed by the player’s name.

If a player at a preassigned seat clicks "Leave", he goes to the lobby and the seat becomes vacant.

 


Table Announcements

[Added 10th April 2021]

A table announcement is a message or piece of content that appears on each table before the start of a session or at the end of a round. Table announcements are sometimes referred to as the tablecloth. In essence, they are a block in which HTML that can be displayed in place of the normal table top.  They are completely customisable.

1.    Terminology

Config File – A config file is a JSON file which is uploaded at the beginning of a session with settings for the session.

2.    Example of a Table Announcement File and Result

{
"table_announcements": [ { "round": 1, "html": "<p><img style='display: block; margin-left: auto; margin-right: auto;' src='https://realbridge.online/assets/img/icons/logo_club.svg' alt='' /></p><h1 style='text-align: center;'>Welcome to RealBridge</h1><p style='text-align: center;'>Here is a link to our <a href='https://realbridge.online/'>website</a></p>" } ]
}

 

3.    Editable Keys

Key

Data type

Notes

table_announcements

Array of JSON elements

Each element of the array is one table announcement.

round

Integer or "all"

0 – Before the session has started.
1 – After round 1 has finished.
3 – After round 3 has finished.
“all” – After every round, unless you have also specified a table announcement for that round.

html

String

String of HTML.
If this contains double quotes, they must be escaped with a backslash.

Cannot contain newlines (but can contain HTML line-breaks, paragraph tags, etc).

 

4.    Multiple Announcements Examples

{
"table_announcements": [ { "round": "all",       "html": "<h1>More rounds still to come!</h1>" }, { "round": 0,       "html": "<h1>Welcome to today’s session</h1>" }, { "round": 10       "html": "<h1>Thank you for playing!</h1><p>See you at the county Swiss pairs<p>" } ]
}

5.    Useful links

HTML Online

HTML Online is an online rich editor which you can edit use to make your table announcement and then copy the HTML.

W3Schools

W3Schools provide extensive HTML documentation with useful editable examples.

JSONLint

Use this to validate the JSON in your config file.

YouTube

A link to a tutorial on how to make a table announcement.

 

6.    Hints


How to create a config file

You can, if you like, create a config file entirely outside RealBridge.

However, for round-robin events, it is often easier to do some of the work in the RealBridge front-end. The suggested procedure is:

  • Create a new session. This will just be a dummy session.
  • In the session, create the session settings, set the right number of tables, and fill in the names of the teams.
  • Save the config file.
  • Edit the config file in a text editor. We recommend Visual Studios (See Below) but you can also use TextPad or NotePad++ for Windows, or TextEdit for Mac, but you can use any text editor, even Notepad.
  • Create a new session (or reboot the one you used earlier). This will be the session you actually use.
  • Load the config file.
  • Check the settings.
  • You can change the session settings at this point.
  • If you included match assignments in the config file, do not change the number of tables.
  • Open the session.

Recommendations

We recommend using Visual Studios Community (Free) to edit config files as there are many features that make it easier to edit. When you install (or modify your current version of Visual Studios) you will need to install the ".NET Desktop Development" package. See how to install Visual Studios and some other useful tips in our video tutorial.

When editing the config file, it is OK to add spaces and line-endings between the elements, to make the file easier to read and edit.

For both loading and exporting, it is always best to start with a clean environment. Therefore:

  • If you made a 'dummy' session - for the sole purpose of saving its config file for as a starting point for editing - reboot or destroy it after you have saved the config file.
  • If you have loaded a config file but then decide to amend it outside RealBridge:
    • Reboot your session
    • Load the amended file.

List of editable config keys

Key name Type Description/comments
num_tables
Integer Number of tables.
In a multisession event, this must be the same for every session.
You should always include num_tables in the config file.
boards_per_round
Integer Boards per round. Usually this will be the same in every session, but it can change if required.
num_rounds
Integer The number of rounds that will be played in this session (not the total rounds in the event).
first_board
Integer The board number to start from. Defaults to 1 for every session.
Avoid having board numbers that go above 99.
scoring_method
Integer Defines the scoring method of the session, for value list, see below.
scoring_break
Boolean In round-robin matches, whether there is a break at half-time. This is equivalent to selecting the "Round-robin 2X½" movement.
name
String The session name, which appears in the yellow band at the top of the lobby window.
match_assignments
Array of integer arrays In a round-robin or Swiss teams event, the assignments for upcoming rounds.
previous_match_assignments
Array of integer arrays In a round-robin, Swiss teams or Swiss pairs event, the assignments for rounds that have already been played.
team_names
Array of strings In a teams event, the names of the teams, in order (so the first name is team 1, the second name is team 2, etc.
club_name
String Club name (Advanced screen).
club_id_number
String Club id (Advanced screen).
ebu_charge_code
Integer EBU charge code (Advanced screen).
ebu_masterpoint_scale
Integer EBU masterpoint scale (Advanced screen).
0 = None.
1 = Club scale.
time_per_round
Integer Time per round in seconds.
time_display
Integer How to show the remaining time.
0 = minutes only.
1 = MM:SS.
vp_scale
Integer VP scale for round-robin and Swiss events.
0 = none.
1 = 20-0 discrete.
2 = 20.00-0.00 continuous.
self_alert
Boolean If set to true, use self-alerts and written explanations.
use_screens
Boolean If set to true, use screens mode.
co_lineups
Array of objects See example 1a above.
prevent_unreserved_login
Boolean If set to true, prevents logins by usernames without a seat.
seat_assignments
Array of objects

See examples 4 and 5 above.

trick_one_delays
Array of 3 integers Imposing delays for 1: opening lead, 2: dummy, and 3: third hand. The maximum value is 30 seconds. 

Scoring methods

The scoring_method key specifies both the movement and the scoring method. The list of values is:

0 Practice tables (or RealBridge Lounge)
1 Head-to-head IMP teams
2 Matchpoint Mitchell
3 IMP pair Mitchell
4 Matchpoint switched Mitchell
5 IMP pair switched Mitchell
6 Matchpoint Howell
7 IMP pair Howell
14 Head-to-head BAM
17 Round-robin IMP teams
30 Round-robin BAM
33 Swiss IMP teams
34 Matchpoint Swiss pairs
35 IMP Swiss pairs
46 Swiss BAM

Non-editable config keys

Config files that you exported from RealBridge may contain other keys. Do not edit or remove these.