Skip to content

Matches ~ Tournament Integration

Nat edited this page Nov 6, 2023 · 1 revision

In this document, we look to outline how matches and lobbies work w.r.t. tournaments. See: Tournaments ERD, Matches User Stories.

Lobby-Matches Relationship: Matches and lobbies have 1-1 relationships. Lobbies precede matches: a user creates a lobby, but they don’t create a match. Only after a lobby meets some set of conditions (see more in user stories) does the lobby enter a game. At this point, a match instance is created, tied to this specific lobby. However, this match instance works more as a record of the game than as a representation of the actual game being played: it is in the lobby that the status of the match is tracked.

Matches: As stated, this is like a record entity. We anticipate the primary use-case for this entity is in tracking and aggregating statistics for individual users. In this sense, it differs from the matches that are currently described in the tournaments ERD: attributes like MatchStatus, MatchStartDate, MatchEndDate, MatchDuration- that is, those which are relevant to the running of the game, are instead stored in the lobby entity. Of course, as matches have a 1-to-1 correspondence to lobbies, it’s not as if these elements are then inaccessible given a match_id. But we gave meaningful consideration to this design decision: we wanted to break out synchronous data from asynchronous data.

Lobbies: Lobbies track the status of the game, and are the control mechanism by which users either join or spectate a game. These don’t feature in the Tournaments ERD, but hopefully based on what has been said above and our user stories, they seem like a justified addition. Their integration into the current Tournaments ERD seems pretty straightforward:

  • A Lobby entity with the same attributes as the update from #140.
  • 1-1 relationship with matches
  • 1-1 relationship with games
  • 1-N relationship with users

Observations on the Tournament(entity) in the tournament ERD: This looks something like a super-lobby (to us), in the sense that from an instance of a tournament, all the necessary lobbies are spun out. In this way, we can create an easy integration of the matches and tournaments functionality: just plug matches in, through the creation of this lobby. It’s not entirely clear to us how the outcomes will be tracked (i.e., how the users who make it to the next round will be tracked), but as long as they are eventually shown to the matches functionality as instantiations of lobbies, it doesn’t matter to us.

  • This will probably involve a 1-N relationship between tournaments and lobbies.

The other entities outlined in the tournaments ERD look like they are pretty restricted to tournaments, so there is not too much for us to say about those.

Clone this wiki locally