Search Unity

  1. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  2. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  3. If you couldn't join the live stream, take a peek at what you missed.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

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

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

  1. moco2k

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    281
    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
  2. larus

    larus

    Unity Technologies

    Joined:
    Oct 12, 2007
    Posts:
    250
    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:
    281
    Thanks for the reply larus. This confirms my presumptions.
     
  4. thegreatzebadiah

    thegreatzebadiah

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

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    281
    Yepp, I've already switched to Match Up and I can confirm that it works flawless.
     
    thegreatzebadiah likes this.