CommunityDragon / Data

A place for keeping and discussing additional data we plan to provide through CDragon.
44 stars 12 forks source link

How to format `queues.json` file? #1

Open jjmaldonis opened 6 years ago

jjmaldonis commented 6 years ago

We want to provide a file with information about queues so that developers can automatically update their queues data without modifying code.

Below is the current idea for the format. In this issue I will try to summarize the discussion we've had about the format.

"Queue": {
  "id": int,
  "maps": List[int],
  "ranked": bool,
  "gameMode": str,
  "deprecated": bool,
  "name": str
}

Other relevant files might include: gameModes.json, gameTypes.json, seasons.json, and maybe a new maps.json file with additional information. Note that there are only three game types that Riot uses: CUSTOM_GAME, TUTORIAL_GAME, and MATCHED_GAME.

Notes about Queues:

"QueueResource": {
    "properties": {
        "areFreeChampionsAllowed": { "type": "boolean" },
        "id": { "type": "integer" },
        "isRanked": { "type": "boolean" },
        "isTeamOnly": { "type": "boolean" },
        "mapId": { "type": "integer" },
        "minLevel": { "type": "integer" },
        "mode": { "$ref": "#/definitions/GameMode" },
        "numPlayersPerTeam": { "type": "integer" },
        "queueName": { "type": "string" },
        "type": { "type": "string" }
    },  
}

We will try to maintain a TODO list in the comments.

jjmaldonis commented 6 years ago

TODO list:

bbqtd commented 6 years ago

After rethinking the purpose of queues.json I think we should deprecate the field "deprecated": bool, there is several reasons:

  1. as @jjmaldonis mentioned in https://github.com/CommunityDragon/Data/issues/1#issue-290207533 the file should be safe extendable;
  2. So, for me it looks like patches.json that share common data. Queue object should be immutable. For consumer it means that values of a Queue object doesn't changeable in future but a new field could be add in next version (which means extendable).

That is why I think deprecated should not to be in Queue object because it breaks rule №2. Also if we guarantee immutability it should improve the strategy of updating cache for consumer.

The deprecated describes a status of a queue, while Queue should describes preset (configuration) of a game match. The value of deprecated is important but should be in some other place.

As one of the workaround could be "deprecated": [queue ids...], which works realy nice with partial cache update because there is only new values appends to the array.

bbqtd commented 6 years ago

The date of queue release

Regarding to https://github.com/CommunityDragon/Data/issues/1#issuecomment-359188679 I can suggest a field that correspond to the when a queue was released. The value of the field should be patch name. The consumer could retrieve the additional values from patches.json. Also, this extension doesn't break immutability.

"Queue": {
  "releasedAt": str // e.g. "7.24"
  ...
}

We can find a better name for this field.

Examples

  1. getMatchlist
    • As consumer, I want to find a game matches (with specified filters) since a time when a queue was released.
  2. Comparing with other timestamps.
bbqtd commented 6 years ago

Rotating queue

As we know there are 2 types of queue:

  1. Regular queue, like 420 (SR 5v5 Ranked Solo)
  2. Rotating (temporary) queue, like 980 (Star Guardian Invasion: Normal)

I suggest a field that would describe this queue property. Something like "rotating": bool.

Why it is not related to the game mode?

For instance, let's look at 100 (Butcher's Bridge, ARAM). The queue is kind of rotating which game mode is ARAM. As we know, we have ARAM queue 450 that is regular. So we can consider that game mode can have both types.

Like mentioned in https://github.com/CommunityDragon/Data/issues/1#issuecomment-359188679 the property is kind of immutable.

bbqtd commented 6 years ago

Teams Identities (WIP)

Queue {
  teams: [{
    id: int,
    name: string,
    size: int,
  }],
  ...
}

The value is related to a queue because it describes the general game rule. Also, the value is immutable because a change has huge impact on old games that related to a queue. Each team has size which specifies number of players in a team.

Usage

With Riot API match and spectator endpoints.

wip...

bbqtd commented 6 years ago

The story about QueueID and zero value

Let's recap, there are 3 types of games:

TL;DR no matchmaking - no queue.

Why QueueID 0 means the Custom Games?

Like I said before CUSTOM_GAME has no matchmaking which means no queue. It's 0 ID because it's zero value for numeric type. The Riot API don't ommit queue, queueId, and gameQueueConfigId field in responses. Instead, when there is CUSTOM_GAME or TUTORIAL_GAME they return zero value of numeric type for this fields which indicates there is no queue.

Conclusion

There is no queue with ID 0. It's zero value for int which indicates a CUSTOM_GAME or TUTORIAL_GAME type.

Restructuring

  1. Deprecate Queue with 0 ID from list of queues.json;
  2. Redesign Queue type. Without applying other proposals:
    "Queue": {
      "id": int,
      "name": string,
      "gameMode": string, // before - "gameModes": []string
      "map": int,         // before - "maps": []int
      "ranked": bool,
      "deprecated": bool,
    }