Search Unity

Matchmaking - How to add Custom Data to a Match? SetMatchAttributes, MatchInfoSnapshot?

Discussion in 'Multiplayer' started by moco2k, Jun 11, 2018.

  1. moco2k

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    294
    Hey everyone,

    I want to add some custom information to a match created with Unity Matchmaking.
    For example, imagine something like difficulty mode, name of the current map, etc.

    The docs say that there is SetMatchAttributes and MatchInfoSnapshot, but I don't understand how it works.
    How do I properly set match attributes? Are those features even fully implemented yet?
    I've tried to search for information already, but it looks quite bad, for example #1, #2, #3, #4

    As a workaround, I could imagine to put all information into the match name and parse particular information chunks later. But it seems it's not possible to change the name of a running match, so I guess I would need to re-create the match for the matchmaker if I want to update any information during a game in progress (?).

    Any help is much appreciated!
     
    Last edited: Jun 13, 2018
    NerdHerdGames likes this.
  2. larus

    larus

    Unity Technologies

    Joined:
    Oct 12, 2007
    Posts:
    280
    There isn't any special way to set arbitrary attributes/data like you want to (the SetMatchAttributes actually only exposes setting the match to listed or unlisted). It's possible to set this up in the match name as you currently do, and then filter against the name when you fetch the match list. This is fine for when you only need to set this data on match creation, if you want to update it as the match goes on it gets tricky yes, there is no support for updating the match name after the match starts unfortunately.
     
  3. moco2k

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    294
    Thanks for the reply larus. This confirms my presumptions.
     
  4. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @moco2k maybe try looking into Match Up. It allows all sorts of custom data.
     
    NerdHerdGames and moco2k like this.
  5. moco2k

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    294
    Yepp, I've already switched to Match Up and I can confirm that it works flawless.
     
  6. NerdHerdGames

    NerdHerdGames

    Joined:
    Dec 28, 2016
    Posts:
    3
    @thegreatzebadiah Can you change/update the Match Data dictionary with MatchUp in real-time? For example, when the round ends in a match can I update the Match Data to display the new map name?
     
  7. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
  8. NerdHerdGames

    NerdHerdGames

    Joined:
    Dec 28, 2016
    Posts:
    3
    @thegreatzebadiah I should've known. You and your team always make amazing products.
     
    thegreatzebadiah likes this.