Giter Site home page Giter Site logo

acidhelm / killer_queen_scene_scoring Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 60 KB

Scene-wide scoring for Killer Queen tournaments

License: MIT License

Ruby 99.61% Shell 0.39%
challonge tournament brackets challonge-api killer-queen video-game

killer_queen_scene_scoring's Introduction

Killer Queen Scene Scoring

Build status Gem version Coverage status

This is an implementation of the scene-wide scoring system that was introduced in Bumble Bash 3. The idea is outlined in this Facebook post in the BB3 group.

The config file

The config file is a JSON file that contains information about the bracket. The file is attached to the first match in the bracket. Challonge apparently doesn't allow attachments with the .json extension, so you must use some other extension like .txt for it to be accepted.

The config file has some parameters, a list of teams, and the players on those teams. The parameters are:

{
  "base_point_value": 0,
  "next_bracket": null,
  "max_players_to_count": 3,
  "match_values": [ 1, 1, 1, 2, 2, 3, 3 ],
}

base_point_value: This is a number that is added to the point values in the match_values array. It is used in tournaments where some teams do not advance to the final bracket. Set this to the number of teams that did not advance. For example, if your tournament has 20 teams, and 12 play in the final bracket, set base_point_value to 8 (20-12).
next_bracket: Set this to the slug or the Challonge ID of a bracket that should be processed after the current bracket. Set it to null or omit it in the config file of the last bracket in the tournament. If you set this to the slug of a tournament that is owned by an organization, the string must be of the form "org_name-bracket_name", for example, "kq-sf-GDC3" (which is owned by the "kq-sf" organization).
max_players_to_count: The maximum number of players from a scene that can contribute to that scene's score. All config files in a tournament must have the same value for this field.
match_values: An array of integers. These are the points that are awarded to the players on a team for reaching each match of the bracket. For example, a team that reaches match 4 gets 2 points, since the 4th element in the array is 2. The example above is for a four-team double-elimination bracket. These numbers must currently be calculated by hand. However, once you calculate them for a particular type of bracket (e.g., double-elimination with 12 teams), you can reuse them for all future brackets of that same type.

Note that the last two values in the sample match_values are the same. Those represent the two matches in the grand final. Those numbers are the points awarded for reaching a match, not winning a match. Once a bracket is complete, the team that won the grand final is awarded one additional point.

The config file also holds a list of teams and their players. After the parameters, write a teams array that lists the teams, the names of their players, and the scenes that the players represent.

{
  /* parameters here */
  "teams": [
    {
      "name": "Midwest Madness (CHI/MPLS/KC)",
      "players": [
        {
          "name": "Alice",
          "scene": "Chicago"
        },
        {
          "name": "Bob",
          "scene": "Chicago"
        },
        {
          "name": "Charlie",
          "scene": "Minneapolis"
        },
        {
          "name": "Dani",
          "scene": "Minneapolis"
        },
        {
          "name": "Eve",
          "scene": "Kansas City"
        }
      ]
    },
    /* other teams... */
  ]
}

The team name in the config file must match the team's name in the Challonge bracket, although the case of letters may differ. This means that a team must have the same name in all the brackets in a tournament.

Calculating scores

id = "tvtpeasf"  # Replace this with your tournament's slug or ID

t = KillerQueenSceneScoring::Tournament.new(id: id, api_key: your_api_key)

if t.load
  t.calculate_points
  puts t.scene_scores.sort
end

killer_queen_scene_scoring's People

Contributors

acidhelm avatar dependabot[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.