Scoring rules
Central discipline rules
The rules of each discipline (scoring profile, default divisions and categories, RO notes) live centrally in the portal (discipline_rules), managed by the MakeReady admin only. Staff and members can read them (GET /api/v1/rules), the web portal shows them, and tablets sync them automatically whenever they are online. Every change increments the rules version.
A match copies the scoring profile from the central rules when it is created and records rulesVersion. A later rules change therefore never alters a running or finished match; a match admin can re-apply the current rules to a match that has no approved scores yet (POST /matches/:id/rules/reapply). The code defaults in packages/shared/src/profiles.ts are only the seed for version 1.
Scoring engine
The engine in packages/scoring is profile-driven: when a match is created it gets a copy of the ScoringProfile of its discipline (packages/shared/src/profiles.ts) and can adjust it per match. Later rule changes therefore never affect old matches.
Input per competitor per stage (StageScore)
hits[]per target:A/C/D(paper),M(explicit misses),NS(at most 2 no-shoot hits count per target; the tablet and the portal correction form do not accept more),hit(steel 0/1).- On the tablet, "Scoring complete!" is only possible once a time is recorded and every paper target has exactly its required hits entered (A/C/D/M); steel is always complete (hit or standing). A DQ ends the stage regardless.
procedurals,dnf,dq. On the tablet every procedural penalty is given with a reason chosen from the IPSC procedural penalties (rulebook chapter 10.2: stage briefing not followed, faulting a line, mandatory reload not performed, wrong hand, wrong position or port, creeping, failure to engage a target, mover not activated, shooting after leaving the position, reload or handling outside the designated area, or a free-text "other"). The reasons travel with the score (proceduralReasons, one entry per penalty), are shown on the approval screen and appear with the result in the app and on the website (packages/shared/src/procedurals.ts).timeSecondsand optionally allshotTimes[]from the timer.revision: incrementing per (competitor, stage). Corrections = new revision.approvedAt: the score only counts officially after the competitor has approved it.signature: optional; older app versions let the competitor sign on the tablet when approving ("W,H|x,y x,y|…", one stroke per segment) and the portal still shows such signatures. Since app 0.1.30 approval is a tap on APPROVE without a signature.notescarries the DQ reason (DQ: …) and the correction reason (Correction: …).approvedByCompetitor: a correction made in the portal counts at once but carriesfalseuntil the competitor approves it again on a tablet (Score → Approve correction: the pre-filled summary is approved as a new revision with the same content). The portal and the app show Awaiting competitor approval until then; corrections made on the tablet go through the approval screen directly.
Drills (trainings): several strings side by side
A training stage can be a drill (Stage.kind = 'drill', strings = number of strings; matches have regular stages only). Every string is a run of its own: time, shot times, hits and procedurals (StageScore.strings), scored like a stage (stringResults). The stage ranking counts the best string (highest hit factor, lowest total time on time plus; withBestString copies it into the stage-level fields of the score), and the results, the app's results screen, the live dashboard and the public scoreboard show the hit factor (or time) of every string next to each other with the counting one marked, so the shooter sees which string went better. Once a competitor has a score on a drill, its kind and number of strings are frozen like the rest of the stage. The .psc export writes a drill as a one-string stage with the best string. Tests: packages/scoring/test/strings.test.ts.
Normalisation of hits (normalizeHits)
- Per paper target only the best
requiredHitshits count (A > C > D). - Missing required hits become misses, unless the RO already entered more misses (maximum of both) or the target is disappearing.
- Steel:
hit = 1scores, otherwise a miss. A target without input counts as completely missed. - No-shoots always count, even on targets that are no longer in the stage.
IPSC Handgun — Comstock (method: comstock, ranking: stage_points)
| Major (PF ≥ 160) | Minor (PF ≥ 125) | |
|---|---|---|
| A | 5 | 5 |
| C | 4 | 3 |
| D | 2 | 1 |
| Steel | 5 | 5 |
| Miss / No-shoot / Procedural | −10 | −10 |
- A competitor's stage points are never negative.
- Hit factor = points / time (4 decimals). Without a valid time the stage counts for zero.
- The stage winner (highest HF) gets the maximum (
roundCount × 5); the others getHF / topHF × max. This happens within the chosen population: a division ranking has its own stage winners, and so does the overall ranking. - Match points = sum of stage points; percentage relative to the winner.
- The scoring method (Comstock or time plus) is a property of the match, not of a stage; every stage of a Comstock match is scored as Comstock.
- Divisions can force a power factor (
forcedPowerFactor): Production and Production Optics are always minor. - DQ (
dq: trueon a score orcompetitor.disqualified): the competitor disappears from the standings (rank 0, all stages zero). DNF: that stage counts zero; on the tablet a DNF needs neither a time nor the hits. - No-show (
competitor.noShow): registered but not present. The competitor is left out of the shooting order (the rotation runs over the competitors who are there) and, as long as they have no score, out of the standings. - Shooting order: a squad shoots in the order of the competitor numbers and rotates per stage (
shootingOrder): on stage 2 the second competitor starts, on stage 3 the third, and so on. Until the first score is approved the order can be changed on the tablet: Randomize redeals the numbers, and holding a competitor in the list moves that one competitor (numbersForShootingOrderhands the squad's own numbers out again).
FDS (FDS_PROFILE)
Exactly the IPSC Handgun rules and divisions; FDS is simply not an official IPSC discipline. It is a separate discipline value (fds) so matches and results can be filtered on it.
LVR — Low Velocity Rifle (LVR_PROFILE)
Comstock with minor scoring only (A5/C3/D1), comparable to IPSC Mini Rifle; allowMajor: false ignores a declared major. See docs/open-questions.md for the details still to be confirmed.
Multigun — Time plus (method: time_plus)
- Total time = raw time + zone time + penalty time.
- Zone time per scored hit: A 0 s, C 0.5 s, D 1.5 s (
timePenalties.zones). Only the bestrequiredHitshits per paper target count, as in Comstock. - Penalties: miss 5 s (per missing required hit, derived from
requiredHits), no-shoot 5 s, procedural 5 s, failure to neutralize 0 s. All values are configurable per match (PATCH /matches/:idwithscoring). - DNF: a fixed DNF time per match (
scoring.dnfTimeSeconds, 180 s by default from the central multigun rules; editable in the match settings of the portal and the app). A stage's owndnfTimeSecondsoverrides it; without either, par time + all misses, otherwise the slowest valid time of the field + all misses, so that a DNF always finishes last. - Ranking:
total_time(default): sum of times, lowest wins; missing stages count the DNF time so that incomplete competitors do not end up on top.time_percentage: stage winner 100 points, othersfastest / own × 100; sum over stages; match percentage relative to the winner.
Brutality — on the clock (BRUTALITY_PROFILE)
A multigun discipline scored on time alone (method: time_plus, ranking: total_time, stageTimeLimit: true).
- Time limit per stage: the stage's par time (
parTimeSeconds) is its time limit and every stage needs one. The stage stops there, so a time above the limit counts as the limit (timeCappedin the result); what was not shot by then is scored as misses. - Targets are hit or miss (kind
plate): a target starts as hit and the RO marks the misses. There are no zones and no no-shoots. A stage does not need a target: it may consist of bonuses, bonus targets, objectives or procedurals alone (at least one of any kind). - Bonuses: a stage lists what can be earned, each with a name and a number of seconds (a target of kind
time_bonus:labelis the name,secondsthe value,requiredHits0). The RO taps the bonuses that were earned, and gives one again with + when it was earned more than once: the seconds come off every time (hitis the number of times, at most 10). A bonus that was not earned counts for nothing, never as a miss. - Bonus targets (kind
bonus_target): a target with a name that has to be hit a number of times (requiredHits, 1 to 10). Every hit takessecondsoff the time and every hit that is missing addsmissSeconds; either may be zero. The RO enters the number of hits (stored inhit) and has to choose it, also when it is zero. Its misses use its own seconds, not the miss penalty of the discipline, and are not counted as misses. - Objectives (kind
objective): a task with a name (label) and a number of seconds that is added when it is not met (hit: 0). An objective starts as met (hit: 1) and the RO taps the ones that were not; one that was met gives no bonus. - Procedurals of the stage (kind
procedural): procedural errors that exist on this stage only, each with its own description (label) and penalty (seconds). The RO gives one with + every time it happened (hitis the number of times, at most 10) and its seconds are added each time. They stand next to the procedurals of the discipline and are not counted in the procedural count of the score. - Stage time = time (at most the limit) − bonuses × the times they were earned − bonus target hits × their seconds + misses × miss seconds + procedurals × procedural seconds + missing bonus target hits × their seconds + objectives not met + procedurals of the stage, never below zero.
- Penalty seconds (
timePenalties.miss,timePenalties.procedural, 10 s each to start with) are set in the central rules of the discipline by the MakeReady admin (website → Rules); a match copies them when it is created. - Half seconds: every number of seconds of a penalty or a bonus may have decimals (2.5 s, 0.5 s): the penalties of the discipline, and the seconds of a bonus, a bonus target (per hit and per missing hit), an objective and a procedural of the stage. The app takes a decimal point or a decimal comma. Totals are rounded to hundredths and shown without trailing zeros (
formatSeconds,parseSecondsinpackages/scoring). - DNF: the time limit plus a miss for every target, every bonus target completely missed and every objective not met.
- Match ranking: the sum of the stage times, lowest first.
time_bonus, bonus_target, objective, procedural and the time limit are not tied to this discipline by name: any time-plus profile may use them, and stageTimeLimit switches the limit on. Seconds added by bonus targets, objectives and procedurals of the stage are part of penaltySeconds in the result; seconds taken off are part of bonusSeconds.
Chrono (power factor)
On the tablet, Manage → Chrono (disciplines that allow major) takes the bullet weight in grains and three velocities in fps per competitor. Power factor = grains × average fps / 1000 (chronoResult in packages/scoring), classified against the discipline thresholds (scoring.powerFactorThresholds, IPSC Handgun: major from 160, minor from 125; below = sub-minor, flagged in red for the Range Master). Saving stores the measurement with the competitor (chrono) and sets the declared power factor (a division with a forced power factor keeps it); the portal shows the measured PF next to the declared one.
Competitions
A competition ranks events of one discipline in one calendar year together. There are two kinds of owner and two formats.
- Of MakeReady (set up by MakeReady admins on the website → Admin → Competitions): for everyone. Club admins link a match from its settings (matches only, same discipline, the match's year must be the competition's).
- Of a club (internal; set up by the admins of the club on the website → Competitions): the club's own trainings and matches of that discipline and year can join, also the ones that come from the club portal. The admins choose the events on the page of the competition ("Events in this competition") or in the settings of an event. The competition and its ranking are visible to everyone or to the members of the club only, whatever the visibility of the events in it; it stays out of the public calendar. An event is in one competition at a time.
One match over several events (rules.format: 'combined')
Several trainings or matches that are one match together, for example the training of Tuesday and the training of Wednesday that form one club match. Everyone is ranked in one list, stage by stage, exactly as a single event would be (combineEvents in packages/scoring/src/combined.ts, then rankMatch):
- Stages (
rules.stages): withsame(the default) the events are sessions of the same course of fire: stage 1 of every event is one stage, so whoever shot it on Tuesday is compared with whoever shot it on Wednesday. The stage of the first event (by date) is the definition; a later event whose stage with that number has other targets is reported as a warning and scored as the first. Withseparateevery event brings its own stages (a match spread over several days); they are numbered on in the order of the events. - Taking over stages: the stages are made once, in one of the events. On the page of the competition every other event gets a button "Take over n from <date>" (also on the Stages tab of an event: "Take over the stages of…", for any event of the same discipline). The stages whose number the event does not have yet are added as its own stages, with the same name, targets, times, briefing and active flag; nothing that is there is overwritten, so it can be repeated after a stage was added. Scores, documents and squads are not taken over; a drill only goes to a training.
- Competitors are one person across the events when the name is the same (case, accents, punctuation and spaces ignored), with the division, power factor and categories of their first event. Someone can shoot stage 1 on Tuesday and stage 2 on Wednesday.
- A stage counts once: when someone has an approved score for the same stage in two sessions, the first session's score counts; the later one is left out and reported as a warning.
- A disqualification in any event is a disqualification in the combined match; a no-show in every event is left out; inactive stages are ignored; approved scores only, with the corrections of the session that counts.
- The scoring profile and the divisions are those of the first event.
- The page shows the result per stage (the stage percentage, or the time with penalties), the total, and the session(s) each competitor shot in. A shootoff can be seeded from it like from any competition, and the whole combined match is exported as one
.pscfile (docs/psc-export.md).
A series (rules.format: 'series', the default)
Every event is a match of its own and the percentages add up. The ranking (rankCompetition in packages/scoring/src/competition.ts) takes every linked, non-archived match, ranks it (overall or one division) and turns each competitor's result into their percentage of that ranking's winner; the percentages are summed: every result, only the best countBest, or (the default) only the best results of as many matches as the minimum, so shooting more matches than required only replaces weaker results. A competitor is ranked once they shot at least the required number of matches: half of the competition's matches plus one by default (6 → 4, 5 → 3) or a fixed number; the others are listed below the ranked ones. A DQ counts as a match shot with 0 %. Competitors are matched across matches by name (case, accents and punctuation ignored, so D'Hondt and D’Hondt are one person), never by account, and are ranked in the division of their first match of the competition: a later match in another division still counts (scored in the division it was shot in) but does not move them. Other wordings of a division ("STD", "Iron", "PCC Optics") are resolved through the division names the MakeReady admins map to the discipline's codes (website → Admin → Division names; matched without case against a match's division code and name; the same mappings place an imported PractiScore match in the right division). Names are cleaned up in the competition's matches with the workflow Clean up competitor names (scripts/normalize-names.mjs: whitespace, apostrophes, the most common spelling of one person, plus the explicit corrections of typos in scripts/name-fixes.json; spellings that look like one person but are not in that list, and swapped first/last names, are only reported; every rename lands in the audit log). Tests: packages/scoring/test/competition.test.ts, combined.test.ts, names.test.ts; apps/portal/test/clubCompetitions.test.ts.
Category and team standings
- Categories (Lady, Junior, Senior, … as configured per match): a category ranking is the overall ranking restricted to the competitors registered in that category, with its own stage winners. Portal: Results tab → Category; API:
results.categories[code],results/detail?category=. - Teams: every competitor can carry a free-text
teamname; competitors with the same name form a team. The best three results count (highest match points, or lowest total time fortotal_time); a DQ never counts; teams with fewer than three results rank below complete teams. Team standings are computed within the selected ranking (overall, division or category) and appear under the standings in the portal, in the detail API (teams) and in the CSV export (rankTeamsinpackages/scoring). - Stage results (one stage, ranked by stage result) and per-shot analysis (every shot time with its split, slowest split highlighted) are in the portal's Results tab; both come from the detail API.
Tests
pnpm --filter @makeready/scoring test — the tests cover zones/PF, derived misses, best-hits rule, steel, disappearing targets, DNF/DQ, LVR, FDS and division defaults, forced minor via division, stage points, division-specific stage winners, revisions/approval, time-plus zone times and both time-plus rankings.
Shootoff (elimination bracket)
A shootoff has no stage scores: shooters or teams (each registered as a competitor) meet head to head in an elimination bracket. The format is chosen when the bracket is started (and can be changed when it is regenerated):
| Setting | Options | Meaning |
|---|---|---|
| Elimination (lives) | 1, 2, 3 | losses before a competitor is out: single elimination; double elimination (winners + losers bracket); triple, with a last chance bracket that receives the losers of the losers bracket and a lower final between the champions of both lower brackets |
| Second chance for round 1 | off, on | single elimination only: the losers of round 1 get one more bout (see below) |
| Who meets whom | 1 against the last, top half against bottom half | how the entrants are paired (see below) |
| Bouts | 1, 3, 5 heats | a bout is won by the first side with more than half of the heats (2 of 3, 3 of 5); the RO records every heat |
| Finals | 1, 3, 5 heats | the same for the lower final and the grand final |
The finals are series: the grand final is replayed as long as the loser still has a life left, so the winners' champion (no losses) must be beaten lives times in a row by a challenger who is already carrying losses. The replays exist in the bracket from the start and are marked not needed once the series is decided.
- No squads: a shootoff only has competitors or teams (each team registered as one competitor); the squad screens are hidden for it.
- Order of the entrants (seeding): the order of the competitor numbers. It is set on the Bracket tab (portal, and Manage → Bracket in the app) before the bracket is generated:
- By hand: move entrants up and down and save the order; the numbers become 1, 2, 3, … in that order.
- The ranking of a competition (overall, or one of its divisions): the best ranked entrant is number 1. Whoever did not enter leaves no gap (when number 2 of the competition is absent, its number 3 is seed 2), and whoever the competition does not know comes last, in the order of the numbers they had. Entrants are matched by name, like the competition itself does. The numbers follow the ranking again whenever the bracket is generated, so registrations that came in later are in it.
- A competition can also be chosen with the order by hand: its ranking is shown next to the names and can be taken over once, to be adjusted.
- Who meets whom:
- 1 against the last (default): 1 v last, 2 v second to last, … in a bracket of the next power of two; missing entrants are byes, which go to the top seeds in round 1.
- Top half against bottom half: 1 against the first of the second half, 2 against the next, … (80 entrants: 1 v 41, 2 v 42, …, 40 v 80), and the same again among the winners (the winner of bout 1 meets the winner of bout 21), so numbers 1 and 2 can only meet in the final. Everyone shoots round 1; with an odd number the last of the top half sits out. When the number left is no power of two, the best placed go straight to the next round until it is (80 entrants: 40 winners, the first 24 wait while the other 16 shoot 8 bouts, 32 go on). Whoever sat out a round shoots the next one: a round is sat out by those whose line did not sit out yet, or did so longest ago.
- Second chance for round 1 (single elimination): the losers of round 1 meet each other in a second chance round while the winners of round 1 meet each other in round 2. In round 3 the winners of round 2 meet the winners of the second chance round (taken from the other end of the list and from other bouts of round 1, so the two did not meet before); from there on one loss is the end. A loser of round 1 is out after two losses, everyone else after one. It needs at least two bouts in round 1.
- Start: pressed once, just before the first round (portal tab Bracket or the tablet). The bracket is generated from the competitor numbers. From then on the entrants cannot change. An admin can regenerate the bracket at any time (portal or tablet, after a typed/explicit confirmation): a fresh bracket is built from the current competitors and every decided bout is discarded.
- Winners bracket: the loser of every bout drops into the losers bracket. Losers bracket: odd rounds pair the survivors, even rounds bring in the losers of the next winners round; a loss here eliminates.
- Grand final: winners' champion against losers' champion. Because the winners' champion has not lost yet, a win by the losers' champion forces a reset final; that bout is in the bracket from the start and is marked not needed when the winners' champion takes the first final.
- Deciding a bout: the RO taps the winner (green); the other side turns red. In best-of bouts each tap records a heat for that side and the bout turns green/red once a side has enough heats. "Clear" (portal) or holding a side (tablet) removes the last heat or the bout's result as long as no later bout that depends on it is decided. Decisions sync like scores (the latest decision per bout wins; the portal validates every one).
- Placements: the champion first, then by the bout in which a competitor lost its last life (later rounds place higher; equal rounds share a place).
Engine: generateBracket, resolveBracket, validateBoutResult in packages/scoring/src/bracket.ts, the order by a ranking in packages/scoring/src/seeding.ts, with tests.