Obtaining Map-Mode Pair Weights In Playlists
Note
The guide below is only applicable to Halo Infinite.
One of the interesting capabilities that we have in Halo Infinite is weighting of map-mode pairs in specific game playlists. When you're playing a game of Halo Infinite you're usually doing so from within a playlist, such as Team Slayer, Fiesta, or Ranked Arena.
In each of these playlists, you are more or less likely to get specific game modes depending on the weight of a map-mode pair - a combination of a game mode such as Slayer, Capture The Flag, or King of The Hill, among others, and a map such as Detachment, Argyle, or any other. Each of these weights is defined in the playlist asset file - a specific representation of a playlist that contains all the information about available map-mode pairs.
Here is the challenge, though - when the game starts and you start looking at the different game modes, the playlist metadata is actually never directly requested from the Halo Infinite servers. Instead, you would only see specific map-mode pair API requests. Those, unfortunately, have no direct relation to a playlist (that is - you can't find it from the map-mode pair configuration). So what do you do? Fortunately, there is a round-about way about getting the data and better understanding map-mode pair weights. It follows the steps:
- Get a player service record. The service record will contain a collection of playlists that the player has participated in during a season (or, this could be over the lifetime of the player). At this stage we have one piece of information - the playlist asset ID, but not its version.
- Request the playlist configuration. This will enable us to see the playlist version that is the latest release being actively used in a Halo Infinite build.
- Request the playlist asset manifest. Lastly, get the details about the playlist, including the weights.
To perform all of the above you can leverage Orion, which is what this guide will show.
You can use this snippet to get the data displayed in the terminal:
Task.Run(async () =>
{
var serviceRecord = (await client.StatsGetPlayerServiceRecord("zebond", LifecycleMode.Matchmade))!.Result;
if (serviceRecord != null && serviceRecord.Subqueries != null && serviceRecord.Subqueries.PlaylistAssetIds != null)
{
foreach (var playlist in serviceRecord.Subqueries.PlaylistAssetIds)
{
var playlistConfiguration = (await client.GameCmsGetMultiplayerPlaylistConfiguration($"{playlist}.json")).Result;
if (playlistConfiguration != null)
{
Console.WriteLine($"Playlist configration for {playlist} obtained.");
var playlistAssetManifest = (await client.HIUGCDiscoveryGetPlaylist(playlist.ToString(), playlistConfiguration.UgcPlaylistVersion.ToString(), client.ClearanceToken)).Result;
if (playlistAssetManifest != null && playlistAssetManifest.RotationEntries != null)
{
foreach (var rotationEntry in playlistAssetManifest.RotationEntries)
{
Console.WriteLine($"{rotationEntry.PublicName} has weight of {rotationEntry.Metadata!.Weight}");
}
}
}
}
}
Console.WriteLine("Got service record.");
}).GetAwaiter().GetResult();
Running this will enable you to see weights associated with each playlist ID and map-mode pair public name:
The snippet above assumes that you already have a HaloInfiniteClient
instance initialized. If you are new, feel free to refer to the intro guide on this topic.
The service record is obtained with the help of StatsGetPlayerServiceRecord
which accepts a gamertag as a parameter along with the type of games I want to track. In my case, I am interested in matchmade games that are represented by LifecycleMode.Matchmade
.
The playlists that I've played on are captured in the response object, which will be an instance of PlayerServiceRecord
. The array of playlist IDs will be inside Subqueries
under the SubqueryContainer
instance, which in turn will have a PlaylistAssetIds
property that contains a list of GUID identifiers for playlist asset IDs.
Next, I can use those asset IDs to pass them to GameCmsGetMultiplayerPlaylistConfiguration
. It's important to note that this method takes a file name as an arugment, and the playlist file name here is nothing other than the playlist ID with the .json
suffix. The result of this call will be a PlaylistConfiguration
instance that contains UgcPlaylistVersion
. We now have both the asset ID and its version - we can get the weights!
We pass the acquired information to HIUGCDiscoveryGetPlaylist
and get a Playlist
object in response that has the RotationEntries
property that lists all associated map-mode pairs. Each of those has a Metadata
property represented by PlaylistMapModePairMetadata
that has a Weight
value.
Note
Weight ranges are relative within the same plyalist and are not the same across different playlists. To understand the impact of the weight make sure to compare it against other weights within the same playlist and not others.
That's it! Now you too know how to get map-mode pair weights in a playlist and learn which game modes and maps are much more likely to happen when you play.